head 1.8; access; symbols OPENPKG_E1_MP_HEAD:1.4 OPENPKG_E1_MP:1.4 OPENPKG_E1_MP_2_STABLE:1.2.2.1 OPENPKG_E1_FP:1.2.2.1 OPENPKG_2_STABLE_MP:1.4 OPENPKG_2_STABLE_20061018:1.2.2.1 OPENPKG_2_STABLE_20060622:1.2 OPENPKG_2_STABLE:1.2.0.2 OPENPKG_2_STABLE_BP:1.2 OPENPKG_2_5_RELEASE:1.1 OPENPKG_2_5_SOLID:1.1.0.2 OPENPKG_2_5_SOLID_BP:1.1; locks; strict; comment @# @; 1.8 date 2009.04.22.17.55.17; author rse; state Exp; branches; next 1.7; commitid 1SbZD9uvxixOu2Lt; 1.7 date 2008.12.15.16.36.21; author rse; state Exp; branches; next 1.6; commitid 8d6WecRGmXrPaAut; 1.6 date 2007.09.07.10.47.54; author rse; state Exp; branches; next 1.5; commitid BHT0hhK8h2GYbNws; 1.5 date 2007.06.06.21.36.01; author thl; state Exp; branches; next 1.4; commitid nHIN6Z0PvmjFLTks; 1.4 date 2006.12.30.16.14.55; author rse; state Exp; branches; next 1.3; commitid KcLWQF6wVO9o4z0s; 1.3 date 2006.09.30.15.38.03; author cs; state Exp; branches; next 1.2; commitid WoGnXhq58dW5NROr; 1.2 date 2006.04.04.06.37.05; author rse; state Exp; branches 1.2.2.1; next 1.1; commitid k2DQFP3i6E9fyOrr; 1.1 date 2005.08.22.06.13.47; author rse; state Exp; branches; next ; 1.2.2.1 date 2006.10.16.14.47.29; author rse; state Exp; branches; next 1.2.2.2; commitid iZxwRSmmWscPXUQr; 1.2.2.2 date 2007.02.07.20.36.24; author thl; state Exp; branches; next ; commitid buiDpkvFRFCkgB5s; desc @@ 1.8 log @upgrading package: amavisd 2.6.2 -> 2.6.3 @ text @Index: amavisd.conf --- amavisd.conf.orig 2009-04-22 02:24:04 +0200 +++ amavisd.conf 2009-04-22 19:46:28 +0200 @@@@ -360,10 +360,10 @@@@ # ['Sophos SAVI', \&sophos_savi ], # ### http://www.clamav.net/ -# ['ClamAV-clamd', -# \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"], -# qr/\bOK$/m, qr/\bFOUND$/m, -# qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ], +['ClamAV-clamd', + \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"], + qr/\bOK$/m, qr/\bFOUND$/m, + qr/^.*?: (?!Infected Archive)(.*) FOUND$/m ], # # NOTE: run clamd under the same user as amavisd, or run it under its own # # uid such as clamav, add user clamav to the amavis group, and then add # # AllowSupplementaryGroups to clamd.conf; Index: amavisd --- amavisd.orig 2009-04-22 02:24:12 +0200 +++ amavisd 2009-04-22 19:36:50 +0200 @@@@ -12048,7 +12048,10 @@@@ if ($subject_tag ne '') { if (defined $msginfo->get_header_field('subject')) { $hdr_edits->edit_header('Subject', - sub { $_[1]=~/^([ \t]?)(.*)\z/s; ' '.$subject_tag.$2 }); + sub { $_[1]=~/^([ \t]?)(.*)\z/s; + my $subj = $2; + $subj=~s/\Q$subject_tag\E//sg; + ' '.$subject_tag.$subj }); } else { # no Subject header field present, insert one $subject_tag =~ s/[ \t]+\z//; # trim $hdr_edits->add_header('Subject', $subject_tag); Index: amavislogsumm --- amavislogsumm.orig 2009-04-22 19:36:50 +0200 +++ amavislogsumm 2009-04-22 19:36:50 +0200 @@@@ -309,7 +309,7 @@@@ if ($spamCount > 0) { printf "\tSPAM : %5.2f\n", ($spamHitSum / $spamCount); } - if (($timeLineCount - $spamCount) > 0) { + if (($timeLineCount - $spamCount - $unscoredMail) > 0) { printf "\tHAM : %5.2f\n", ($noneSpamHitSum / ($timeLineCount - $spamCount - $unscoredMail)); print "\n"; } Index: helper-progs/Makefile.in --- helper-progs/Makefile.in.orig 2004-04-11 01:51:52 +0200 +++ helper-progs/Makefile.in 2009-04-22 19:36:50 +0200 @@@@ -2,7 +2,8 @@@@ # Makefile.in for amavisd-new helper-progs # Needed for autoconf to behave properly... -AMAVISUSER=@@AMAVISUSER@@ +AMAVIS_USER=dummy +AMAVIS_GROUP=dummy prefix=@@prefix@@ exec_prefix=@@exec_prefix@@ sbindir=@@sbindir@@ @@@@ -11,7 +12,7 @@@@ MINCLUDE=@@MINCLUDE@@ # TODO : use some VERSION variable DEFS= -DVERSION=\"@@VERSION@@ and in the 2 .c helper programs # additional flags -DEFS=-D_POSIX_PTHREAD_SEMANTICS +DEFS=-D_POSIX_PTHREAD_SEMANTICS -DAMAVIS_USER=\"$(AMAVIS_USER)\" -DMILTER_SOCKET_GROUP=\"$(AMAVIS_GROUP)\" all: amavis-milter amavis Index: helper-progs/amavis-milter.c --- helper-progs/amavis-milter.c.orig 2008-06-27 15:31:45 +0200 +++ helper-progs/amavis-milter.c 2009-04-22 19:36:50 +0200 @@@@ -52,7 +52,7 @@@@ #ifdef HAVE_SM_GEN_H # include "sm/gen.h" #endif -#include "libmilter/mfapi.h" +#include "milter/mfapi.h" typedef int mybool; @@@@ -929,13 +929,14 @@@@ int main(int argc, char *argv[]) { -/* struct passwd *userinfo; *amavis uid* */ + struct passwd *userinfo; int c, i; char *p, *milter_socket = NULL, *milter_socket_group = NULL; /* const char *args = "dg:p:vx"; */ - const char *args = ":hdg:p:Dvx"; /* some mix of old and new options!!! */ + const char *args = ":hdg:p:DvxP:"; /* some mix of old and new options!!! */ pid_t pid; + char *pidfile = NULL; int devnull; #if !defined(HAVE_MKDTEMP) && !defined(HAVE_MKTEMP) @@@@ -970,6 +971,9 @@@@ } milter_socket = strdup(optarg); break; + case 'P': + pidfile = strdup(optarg); + break; case 'v': verbosity++; break; @@@@ -999,23 +1003,20 @@@@ uname(&amavis_uts); /* check user and group */ -/* if (!(userinfo = getpwnam(AMAVIS_USER))) { - * perror("getpwnam"); - * exit(EXIT_FAILURE); - * } - * amavis_gid = userinfo->pw_gid; - * if (!milter_socket_group) { - * milter_socket_group = strdup(MILTER_SOCKET_GROUP); - * if (!milter_socket_group) { - * perror("strdup"); - * exit(EXIT_FAILURE); - * } - * } - * if (group_member(milter_socket_group) < 0) { - * fprintf(stderr, "%s not member of %s group\n", AMAVIS_USER, milter_socket_group); - * exit(EXIT_FAILURE); - * } - */ + if (!(userinfo = getpwnam(AMAVIS_USER))) { + perror("getpwnam"); + exit(EXIT_FAILURE); + } + amavis_gid = userinfo->pw_gid; + if (!milter_socket_group) { + milter_socket_group = strdup(MILTER_SOCKET_GROUP); + if (!milter_socket_group) { + perror("strdup"); + exit(EXIT_FAILURE); + } + } + group_member(milter_socket_group); + if (!milter_socket) { fprintf(stderr, "%s: no milter socket specified (missing option -p)\n\n", argv[0]); usage(); @@@@ -1116,11 +1117,22 @@@@ } } + if (pidfile != NULL) { + FILE *fp; + if ((fp = fopen(pidfile, "w")) == NULL) { + amavis_syslog(DBG_FATAL, "Unable to write PID to file \"%s\": %s", pidfile, strerror(errno)); + exit(EXIT_FAILURE); + } + fprintf(fp, "%ld", (long)getpid()); + fclose(fp); + } + /* change process group id */ if (miltergroup && (setgid(miltergroup->gr_gid)) < 0) { amavis_syslog(DBG_FATAL, "setgid(%d): %s", miltergroup->gr_gid, strerror(errno)); exit(EX_UNAVAILABLE); } + setuid(userinfo->pw_uid); /* smfi_settimeout(1800); */ /* defaults to 7210 seconds */ @ 1.7 log @upgrading package: amavisd 2.6.1 -> 2.6.2 @ text @d2 2 a3 2 --- amavisd.conf.orig 2008-12-15 01:50:03 +0100 +++ amavisd.conf 2008-12-15 17:34:25 +0100 d10 1 a10 1 -# qr/\bOK$/, qr/\bFOUND$/, d14 1 a14 1 + qr/\bOK$/, qr/\bFOUND$/, d20 3 a22 3 --- amavisd.orig 2008-12-15 01:50:09 +0100 +++ amavisd 2008-12-15 17:32:00 +0100 @@@@ -11840,7 +11840,10 @@@@ d35 2 a36 2 --- amavislogsumm.orig 2008-12-15 17:32:00 +0100 +++ amavislogsumm 2008-12-15 17:32:00 +0100 d48 1 a48 1 +++ helper-progs/Makefile.in 2008-12-15 17:32:00 +0100 d70 1 a70 1 +++ helper-progs/amavis-milter.c 2008-12-15 17:32:00 +0100 @ 1.6 log @fix building under with_milter=yes @ text @d2 3 a4 4 --- amavisd.conf.orig 2007-06-27 12:42:55 +0200 +++ amavisd.conf 2007-09-07 12:46:26 +0200 @@@@ -352,16 +352,16 @@@@ # ### http://www.csupomona.edu/~henson/www/projects/SAVI-Perl/ d7 1 a7 1 -# ### http://www.clamav.net/ d11 1 a11 7 -# qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ], -# # NOTE: run clamd under the same user as amavisd, or run it under its own -# # uid such as clamav, add user clamav to the amavis group, and then add -# # AllowSupplementaryGroups to clamd.conf; -# # NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in -# # this entry; when running chrooted one may prefer socket "$MYHOME/clamd". +### http://www.clamav.net/ d15 4 a18 9 + qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ], +# NOTE: run clamd under the same user as amavisd, or run it under its own +# uid such as clamav, add user clamav to the amavis group, and then add +# AllowSupplementaryGroups to clamd.conf; +# NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in +# this entry; when running chrooted one may prefer socket "$MYHOME/clamd". # ### http://www.clamav.net/ and CPAN (memory-hungry! clamd is preferred) # # note that Mail::ClamAV requires perl to be build with threading! d20 3 a22 3 --- amavisd.orig 2007-06-27 12:43:00 +0200 +++ amavisd 2007-09-07 12:46:26 +0200 @@@@ -9922,7 +9922,10 @@@@ d24 1 a24 1 if (defined $msginfo->orig_header_fields->{'subject'}) { d33 1 a33 1 $hdr_edits->append_header('Subject', $subject_tag); d35 2 a36 2 --- amavislogsumm.orig 2007-09-07 12:46:26 +0200 +++ amavislogsumm 2007-09-07 12:46:26 +0200 d48 1 a48 1 +++ helper-progs/Makefile.in 2007-09-07 12:46:26 +0200 d69 2 a70 2 --- helper-progs/amavis-milter.c.orig 2004-07-02 16:44:26 +0200 +++ helper-progs/amavis-milter.c 2007-09-07 12:46:43 +0200 d80 1 a80 1 @@@@ -928,13 +928,14 @@@@ d97 1 a97 1 @@@@ -969,6 +970,9 @@@@ d107 1 a107 1 @@@@ -998,23 +1002,20 @@@@ d145 1 a145 1 @@@@ -1115,11 +1116,22 @@@@ @ 1.5 log @modifying package: amavisd-2.5.1 20070531 -> 20070606 @ text @d2 3 a4 3 --- amavisd.conf.orig 2006-11-20 18:35:32 +0100 +++ amavisd.conf 2006-12-30 17:09:37 +0100 @@@@ -317,16 +317,16 @@@@ d30 16 a45 1 # ['Mail::ClamAV', \&ask_clamav, "*", [0], [1], qr/^INFECTED: (.+)/], d47 2 a48 2 --- amavislogsumm.orig 2006-12-30 17:09:37 +0100 +++ amavislogsumm 2006-12-30 17:09:37 +0100 d60 1 a60 1 +++ helper-progs/Makefile.in 2006-12-30 17:09:37 +0100 d82 10 a91 1 +++ helper-progs/amavis-milter.c 2006-12-30 17:11:24 +0100 a179 18 https://intevation.de/roundup/kolab/merge32 "amavisd inserts subject tag more than once" https://intevation.de/roundup/kolab/file543/amavisd-new-2.5.1-last_subject_tag_only.patch diff -urN amavisd.orig amavisd --- amavisd.orig 2007-05-31 14:10:01.000000000 +0200 +++ amavisd 2007-06-06 16:33:54.000000000 +0200 @@@@ -9854,7 +9854,10 @@@@ if ($subject_tag ne '') { if (defined $msginfo->orig_header_fields->{'subject'}) { $hdr_edits->edit_header('Subject', - sub { $_[1]=~/^([ \t]?)(.*)\z/s; ' '.$subject_tag.$2 }); + sub { $_[1]=~/^([ \t]?)(.*)\z/s; + my $subj = $2; + $subj=~s/\Q$subject_tag\E//sg; + ' '.$subject_tag.$subj }); } else { # no Subject header field present, insert one $subject_tag =~ s/[ \t]+\z//; # trim $hdr_edits->append_header('Subject', $subject_tag); @ 1.4 log @add support for running the amavis-milter daemon @ text @d156 18 @ 1.3 log @upgrading package: amavisd 2.4.2 -> 2.4.3 @ text @d2 2 a3 2 --- amavisd.conf.orig 2006-09-30 11:29:20 +0200 +++ amavisd.conf 2006-09-30 17:36:20 +0200 d32 2 a33 2 --- amavislogsumm.orig 2006-04-04 08:33:40 +0200 +++ amavislogsumm 2006-04-04 08:33:40 +0200 d43 113 @ 1.2 log @cleanup packaging @ text @d2 3 a4 3 --- amavisd.conf.orig 2006-04-03 16:32:25 +0200 +++ amavisd.conf 2006-04-04 08:33:40 +0200 @@@@ -295,14 +295,14 @@@@ d13 5 a17 3 -# # NOTE: the easiest is to run clamd under the same user as amavisd; match the -# # socket name (LocalSocket) in clamav.conf to the socket name in this entry -# # When running chrooted one may prefer: ["CONTSCAN {}\n","$MYHOME/clamd"], d23 5 a27 3 +# NOTE: the easiest is to run clamd under the same user as amavisd; match the +# socket name (LocalSocket) in clamav.conf to the socket name in this entry +# When running chrooted one may prefer: ["CONTSCAN {}\n","$MYHOME/clamd"], @ 1.2.2.1 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @d2 3 a4 3 --- amavisd.conf.orig 2006-09-30 11:29:20 +0200 +++ amavisd.conf 2006-09-30 17:36:20 +0200 @@@@ -317,16 +317,16 @@@@ d13 3 a15 5 -# # NOTE: run clamd under the same user as amavisd, or run it under its own -# # uid such as clamav, add user clamav to the amavis group, and then add -# # AllowSupplementaryGroups to clamd.conf; -# # NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in -# # this entry; when running chrooted one may prefer socket "$MYHOME/clamd". d21 3 a23 5 +# NOTE: run clamd under the same user as amavisd, or run it under its own +# uid such as clamav, add user clamav to the amavis group, and then add +# AllowSupplementaryGroups to clamd.conf; +# NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in +# this entry; when running chrooted one may prefer socket "$MYHOME/clamd". @ 1.2.2.2 log @MFC: make up leeway for 2_STABLE by virtue of build-time results @ text @d2 2 a3 2 --- amavisd.conf.orig 2006-11-20 18:35:32 +0100 +++ amavisd.conf 2006-12-30 17:09:37 +0100 d32 2 a33 2 --- amavislogsumm.orig 2006-12-30 17:09:37 +0100 +++ amavislogsumm 2006-12-30 17:09:37 +0100 a42 113 Index: helper-progs/Makefile.in --- helper-progs/Makefile.in.orig 2004-04-11 01:51:52 +0200 +++ helper-progs/Makefile.in 2006-12-30 17:09:37 +0100 @@@@ -2,7 +2,8 @@@@ # Makefile.in for amavisd-new helper-progs # Needed for autoconf to behave properly... -AMAVISUSER=@@AMAVISUSER@@ +AMAVIS_USER=dummy +AMAVIS_GROUP=dummy prefix=@@prefix@@ exec_prefix=@@exec_prefix@@ sbindir=@@sbindir@@ @@@@ -11,7 +12,7 @@@@ MINCLUDE=@@MINCLUDE@@ # TODO : use some VERSION variable DEFS= -DVERSION=\"@@VERSION@@ and in the 2 .c helper programs # additional flags -DEFS=-D_POSIX_PTHREAD_SEMANTICS +DEFS=-D_POSIX_PTHREAD_SEMANTICS -DAMAVIS_USER=\"$(AMAVIS_USER)\" -DMILTER_SOCKET_GROUP=\"$(AMAVIS_GROUP)\" all: amavis-milter amavis Index: helper-progs/amavis-milter.c --- helper-progs/amavis-milter.c.orig 2004-07-02 16:44:26 +0200 +++ helper-progs/amavis-milter.c 2006-12-30 17:11:24 +0100 @@@@ -928,13 +928,14 @@@@ int main(int argc, char *argv[]) { -/* struct passwd *userinfo; *amavis uid* */ + struct passwd *userinfo; int c, i; char *p, *milter_socket = NULL, *milter_socket_group = NULL; /* const char *args = "dg:p:vx"; */ - const char *args = ":hdg:p:Dvx"; /* some mix of old and new options!!! */ + const char *args = ":hdg:p:DvxP:"; /* some mix of old and new options!!! */ pid_t pid; + char *pidfile = NULL; int devnull; #if !defined(HAVE_MKDTEMP) && !defined(HAVE_MKTEMP) @@@@ -969,6 +970,9 @@@@ } milter_socket = strdup(optarg); break; + case 'P': + pidfile = strdup(optarg); + break; case 'v': verbosity++; break; @@@@ -998,23 +1002,20 @@@@ uname(&amavis_uts); /* check user and group */ -/* if (!(userinfo = getpwnam(AMAVIS_USER))) { - * perror("getpwnam"); - * exit(EXIT_FAILURE); - * } - * amavis_gid = userinfo->pw_gid; - * if (!milter_socket_group) { - * milter_socket_group = strdup(MILTER_SOCKET_GROUP); - * if (!milter_socket_group) { - * perror("strdup"); - * exit(EXIT_FAILURE); - * } - * } - * if (group_member(milter_socket_group) < 0) { - * fprintf(stderr, "%s not member of %s group\n", AMAVIS_USER, milter_socket_group); - * exit(EXIT_FAILURE); - * } - */ + if (!(userinfo = getpwnam(AMAVIS_USER))) { + perror("getpwnam"); + exit(EXIT_FAILURE); + } + amavis_gid = userinfo->pw_gid; + if (!milter_socket_group) { + milter_socket_group = strdup(MILTER_SOCKET_GROUP); + if (!milter_socket_group) { + perror("strdup"); + exit(EXIT_FAILURE); + } + } + group_member(milter_socket_group); + if (!milter_socket) { fprintf(stderr, "%s: no milter socket specified (missing option -p)\n\n", argv[0]); usage(); @@@@ -1115,11 +1116,22 @@@@ } } + if (pidfile != NULL) { + FILE *fp; + if ((fp = fopen(pidfile, "w")) == NULL) { + amavis_syslog(DBG_FATAL, "Unable to write PID to file \"%s\": %s", pidfile, strerror(errno)); + exit(EXIT_FAILURE); + } + fprintf(fp, "%ld", (long)getpid()); + fclose(fp); + } + /* change process group id */ if (miltergroup && (setgid(miltergroup->gr_gid)) < 0) { amavis_syslog(DBG_FATAL, "setgid(%d): %s", miltergroup->gr_gid, strerror(errno)); exit(EX_UNAVAILABLE); } + setuid(userinfo->pw_uid); /* smfi_settimeout(1800); */ /* defaults to 7210 seconds */ @ 1.1 log @add missing patch file and upgrade to newer version @ text @d2 3 a4 3 --- amavisd.conf.orig 2005-06-29 12:26:05.000000000 +0200 +++ amavisd.conf 2005-08-17 16:51:05.325957000 +0200 @@@@ -285,14 +285,14 @@@@ d27 12 @