Commit 64312ae1 authored by david.verdin's avatar david.verdin
Browse files

[svn] Merging the latest bug fixes from the Sympa 6.0 branch.


git-svn-id: https://subversion.renater.fr/sympa/trunk@6045 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 409617b7
This diff is collapsed.
......@@ -33,7 +33,7 @@ installdir:
@for dir in $(expldir) $(spooldir) $(spooldir)/msg $(spooldir)/digest \
$(spooldir)/moderation $(spooldir)/expire $(spooldir)/auth \
$(spooldir)/outgoing $(spooldir)/tmp $(spooldir)/task \
$(bouncedir) $(arcdir) $(piddir) $(staticdir); do \
$(bouncedir) $(arcdir) $(piddir) $(staticdir) $(sysconfdir); do \
if [ ! -d $(DESTDIR)$$dir ] ; then \
echo "Creating $(DESTDIR)$$dir"; \
install -d -m 755 $(DESTDIR)$$dir; \
......
......@@ -3,7 +3,88 @@
(See Changelog file for the full changes log)
6.0b.1 10 June 2008
6.0b.2 31 July 2009
Features:
No new features. Just stabilisation of the 6.0 beta version.
Changes:
src/confdef.pm: define longer period for default values of cleandelay_xx parameters
src/lib/List.pm, /src/lib/confdef.pm: Now ttl and distribution_ttl list parameters
take their defaults in default_ttl and default_distribution_ttl sympa.conf parameters.
po/de.po, po-wwsympa/de.po: [Submitted by M. Warkus, univ. Marburg] Updated German translation.
***** The directory in which all the default configuration files and directories is installed
***** is now "default", under the root installation directory. In the previous release, it was
***** share/sympa/default. You should remove this directory now to avoid confusion.
New configure option: '--enable-fhs'. Sympa supports two kinds of files hierarchies. The historical one, where by default all is gathered in the Sympa directry, and also the FHS recommended hierarchy. Now if the '--enable-fhs' configure option is set, Sympa is installed according to the FHS. Otherwise, it is installed using the historical paths.
Bug fixes:
src/sympa_wizard.pl.in: [Reported by P. Maes, univ. Louvain] Net::Netmask CPAN module
was not checked by the Sympa wizard, though it is required.
d_install_shared.tt2, mail_tt2/moderate.tt2, mail_tt2/modindex.tt2,
mail_tt2/user_notification.tt2, mail_tt2/welcome.tt2, po/fr.pomail_tt2/moderate.tt2:
[Submitted by P. Maes, univ. Louvain] The one time ticket URL was included in the
internationalization message. It had no sense, as an URL won't be translated, and any
change in the layout (such as putting the URL in another line) would break the translation
key. Fixed by putting the URL out of the i18n string.
src/etc/script/create_db.mysql: [Submitted by D. Ayre, univ. E. Carr, Vancouver]
A missing comma in create_db.mysql made the creation script fail with an SQL error.
src/lib/Conf.pm: [Reported by M. Warkus, univ. Marburg] When using the default robot,
wwsympa.conf parameters were not taken into account, only the default values set
in confdef.pm. The value could only be set in sympa.conf. This was due to the load_robots
function which initialized the config with default values and sympa.conf values and then
looked for customized values for virtual hosts only. Fixed by replacing default values by
their equivalent in wwsympa.conf when found.
wwsympa/wwsympa.fcgi.in: [Reported by Wen Si] Single value and single instance list
parameters value could not be removed using the web interface. fixed by *not* going
directly to the next parameter in do_edit_list when such a parameter is found empty.
src/lib/Upgrade.pm: [Reported by A. Suter, crox.net] "0" character was not allowed in
md5 encoded passwords. Changed regular expression to allow it.
src/lib/Sympa/Constants.pm.in: [Reported by N. Matthies] Typo in ARCDIR constant declaration.
src/task_manager.pl.in: [Reported by N. Matthies] The task manager failed to process the
eval_bouncers and purge_orphan_bounces tasks because the corresponding functions did not
return 1. It cause the manager to conclude there had been an error.
Makefile.am, configure.ac: [Reported by N. Matthies] It looks like some "general_task_models"
and "task_models" directory still installed in the etc directory. These directory are not used
anymore. this was due to a command in Makefile.am installing "non writable directories".
These directories were all isntalled in a separate part of the install process, using
their normal names and location.
src/lib/Conf.pm, src/lib/confdef.pm: Sympa doesn't complain anymore when an optional parameter
is missing in robot.conf.
src/lib/Bulk.pm: [Reported by Wen Si] A query in the Bulk.pm module was using MySQL-specific SQL orders.
This caused Oracle (and probably Sybase too) to fail to lock packets in database.
Fixed by splitting the query into a selection followed by an update,
and by tweeking it on the base of the RDBMS used.
src/etc/script/create_db.SQLite, src/lib/Upgrade.pm: [Submitted by M. deranek, slonko.net]
SQLite support was broken in Sympa, due to syntax errors.
src/etc/script/ldap_alias_manager.pl.in: --modulesdir-- placeholder was badly spelled in
ldap_alias_manager.pl, cauing it not to be replaced by its real value at install time.
src/sympa_wizard.pl.in: Removing useless warning when the 'file' parameter is not indicated
in the confdef.pm parameter definition. This 'file' parameter is used only when we want to
write a value by default in the config file. Otherwise default value will be used.
6.0b.1 16 June 2009
Features:
......
# configure.in - Top-level configure.in for Sympa
dev# configure.in - Top-level configure.in for Sympa
# RCS Identication ; $Revision$ ; $Date$
#
# Sympa - SYsteme de Multi-Postage Automatique
......@@ -20,65 +20,74 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
AC_PREREQ(2.59)
AC_INIT(sympa, 6.0b, sympa-authors@cru.fr)
AC_INIT(sympa, 6.0b.2, sympa-authors@cru.fr)
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AM_PO_SUBDIRS
AC_PREFIX_DEFAULT(/home/sympa)
# for upgrade, set default values to match previously used locations
if test -f /etc/sympa.conf; then
# $prefix variable initialisation seems to be tricky
if test "$prefix" = "NONE"; then
prefix=$ac_default_prefix
fi
# standard variables
# check current value before re-assigning
if test "$sbindir" = '${exec_prefix}/sbin'; then
sbindir=$prefix/bin
fi
if test "$libexecdir" = '${exec_prefix}/libexec'; then
libexecdir=$prefix/bin
fi
# custom variables
initdir=/etc/rc.d/init.d
piddir=$prefix
lockdir=$localstatedir/lock/subsys
modulesdir=$prefix/bin
scriptdir=$prefix/bin
datadir=$prefix/default
defaultdir=$datadir
mailtemplatedir=$defaultdir/mail_tt2
webtemplatedir=$defaultdir/web_tt2
execcgidir=$prefix/bin
expldir=$prefix/expl
spooldir=$prefix/spool
staticdir=$prefix/static_content
arcdir=$prefix/arc
bouncedir=$prefix/bounce
localedir=$prefix/locale
confdir=/etc
else
initdir=$sysconfdir/rc.d/init.d
piddir=$localstatedir/run
lockdir=$localstatedir/lock/subsys
modulesdir=$datadir/sympa/lib
scriptdir=$datadir/sympa/bin
defaultdir=$datadir/sympa/default
mailtemplatedir=$defaultdir/mail_tt2
webtemplatedir=$defaultdir/web_tt2
execcgidir=$libdir/sympa/cgi
expldir=$localstatedir/lib/sympa
staticdir=$localstatedir/lib/sympa/static_content
spooldir=$localstatedir/spool/sympa
arcdir=$localstatedir/lib/sympa/arc
bouncedir=$localstatedir/lib/sympa/bounce
localedir=$datadir/sympa/locale
confdir=$sysconfdir
## first initialises parameters to the standard Sympa filesystem organization
# $prefix variable initialisation seems to be tricky
if test "$prefix" = "NONE"; then
prefix=$ac_default_prefix
fi
# standard variables
# check current value before re-assigning
if test "$sbindir" = '${exec_prefix}/sbin'; then
sbindir=$prefix/bin
fi
if test "$libexecdir" = '${exec_prefix}/libexec'; then
libexecdir=$prefix/bin
fi
# custom variables
initdir=/etc/rc.d/init.d
piddir=$prefix
lockdir=$localstatedir/lock/subsys
modulesdir=$prefix/bin
scriptdir=$prefix/bin
datadir=$prefix/default
defaultdir=$datadir
mailtemplatedir=$defaultdir/mail_tt2
webtemplatedir=$defaultdir/web_tt2
execcgidir=$prefix/bin
expldir=$prefix/expl
spooldir=$prefix/spool
staticdir=$prefix/static_content
arcdir=$prefix/arc
bouncedir=$prefix/bounce
localedir=$prefix/locale
confdir=/etc
## If installer wants to use the FHS standard, change
AC_ARG_ENABLE(
fhs,
AS_HELP_STRING(
[--enable-fhs],
[use standard FHS files and directories locations and naming (default is no)]
),
[
if test $enableval = 'yes';then
initdir=$sysconfdir/rc.d/init.d
piddir=$localstatedir/run
lockdir=$localstatedir/lock/subsys
modulesdir=$datadir/sympa/lib
scriptdir=$datadir/sympa/bin
defaultdir=$datadir/sympa/default
mailtemplatedir=$defaultdir/mail_tt2
webtemplatedir=$defaultdir/web_tt2
execcgidir=$libdir/sympa/cgi
expldir=$localstatedir/lib/sympa
staticdir=$localstatedir/lib/sympa/static_content
spooldir=$localstatedir/spool/sympa
arcdir=$localstatedir/lib/sympa/arc
bouncedir=$localstatedir/lib/sympa/bounce
localedir=$datadir/sympa/locale
confdir=$sysconfdir
fi
],
)
# substitute custom variables
AC_SUBST(initdir)
AC_SUBST(piddir)
......
This diff is collapsed.
This diff is collapsed.
......@@ -6324,7 +6324,8 @@ msgstr ""
#. (conf.wwsympa_url,list.name)
#: ../mail_tt2/d_install_shared.tt2:7
msgid "The list document repository:"
#, fuzzy
msgid "The list document repository : %1/d_read/%2"
msgstr "L'espace documents de la liste : "
#: ../mail_tt2/d_reject_shared.tt2:2
......@@ -8095,18 +8096,24 @@ msgstr "Ce message a été marqué comme spam."
msgid "They are %1 messages awaiting moderation."
msgstr "IL y a %1 messages en attente de modération."
#. (conf.wwsympa_url,one_time_ticket)
#: ../mail_tt2/moderate.tt2:18
#, fuzzy
msgid ""
"To browse the awaiting messages, you should click on the following link:"
"To browse the awaiting messages, you should click on the following link : %1/"
"ticket/%2"
msgstr ""
"Pour consulter la liste des messages en attente, veuillez cliquer sur le "
"lien suivant :"
"Pour consulter les messages en attente, veuillez cliquer sur le lien "
"suivant : %1/ticket/%2"
#. (list.name)
#. (list.name,conf.wwsympa_url,modkey)
#: ../mail_tt2/moderate.tt2:24
#, fuzzy
msgid ""
"To tag the message in list %1 for the appropriate topic, please use the "
"following link:"
"following link :\n"
"\n"
"%2/viewmod/%1/%3\n"
msgstr ""
"Pour sélectionner un thème pour votre message, adressé à la liste %1, "
"consultez la page suivante :"
......@@ -8118,17 +8125,19 @@ msgstr "Pour diffuser le message ci-joint dans la liste %1 :"
#. (conf.email,conf.host)
#: ../mail_tt2/moderate.tt2:32 ../mail_tt2/moderate.tt2:37
msgid "Or send a message to %1@%2 with the following subject:"
#, fuzzy
msgid "Or send a message to %1@%2 with the following subject :"
msgstr "ou envoyez un e-mail à %1@%2 avec comme sujet :"
#: ../mail_tt2/moderate.tt2:35
msgid "To reject it (it will be removed):"
msgstr "Pour refuser sa diffusion (il sera effacé), cliquez ici :"
#. (conf.wwsympa_url)
#: ../mail_tt2/moderate.tt2:40 ../mail_tt2/modindex.tt2:10
msgid "The messages moderating documentation:"
msgstr ""
"La documentation relative à la modération des messages :"
#, fuzzy
msgid "The messages moderating documentation: %1/help/admin#moderate"
msgstr "La documentation relative à la modération des messages :"
#. (list.name)
#: ../mail_tt2/modindex.tt2:2
......@@ -8491,12 +8500,16 @@ msgid ""
msgstr "Vous avez été nommé modérateur de la liste %2@%3 par %1. "
# nlsref 15,14
#. (conf.wwsympa_url,list.name)
#: ../mail_tt2/user_notification.tt2:35 ../mail_tt2/welcome.tt2:12
msgid "The list homepage:"
#, fuzzy
msgid "The list homepage: %1/info/%2"
msgstr "La page d'accueil de la liste :"
#. (conf.wwsympa_url)
#: ../mail_tt2/user_notification.tt2:36
msgid "Owner and moderator guide:"
#, fuzzy
msgid "Owner and moderator guide: %1/help/admin"
msgstr "Le guide de l'administrateur :"
#: ../mail_tt2/user_notification.tt2:40
......@@ -8541,8 +8554,10 @@ msgstr "Bienvenue dans la liste %1@%2"
msgid "Your subscription email is %1"
msgstr "Votre adresse d'abonné est : %1"
#. (conf.wwsympa_url)
#: ../mail_tt2/welcome.tt2:13
msgid "General informations about mailing lists:"
#, fuzzy
msgid "General informations about mailing lists: %1/help/introduction"
msgstr "Introduction aux listes de diffusion :"
# nlsref 4,17
......@@ -9213,6 +9228,12 @@ msgstr ""
"Les messages peuvent être consultés par mail (abonnement) ou par l'interface "
"web"
#~ msgid ""
#~ "To browse the awaiting messages, you should click on the following link:"
#~ msgstr ""
#~ "Pour consulter la liste des messages en attente, veuillez cliquer sur le "
#~ "lien suivant :"
#~ msgid "-List definition"
#~ msgstr "Définition de la liste"
......@@ -9637,13 +9658,6 @@ msgstr ""
#~ "Un utilisateur a demandé à être abonné à votre liste. Pour consulter "
#~ "toutes les demandes en attente, veuillez cliquer sur ce lien :"
#~ msgid ""
#~ "To browse the awaiting messages, yshould click on the following link : %1/"
#~ "ticket/%2"
#~ msgstr ""
#~ "Pour consulter les messages en attente, veuillez cliquer sur le lien "
#~ "suivant : %1/ticket/%2"
#~ msgid ""
#~ "Changing your email address is a sensitive operation so we need to verify "
#~ "that it is really your email."
......
CREATE TABLE user_table (
email_user varchar (100) NOT NULL,
gecos_user varchar (150),
password_user varchar (40),
last_login_date_user integer,
last_login_host_user varchar (60),
email_user text NOT NULL,
gecos_user text,
password_user text,
last_login_date_user integer,
last_login_host_user text,
cookie_delay_user integer,
lang_user varchar (10),
attributes_user varchar(255),
data_user varchar(5000),
lang_user text,
attributes_user text,
data_user text,
PRIMARY KEY (email_user)
);
CREATE TABLE subscriber_table (
list_subscriber varchar (50) NOT NULL,
user_subscriber varchar (100) NOT NULL,
custom_attribute_subscriber varchar (500),
robot_subscriber varchar (80) NOT NULL,
list_subscriber text NOT NULL,
user_subscriber text NOT NULL,
custom_attribute_subscriber text,
robot_subscriber text NOT NULL,
date_subscriber timestamp NOT NULL,
update_subscriber timestamp,
visibility_subscriber varchar (20),
reception_subscriber varchar (20),
topics_subscriber varchar (200),
bounce_subscriber varchar (35),
bounce_address_subscriber varchar (100),
comment_subscriber varchar (150),
visibility_subscriber text,
reception_subscriber text,
topics_subscriber text,
bounce_subscriber text,
bounce_address_subscriber text,
comment_subscriber text,
subscribed_subscriber boolean,
included_subscriber boolean,
include_sources_subscriber varchar(50),
include_sources_subscriber text,
bounce_score_subscriber integer,
PRIMARY KEY (list_subscriber, user_subscriber, robot_subscriber)
PRIMARY KEY (robot_subscriber, list_subscriber, user_subscriber)
);
CREATE INDEX subscriber_idx ON subscriber_table (user_subscriber,list_subscriber,robot_subscriber);
CREATE TABLE admin_table (
list_admin varchar(50) NOT NULL,
user_admin varchar(100) NOT NULL,
robot_admin varchar(80) NOT NULL,
role_admin varchar(15) NOT NULL,
list_admin text NOT NULL,
user_admin text NOT NULL,
robot_admin text NOT NULL,
role_admin text NOT NULL,
date_admin timestamp NOT NULL,
update_admin timestamp,
reception_admin varchar(20),
visibility_admin varchar(20),
comment_admin varchar(150),
reception_admin text,
visibility_admin text,
comment_admin text,
subscribed_admin boolean,
included_admin boolean,
include_sources_admin varchar(50),
info_admin varchar(150),
profile_admin varchar(15),
PRIMARY KEY (list_admin, user_admin, robot_admin, role_admin)
include_sources_admin text,
info_admin text,
profile_admin text,
PRIMARY KEY (robot_admin, list_admin, role_admin, user_admin)
);
CREATE INDEX admin_idx ON admin_table(list_admin, user_admin, robot_admin, role_admin);
CREATE TABLE netidmap_table (
netid_netidmap varchar (100) NOT NULL,
serviceid_netidmap varchar (100) NOT NULL,
robot_netidmap varchar (80) NOT NULL,
email_netidmap varchar (100),
netid_netidmap text NOT NULL,
serviceid_netidmap text NOT NULL,
robot_netidmap text NOT NULL,
email_netidmap text,
PRIMARY KEY (netid_netidmap, serviceid_netidmap, robot_netidmap)
);
CREATE INDEX netidmap_idx ON netidmap_table(netid_netidmap, serviceid_netidmap, robot_netidmap);
......@@ -64,76 +64,76 @@ CREATE INDEX netidmap_idx ON netidmap_table(netid_netidmap, serviceid_netidmap,
CREATE TABLE logs_table (
id_logs integer NOT NULL,
date_logs integer NOT NULL,
robot_logs varchar(80),
list_logs varchar(50),
action_logs varchar(50) NOT NULL,
parameters_logs varchar(100),
target_email_logs varchar(100),
user_email_logs varchar(100),
msg_id_logs varchar(255),
status_logs varchar(10) NOT NULL,
error_type_logs varchar(150),
client_logs varchar(100),
daemon_logs varchar(10) NOT NULL,
robot_logs text,
list_logs text,
action_logs text NOT NULL,
parameters_logs text,
target_email_logs text,
user_email_logs text,
msg_id_logs text,
status_logs text NOT NULL,
error_type_logs text,
client_logs text,
daemon_logs text NOT NULL,
PRIMARY KEY (id_logs)
);
CREATE INDEX logs_idx ON logs_table(id_logs);
CREATE TABLE session_table (
id_session varchar(30) NOT NULL,
start_date_session integer NOT NULL,
date_session integer NOT NULL,
remote_addr_session varchar(60),
robot_session varchar(80),
email_session varchar(100),
hit_session integer,
data_session varchar(5000),
id_session text NOT NULL,
start_date_session integer NOT NULL,
date_session integer NOT NULL,
remote_addr_session text,
robot_session text,
email_session text,
hit_session integer,
data_session text,
PRIMARY KEY (id_session)
);
CREATE INDEX session_idx ON session_table(id_session);
CREATE TABLE one_time_ticket_table (
ticket_one_time_ticket varchar(30) NOT NULL,
robot_one_time_ticket varchar(80),
email_one_time_ticket varchar(100),
date_one_time_ticket integer,
data_one_time_ticket varchar(200),
remote_addr_one_time_ticket varchar(60),
status_one_time_ticket varchar(60),
ticket_one_time_ticket text NOT NULL,
robot_one_time_ticket text,
email_one_time_ticket text,
date_one_time_ticket integer,
data_one_time_ticket text,
remote_addr_one_time_ticket text,
status_one_time_ticket text,
PRIMARY KEY (ticket_one_time_ticket)
);
CREATE INDEX one_time_ticket_idx ON one_time_ticket_table_table(ticket_one_time_ticket);
CREATE INDEX one_time_ticket_idx ON one_time_ticket_table(ticket_one_time_ticket);
CREATE TABLE bulkmailer_table(
messagekey_bulkmailer varchar(80)) NOT NULL,
packetid_bulkmailer varchar(33)) NOT NULL,
receipients_bulkmailer text,
returnpath_bulkmailer varchar(100),
robot_bulkmailer varchar(80),
listname_bulkmailer varchar(50),
verp_bulkmailer integer,
priority_message_bulkmailer integer,
priority_packet_bulkmailer integer,
reception_date_bulkmailer integer,
delivery_date_bulkmailer integer,
lock_bulkmailer varchar(30),
constraint ind_bulkmailer PRIMARY KEY (messagekey_bulkmailer, packetid_bulkmailer)
CREATE TABLE bulkmailer_table (
messagekey_bulkmailer text NOT NULL,
packetid_bulkmailer text NOT NULL,
receipients_bulkmailer text NOT NULL,
returnpath_bulkmailer text NOT NULL,
robot_bulkmailer text NOT NULL,
listname_bulkmailer text DEFAULT NULL,
verp_bulkmailer integer NOT NULL,
merge_bulkmailer integer,
priority_message_bulkmailer integer NOT NULL,
priority_packet_bulkmailer integer NOT NULL,
reception_date_bulkmailer integer NOT NULL,
delivery_date_bulkmailer integer NOT NULL,
lock_bulkmailer text,
PRIMARY KEY (messagekey_bulkmailer,packetid_bulkmailer)
);
CREATE INDEX messagekey_bulkmailer_idx ON bulkmailer_table(messagekey_bulkmailer);
CREATE INDEX packetid_bulkmailer_idx ON bulkmailer_table(packetid_bulkmailer);
CREATE INDEX bulkmailer_idx ON bulkmailer_table(messagekey_bulkmailer,packetid_bulkmailer);
CREATE TABLE bulkspool_table (
messagekey_bulkspool varchar(33) NOT NULL,
message_bulkspool text,
lock_bulkspool integer,
constraint ind_bulkspool primary key (messagekey_bulkspool)
messagekey_bulkspool text NOT NULL,
message_bulkspool text NOT NULL,
lock_bulkspool integer NOT NULL,
PRIMARY KEY (messagekey_bulkspool)
);
CREATE INDEX messagekey_bulkspool_idx ON bulkspool_table(messagekey_bulkspool);
CREATE INDEX bulkspool_idx ON bulkspool_table(messagekey_bulkspool);
CREATE TABLE conf_table (
robot_conf varchar(80),
label_conf varchar(80),
value_conf varchar(300)
robot_conf text DEFAULT NULL,
label_conf text DEFAULT NULL,
value_conf text DEFAULT NULL,
PRIMARY KEY (robot_conf,label_conf)
);
CREATE INDEX robot_conf_idx ON conf_table(robot_conf,label_conf);
\ No newline at end of file
CREATE INDEX conf_idx ON conf_table(robot_conf,label_conf);
......@@ -19,7 +19,7 @@ $ENV{'PATH'} = '';
## Load Sympa.conf
use strict;
use lib '--modulesdir';
use lib '--modulesdir--';
use Conf;
use POSIX;
require tools;
......
......@@ -86,18 +86,47 @@ sub next {
my $lock = &tools::get_lockname();
my $order;
my $limit_oracle='';
my $limit_sybase='';
## Only the first record found is locked, thanks to the "LIMIT 1" clause
$order = 'ORDER BY priority_message_bulkmailer ASC, priority_packet_bulkmailer ASC, reception_date_bulkmailer ASC, verp_bulkmailer ASC LIMIT 1';
$order = 'ORDER BY priority_message_bulkmailer ASC, priority_packet_bulkmailer ASC, reception_date_bulkmailer ASC, verp_bulkmailer ASC';
if (lc($Conf::Conf{'db_type'}) eq 'mysql' || lc($Conf::Conf{'db_type'}) eq 'pg' || lc($Conf::Conf{'db_type'}) eq 'sqlite'){
$order.=' LIMIT 1';
}elsif (lc($Conf::Conf{'db_type'}) eq 'oracle'){
$limit_oracle = 'AND rownum<=1';
}elsif (lc($Conf::Conf{'db_type'}) eq 'sybase'){
$limit_sybase = 'TOP 1';
}
my $statement;
# Select the most prioritary packet to lock.
$statement = sprintf "SELECT %s messagekey_bulkmailer AS messagekey, packetid_bulkmailer AS packetid FROM bulkmailer_table WHERE lock_bulkmailer IS NULL AND delivery_date_bulkmailer <= %d %s %s", $limit_sybase, time(), $limit_oracle, $order;
unless ($sth = $dbh->prepare($statement)) {
do_log('err','Unable to prepare SQL statement : %s', $dbh->errstr);
return undef;
}
my $statement = sprintf "UPDATE bulkmailer_table SET lock_bulkmailer=%s WHERE lock_bulkmailer IS NULL AND delivery_date_bulkmailer <= %d",$dbh->quote($lock), time();
unless ($sth->execute) {
do_log('err','Unable to select a packet to lock: "%s" : %s', $statement, $dbh->errstr);
return undef;
}
my $packet;
unless($packet = $sth->fetchrow_hashref('NAME_lc')){
return undef;
}
$sth->finish();
# Lock the packet previously selected.
$statement = sprintf "UPDATE bulkmailer_table SET lock_bulkmailer=%s WHERE messagekey_bulkmailer='%s' AND packetid_bulkmailer='%s'",$dbh->quote($lock), $packet->{'messagekey'}, $packet->{'packetid'};
unless ($dbh->do($statement)) {
do_log('err','Unable to select and lock bulk packet SQL statement "%s"; error : %s', $statement, $dbh->errstr);
do_log('err','Unable to lock bulk packet SQL statement "%s"; error : %s', $statement, $dbh->errstr);
return undef;
}
# select the packet that has been locked previously
$statement = sprintf "SELECT messagekey_bulkmailer AS messagekey, packetid_bulkmailer AS packetid, receipients_bulkmailer AS receipients, returnpath_bulkmailer AS returnpath, listname_bulkmailer AS listname, robot_bulkmailer AS robot, priority_message_bulkmailer AS priority_message, priority_packet_bulkmailer AS priority_packet, verp_bulkmailer AS verp, reception_date_bulkmailer AS reception_date, delivery_date_bulkmailer AS delivery_date FROM bulkmailer_table WHERE lock_bulkmailer=%s %s",$dbh->quote($lock), $order;
$statement = sprintf "SELECT messagekey_bulkmailer AS messagekey, packetid_bulkmailer AS packetid, receipients_bulkmailer AS receipients, returnpath_bulkmailer AS returnpath, listname_bulkmailer AS listname, robot_bulkmailer AS robot, priority_message_bulkmailer AS priority_message, priority_packet_bulkmailer AS priority_packet, verp_bulkmailer AS verp, merge_bulkmailer as merge, reception_date_bulkmailer AS reception_date, delivery_date_bulkmailer AS delivery_date FROM bulkmailer_table WHERE lock_bulkmailer=%s %s",$dbh->quote($lock), $order;