summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kalika <max@gentoo.org>2004-04-24 18:11:34 +0000
committerMax Kalika <max@gentoo.org>2004-04-24 18:11:34 +0000
commit46a2a8cc7be215383778b133e37ce66396183b26 (patch)
treeefe210fbd3fc0ad557abd9b8bbbfa83778412e94 /net-mail
parentmore updates (Manifest recommit) (diff)
downloadgentoo-2-46a2a8cc7be215383778b133e37ce66396183b26.tar.gz
gentoo-2-46a2a8cc7be215383778b133e37ce66396183b26.tar.bz2
gentoo-2-46a2a8cc7be215383778b133e37ce66396183b26.zip
Bump to version _p9. Add 3 patches: allow address extensions (for virus, spam, banned mails to go to a + address) in per-user SQL policies; catch another SQL server going away error; add sql_timeout setting for allowing SQL server reconnection after a configured period.
Diffstat (limited to 'net-mail')
-rw-r--r--net-mail/amavisd-new/ChangeLog13
-rw-r--r--net-mail/amavisd-new/Manifest9
-rw-r--r--net-mail/amavisd-new/amavisd-new-20030616_p9.ebuild (renamed from net-mail/amavisd-new/amavisd-new-20030616_p7.ebuild)16
-rw-r--r--net-mail/amavisd-new/files/addr_extensions_in_sql.patch177
-rw-r--r--net-mail/amavisd-new/files/digest-amavisd-new-20030616_p71
-rw-r--r--net-mail/amavisd-new/files/digest-amavisd-new-20030616_p91
-rw-r--r--net-mail/amavisd-new/files/lost_connection.patch13
-rw-r--r--net-mail/amavisd-new/files/sql_timeout.patch84
-rw-r--r--net-mail/amavisd-new/files/uid-as-string.patch11
9 files changed, 304 insertions, 21 deletions
diff --git a/net-mail/amavisd-new/ChangeLog b/net-mail/amavisd-new/ChangeLog
index 1d60f540b0fa..d4371798ef5c 100644
--- a/net-mail/amavisd-new/ChangeLog
+++ b/net-mail/amavisd-new/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for net-mail/amavisd-new
# Copyright 2000-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-mail/amavisd-new/ChangeLog,v 1.11 2004/03/15 17:51:41 max Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/amavisd-new/ChangeLog,v 1.12 2004/04/24 18:11:34 max Exp $
+
+*amavisd-new-20030616_p9 (24 Apr 2004)
+
+ 24 Apr 2004; Max Kalika <max@gentoo.org> amavisd-new-20030616_p7.ebuild,
+ amavisd-new-20030616_p9.ebuild, files/addr_extensions_in_sql.patch,
+ files/lost_connection.patch, files/sql_timeout.patch,
+ files/uid-as-string.patch:
+ Bump to version _p9. Add 3 patches: allow address extensions (for virus, spam,
+ banned mails to go to a + address) in per-user SQL policies; catch another SQL
+ server going away error; add sql_timeout setting for allowing SQL server
+ reconnection after a configured period.
15 Mar 2004; Max Kalika <max@gentoo.org> amavisd-new-20030616_p8.ebuild:
Bump to stable x86.
diff --git a/net-mail/amavisd-new/Manifest b/net-mail/amavisd-new/Manifest
index 04995b0bc444..1cbc56b0bc99 100644
--- a/net-mail/amavisd-new/Manifest
+++ b/net-mail/amavisd-new/Manifest
@@ -1,8 +1,11 @@
MD5 480a1019a4c42f2e34e3134fee1febb4 amavisd-new-20030616_p8.ebuild 2563
-MD5 b7fcb047d6b8f6c9ed891b795089b9f2 amavisd-new-20030616_p7.ebuild 2667
+MD5 37f2965c2d7d60ed0219ea7f7f161c61 .amavisd-new-20030616_p9.ebuild.swp 12288
+MD5 7d7ade7ee369d0128c8d447c5822ea83 amavisd-new-20030616_p9.ebuild 2889
MD5 7e8d05f2e7049f65037d91a98458d14b ChangeLog 3276
MD5 7e32edfd72887a57b16ecd73f0f7a1a0 metadata.xml 184
MD5 1f1f4cf9c92f92f966361a8ac08aa543 files/amavisd.rc6 305
-MD5 8bae863e2b884ccbdb5fb4d4b28c62e2 files/uid-as-string.patch 630
-MD5 1a92ea74f38290a7e6e27c2bb839345d files/digest-amavisd-new-20030616_p7 75
+MD5 3256d64018bee64fa34ed62fb93e44af files/sql_timeout.patch 3282
+MD5 f45025857b1aaeeb225782bf7f35c5c3 files/addr_extensions_in_sql.patch 10222
MD5 0c677a1cb17705ea75841cabd5d14634 files/digest-amavisd-new-20030616_p8 75
+MD5 0a2364d819d448c49ea72dfe8c2a109a files/digest-amavisd-new-20030616_p9 75
+MD5 b9ac0b985d0cb7da0ab45fa22ebe38c8 files/lost_connection.patch 567
diff --git a/net-mail/amavisd-new/amavisd-new-20030616_p7.ebuild b/net-mail/amavisd-new/amavisd-new-20030616_p9.ebuild
index 38d75707770b..74dd2ae5dc17 100644
--- a/net-mail/amavisd-new/amavisd-new-20030616_p7.ebuild
+++ b/net-mail/amavisd-new/amavisd-new-20030616_p9.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-mail/amavisd-new/amavisd-new-20030616_p7.ebuild,v 1.3 2004/03/01 03:47:55 weeve Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-mail/amavisd-new/amavisd-new-20030616_p9.ebuild,v 1.1 2004/04/24 18:11:34 max Exp $
inherit eutils
@@ -10,7 +10,7 @@ SRC_URI="http://www.ijs.si/software/amavisd/${PN}-${PV/_/-}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="x86 ~amd64 ~sparc"
+KEYWORDS="~x86 ~amd64 ~sparc"
IUSE="ldap mysql postgres milter"
DEPEND=">=sys-apps/sed-4"
@@ -50,11 +50,17 @@ S="${WORKDIR}/${PN}-${PV/_*/}"
src_unpack() {
unpack ${A} && cd "${S}"
- epatch "${FILESDIR}/uid-as-string.patch"
+
+ # Allow address extension policies in per-user SQL lookups.
+ epatch "${FILESDIR}/addr_extensions_in_sql.patch"
+ # Add an SQL server timeout/reconnect setting.
+ epatch "${FILESDIR}/sql_timeout.patch"
+ # Catch an extra SQL server disconnection error.
+ epatch "${FILESDIR}/lost_connection.patch"
}
src_compile() {
- if [ "`use milter`" ] ; then
+ if use milter ; then
cd "${S}/helper-progs"
econf --with-runtime-dir=/var/run/amavis \
@@ -99,7 +105,7 @@ src_install() {
dodoc AAAREADME.first INSTALL LDAP.schema LICENSE MANIFEST RELEASE_NOTES \
README_FILES/* test-messages/sample-*
- if [ "`use milter`" ] ; then
+ if use milter ; then
cd "${S}/helper-progs"
einstall
fi
diff --git a/net-mail/amavisd-new/files/addr_extensions_in_sql.patch b/net-mail/amavisd-new/files/addr_extensions_in_sql.patch
new file mode 100644
index 000000000000..6ba4fac5f48b
--- /dev/null
+++ b/net-mail/amavisd-new/files/addr_extensions_in_sql.patch
@@ -0,0 +1,177 @@
+--- amavisd 2004-03-08 18:21:43.000000000 -0800
++++ amavisd 2004-04-08 11:25:37.000000000 -0700
+@@ -4925,7 +4925,8 @@
+ $bypass_banned_checks_sql $bypass_header_checks_sql
+ $spam_tag_level_sql $spam_tag2_level_sql $spam_kill_level_sql
+ $spam_modifies_subj_sql $local_domains_sql $wb_listed_sql
+- $spam_quarantine_to_sql);
++ $spam_quarantine_to_sql $addr_extension_spam_sql
++ $addr_extension_virus_sql $addr_extension_banned_sql);
+
+ use vars qw($default_ldap $user_id_ldap
+ $virus_lovers_ldap $spam_lovers_ldap
+@@ -5074,21 +5075,24 @@
+ # B0: boolean, nonexistent field treated as false,
+ # B1: boolean, nonexistent field treated as true
+ my $nf = sub {Amavis::Lookup::SQLfield->new($sql_policy,@_)}; #shorthand
+- $user_id_sql = $nf->('id', 'S');
+- $virus_lovers_sql = $nf->('virus_lover', 'B0');
+- $spam_lovers_sql = $nf->('spam_lover', 'B-');
+- $banned_files_lovers_sql= $nf->('banned_files_lover', 'B-');
+- $bad_header_lovers_sql = $nf->('bad_header_lover', 'B-');
+- $bypass_virus_checks_sql= $nf->('bypass_virus_checks', 'B0');
+- $bypass_spam_checks_sql = $nf->('bypass_spam_checks', 'B0');
+- $bypass_banned_checks_sql=$nf->('bypass_banned_checks','B-');
+- $bypass_header_checks_sql=$nf->('bypass_header_checks','B-');
+- $spam_tag_level_sql = $nf->('spam_tag_level', 'N' );
+- $spam_tag2_level_sql = $nf->('spam_tag2_level', 'N' );
+- $spam_kill_level_sql = $nf->('spam_kill_level', 'N' );
+- $spam_modifies_subj_sql = $nf->('spam_modifies_subj', 'B-');
+- $spam_quarantine_to_sql = $nf->('spam_quarantine_to', 'S-');
+- $local_domains_sql = $nf->('local', 'B1');
++ $user_id_sql = $nf->('id', 'S');
++ $virus_lovers_sql = $nf->('virus_lover', 'B0');
++ $spam_lovers_sql = $nf->('spam_lover', 'B-');
++ $banned_files_lovers_sql = $nf->('banned_files_lover', 'B-');
++ $bad_header_lovers_sql = $nf->('bad_header_lover', 'B-');
++ $bypass_virus_checks_sql = $nf->('bypass_virus_checks', 'B0');
++ $bypass_spam_checks_sql = $nf->('bypass_spam_checks', 'B0');
++ $bypass_banned_checks_sql= $nf->('bypass_banned_checks', 'B-');
++ $bypass_header_checks_sql= $nf->('bypass_header_checks', 'B-');
++ $spam_tag_level_sql = $nf->('spam_tag_level', 'N' );
++ $spam_tag2_level_sql = $nf->('spam_tag2_level', 'N' );
++ $spam_kill_level_sql = $nf->('spam_kill_level', 'N' );
++ $spam_modifies_subj_sql = $nf->('spam_modifies_subj', 'B-');
++ $spam_quarantine_to_sql = $nf->('spam_quarantine_to', 'S-');
++ $addr_extension_spam_sql = $nf->('addr_extension_spam', 'S-');
++ $addr_extension_virus_sql= $nf->('addr_extension_virus', 'S-');
++ $addr_extension_banned_sql=$nf->('addr_extension_banned','S-');
++ $local_domains_sql = $nf->('local', 'B1');
+ section_time('sql-prepare');
+ }
+ }
+@@ -5534,8 +5538,12 @@
+ $r->recip_done(1);
+ }
+ # add address extensions if enabled and passing the message
+- my($ext) = @virusname ? $addr_extension_virus
+- : @banned_filename ? $addr_extension_banned : '';
++ my($ext) = @virusname
++ ? lookup($r->recip_addr, $addr_extension_virus_sql,
++ $addr_extension_virus)
++ : @banned_filename
++ ? lookup($r->recip_addr, $addr_extension_virus_sql,
++ $addr_extension_banned) : '';
+ if ($recipient_delimiter ne '' && $ext ne '' &&
+ $r->recip_destiny == D_PASS &&
+ lookup($r->recip_addr, $local_domains_sql,
+@@ -5589,8 +5597,9 @@
+ $r->recip_done(1);
+ }
+ # add address extensions if enabled and passing the message
+- if ($recipient_delimiter ne '' &&
+- $addr_extension_spam ne '' &&
++ my($ext) = lookup($r->recip_addr, $addr_extension_spam_sql,
++ $addr_extension_spam);
++ if ($recipient_delimiter ne '' && $ext ne '' &&
+ $r->recip_destiny == D_PASS &&
+ lookup($r->recip_addr, $local_domains_sql,
+ $local_domains_ldap, \%local_domains,
+@@ -5604,9 +5613,9 @@
+ s/^(.*?)\Q$recipient_delimiter\E.*$(?!\n)/$1/s;
+ }
+ do_log(5,"adding extension $recipient_delimiter".
+- "$addr_extension_spam to $localpart\@$domain");
++ "$ext to $localpart\@$domain");
+ $r->recip_addr_modified($localpart.
+- $recipient_delimiter.$addr_extension_spam.$domain);
++ $recipient_delimiter.$ext.$domain);
+ }
+ }
+ if ($considered_spam_by_some_recips) {
+--- amavisd.conf 2004-04-08 11:32:15.000000000 -0700
++++ amavisd.conf 2004-04-08 11:47:02.000000000 -0700
+@@ -853,6 +853,11 @@
+ # $addr_extension_spam = 'spam'; # (default is undef, same as empty)
+ # $addr_extension_banned = 'banned'; # (default is undef, same as empty)
+
++# Alternatively, these can be configured as a per-recipient lookup and/or
++# overridden by an SQL policy.
++# $addr_extension_virus = new_RE( # per-recip multiple quarantines
++# [qr'^(.*)@example\.com$'i => 'virus'],
++# [qr/.*/ => 'filtered'] );
+
+ # Delimiter between local part of the recipient address and address extension
+ # (which can optionally be added, see variables $addr_extension_virus and
+--- README_FILES/README.lookups 2004-04-08 11:32:15.000000000 -0700
++++ README_FILES/README.lookups 2004-04-08 11:45:11.000000000 -0700
+@@ -444,24 +444,29 @@
+ id int unsigned NOT NULL auto_increment,
+ policy_name varchar(32), -- not used by amavisd-new
+
+- virus_lover char(1), -- Y/N
+- spam_lover char(1), -- Y/N (optional field)
+- banned_files_lover char(1), -- Y/N (optional field)
+- bad_header_lover char(1), -- Y/N (optional field)
+-
+- bypass_virus_checks char(1), -- Y/N
+- bypass_spam_checks char(1), -- Y/N
+- bypass_banned_checks char(1), -- Y/N (optional field)
+- bypass_header_checks char(1), -- Y/N (optional field)
++ virus_lover char(1), -- Y/N
++ spam_lover char(1), -- Y/N (optional field)
++ banned_files_lover char(1), -- Y/N (optional field)
++ bad_header_lover char(1), -- Y/N (optional field)
++
++ bypass_virus_checks char(1), -- Y/N
++ bypass_spam_checks char(1), -- Y/N
++ bypass_banned_checks char(1), -- Y/N (optional field)
++ bypass_header_checks char(1), -- Y/N (optional field)
+
+- spam_modifies_subj char(1), -- Y/N (optional field)
+- spam_quarantine_to varchar(64) DEFAULT NULL, -- (optional field)
++ spam_modifies_subj char(1), -- Y/N (optional field)
++ spam_quarantine_to varchar(64) DEFAULT NULL, -- (optional field)
+ spam_tag_level float, -- higher score inserts spam info headers
+ spam_tag2_level float DEFAULT NULL, -- higher score inserts
+ -- 'declared spam' info header fields
+ spam_kill_level float, -- higher score activates evasive actions, e.g.
+ -- reject/drop, quarantine, ...
+ -- (subject to final_spam_destiny setting)
++
++ addr_extension_virus varchar(64) DEFAULT NULL, -- (optional field)
++ addr_extension_spam varchar(64) DEFAULT NULL, -- (optional field)
++ addr_extension_banned varchar(64) DEFAULT NULL, -- (optional field)
++
+ PRIMARY KEY (id)
+ );
+
+@@ -487,17 +492,17 @@
+
+ -- INSERT INTO users VALUES (20, 0, 5, '@.', NULL); -- catchall
+
+-INSERT INTO policy VALUES (1, 'Non-paying', 'N','N','N','N', 'Y','Y','Y','N', 'Y',NULL, 3.0, 7, 10);
+-INSERT INTO policy VALUES (2, 'Uncensored', 'Y','Y','Y','Y', 'N','N','N','N', 'N',NULL, 3.0, 999, 999);
+-INSERT INTO policy VALUES (3, 'Wants all spam','N','Y','N','N', 'N','N','N','N', 'Y',NULL, 3.0, 999, 999);
+-INSERT INTO policy VALUES (4, 'Wants viruses', 'Y','N','Y','Y', 'N','N','N','N', 'Y',NULL, 3.0, 6.9, 6.9);
+-INSERT INTO policy VALUES (5, 'Normal', 'N','N','N','N', 'N','N','N','N', 'Y',NULL, 3.0, 6.9, 6.9);
+-INSERT INTO policy VALUES (6, 'Trigger happy', 'N','N','N','N', 'N','N','N','N', 'Y',NULL, 3.0, 5, 5);
+-INSERT INTO policy VALUES (7, 'Permissive', 'N','N','N','Y', 'N','N','N','N', 'Y',NULL, 3.0, 10, 20);
+-INSERT INTO policy VALUES (8, '6.5/7.8', 'N','N','N','N', 'N','N','N','N', 'N',NULL, 3.0, 6.5, 7.8);
+-INSERT INTO policy VALUES (9, 'userB', 'N','N','N','Y', 'N','N','N','N', 'Y',NULL, 3.0, 6.3, 6.3);
+-INSERT INTO policy VALUES (10,'userC', 'N','N','N','N', 'N','N','N','N', 'N',NULL, 3.0, 6.0, 6.0);
+-INSERT INTO policy VALUES (11,'userD', 'Y','N','Y','Y', 'N','N','N','N', 'N',NULL, 3.0, 7, 7);
++INSERT INTO policy VALUES (1, 'Non-paying', 'N','N','N','N', 'Y','Y','Y','N', 'Y',NULL, 3.0, 7, 10, 'viruses', NULL, NULL);
++INSERT INTO policy VALUES (2, 'Uncensored', 'Y','Y','Y','Y', 'N','N','N','N', 'N',NULL, 3.0, 999, 999, NULL, 'spam', NULL);
++INSERT INTO policy VALUES (3, 'Wants all spam','N','Y','N','N', 'N','N','N','N', 'Y',NULL, 3.0, 999, 999, NULL, 'spam', 'banned);
++INSERT INTO policy VALUES (4, 'Wants viruses', 'Y','N','Y','Y', 'N','N','N','N', 'Y',NULL, 3.0, 6.9, 6.9, 'junk', 'junk', 'junk');
++INSERT INTO policy VALUES (5, 'Normal', 'N','N','N','N', 'N','N','N','N', 'Y',NULL, 3.0, 6.9, 6.9, NULL, NULL, NULL);
++INSERT INTO policy VALUES (6, 'Trigger happy', 'N','N','N','N', 'N','N','N','N', 'Y',NULL, 3.0, 5, 5, NULL, NULL, NULL);
++INSERT INTO policy VALUES (7, 'Permissive', 'N','N','N','Y', 'N','N','N','N', 'Y',NULL, 3.0, 10, 20, NULL, NULL, NULL);
++INSERT INTO policy VALUES (8, '6.5/7.8', 'N','N','N','N', 'N','N','N','N', 'N',NULL, 3.0, 6.5, 7.8, NULL, NULL, NULL);
++INSERT INTO policy VALUES (9, 'userB', 'N','N','N','Y', 'N','N','N','N', 'Y',NULL, 3.0, 6.3, 6.3, NULL, NULL, NULL);
++INSERT INTO policy VALUES (10,'userC', 'N','N','N','N', 'N','N','N','N', 'N',NULL, 3.0, 6.0, 6.0, NULL, NULL, NULL);
++INSERT INTO policy VALUES (11,'userD', 'Y','N','Y','Y', 'N','N','N','N', 'N',NULL, 3.0, 7, 7, NULL, NULL, NULL);
+
+ -- sender envelope addresses needed for white/blacklisting
+ INSERT INTO mailaddr VALUES ( 1, 5, '@example.com');
diff --git a/net-mail/amavisd-new/files/digest-amavisd-new-20030616_p7 b/net-mail/amavisd-new/files/digest-amavisd-new-20030616_p7
deleted file mode 100644
index 169d32645468..000000000000
--- a/net-mail/amavisd-new/files/digest-amavisd-new-20030616_p7
+++ /dev/null
@@ -1 +0,0 @@
-MD5 e6f35be1e14861e3869debdd9bdfbfba amavisd-new-20030616-p7.tar.gz 315850
diff --git a/net-mail/amavisd-new/files/digest-amavisd-new-20030616_p9 b/net-mail/amavisd-new/files/digest-amavisd-new-20030616_p9
new file mode 100644
index 000000000000..9a8e116e9317
--- /dev/null
+++ b/net-mail/amavisd-new/files/digest-amavisd-new-20030616_p9
@@ -0,0 +1 @@
+MD5 4c96fadc57a5de84cc3bc6b548b46aff amavisd-new-20030616-p9.tar.gz 363756
diff --git a/net-mail/amavisd-new/files/lost_connection.patch b/net-mail/amavisd-new/files/lost_connection.patch
new file mode 100644
index 000000000000..d9e75cad6208
--- /dev/null
+++ b/net-mail/amavisd-new/files/lost_connection.patch
@@ -0,0 +1,13 @@
+--- amavisd 2004-03-08 18:21:43.000000000 -0800
++++ amavisd 2004-04-08 11:25:37.000000000 -0700
+@@ -6985,7 +6985,9 @@
+ my($err) = $@;
+ do_log(0, "lookup_sql: $DBI::err, $DBI::errstr");
+ if ($sth && ($sth->err eq '2006' || # MySQL server has gone away
+- $sth->errstr =~ /\bserver has gone away\b/)) {
++ $sth->errstr =~ /\bserver has gone away\b/ ||
++ $sth->err eq '2013' ||
++ $sth->errstr =~ /\bLost connection to\b/)) {
+ do_log(0,"NOTICE: Disconnected from SQL server");
+ $sql_connected = 0; $self->{dbh}->disconnect;
+ }
diff --git a/net-mail/amavisd-new/files/sql_timeout.patch b/net-mail/amavisd-new/files/sql_timeout.patch
new file mode 100644
index 000000000000..364d67a9887c
--- /dev/null
+++ b/net-mail/amavisd-new/files/sql_timeout.patch
@@ -0,0 +1,84 @@
+diff -ruN amavisd.orig/amavisd amavisd-new-20030616/amavisd
+--- amavisd.orig/amavisd 2004-04-16 08:15:39.000000000 -0700
++++ amavisd-new-20030616/amavisd 2004-04-16 08:16:47.000000000 -0700
+@@ -191,7 +191,7 @@
+ %blacklist_sender @blacklist_sender_acl $blacklist_sender_re
+ $per_recip_blacklist_sender_lookup_tables
+ $viruses_that_fake_sender_re
+- @lookup_sql_dsn $sql_key_fieldname
++ @lookup_sql_dsn $sql_timeout $sql_key_fieldname
+ $sql_select_policy $sql_select_white_black_list
+ $enable_ldap $default_ldap $virus_lovers_ldap
+ $banned_files_lovers_ldap $bypass_virus_checks_ldap
+@@ -337,6 +337,12 @@
+ # ( ['DBI:mysql:mail:host1', 'some-username1', 'some-password1'],
+ # ['DBI:mysql:mail:host2', 'some-username2', 'some-password2'] );
+
++# The SQL timeout value specifies how long to wait before closing
++# and reopening a connection. The default is the MySQL default
++# connection timeout of 1 day. This timer is intialized once on
++# initial connection and is reset at every successful sql lookup.
++$sql_timeout = 60*60*24;
++
+ # The SQL select clause to fetch per-recipient policy settings
+ # The %k will be replaced by a comma-separated list of query addresses
+ # (e.g. full address, domain only, catchall). Use ORDER, if there
+@@ -6824,7 +6830,7 @@
+ import Amavis::rfc2821_2822_Tools qw(split_address split_localpart);
+ }
+
+-use vars qw($sql_connected);
++use vars qw($sql_connected $sql_timestamp);
+
+ # Connect to a database. Take a list of database connection
+ # parameters and try each until one succeeds.
+@@ -6844,7 +6850,10 @@
+ }
+ do_log(0, "connect_to_sql: unable to connect to any DSN at all!"
+ ) if !$dbh && @dsns>1;
+- $sql_connected = 1 if $dbh;
++ if ($dbh) {
++ $sql_connected = 1;
++ $sql_timestamp = time;
++ }
+ $dbh;
+ }
+
+@@ -6915,6 +6924,13 @@
+ }
+ return $match;
+ }
++ if ($sql_timeout && (time - $sql_timestamp > $sql_timeout)) {
++ if ($sql_connected) {
++ $self->{dbh}->disconnect;
++ do_log(4, "lookup_sql: connection timed out, reconnecting");
++ }
++ $self->{dbh} = $sql_connected = undef;
++ }
+ if (!$sql_connected) {
+ my($sql_dbh) = connect_to_sql(@lookup_sql_dsn);
+ section_time('sql-connect');
+@@ -6980,6 +6996,7 @@
+ last if $found; # first match wins, loop is for possible future use
+ }
+ $sth->finish();
++ $sql_timestamp = time;
+ }; # eval
+ if ($@ ne '') {
+ my($err) = $@;
+diff -ruN amavisd.orig/amavisd.conf amavisd-new-20030616/amavisd.conf
+--- amavisd.orig/amavisd.conf 2004-04-16 08:15:39.000000000 -0700
++++ amavisd-new-20030616/amavisd.conf 2004-04-16 08:27:20.000000000 -0700
+@@ -808,6 +808,12 @@
+ # With PostgreSQL the dsn (first element of the triple) may look like:
+ # 'DBI:Pg:host=host1;dbname=mail'
+
++# How long to maintain an SQL connection before attempting to reconnect?
++# This is used to prevent the SQL server from timing out the connection
++# on the backend and delaying mail due to requeueing. Set this to 0 or undef
++# to disable SQL reconnection attempts. The default is 1 day.
++# $sql_timeout = 60*60*24;
++
+ # The SQL select clause to fetch per-recipient policy settings.
+ # The %k will be replaced by a comma-separated list of query addresses
+ # (e.g. full address, domain only, catchall). Use ORDER, if there
diff --git a/net-mail/amavisd-new/files/uid-as-string.patch b/net-mail/amavisd-new/files/uid-as-string.patch
deleted file mode 100644
index b06fb2c0cbf4..000000000000
--- a/net-mail/amavisd-new/files/uid-as-string.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- amavisd.orig 2004-01-13 08:20:59.000000000 -0800
-+++ amavisd 2004-01-13 08:21:16.000000000 -0800
-@@ -4968,7 +4968,7 @@
- # B0: boolean, nonexistent field treated as false,
- # B1: boolean, nonexistent field treated as true
- my $nf = sub {Amavis::Lookup::SQLfield->new($sql_policy,@_)}; #shorthand
-- $user_id_sql = $nf->('id', 'N');
-+ $user_id_sql = $nf->('id', 'S');
- $virus_lovers_sql = $nf->('virus_lover', 'B0');
- $spam_lovers_sql = $nf->('spam_lover', 'B-');
- $banned_files_lovers_sql= $nf->('banned_files_lover', 'B-');