View | Details | Raw Unified | Return to bug 114214
Collapse All | Expand All

(-)Makefile (-6 / +14 lines)
Lines 6-13 Link Here
6
#
6
#
7
7
8
PORTNAME=	MailScanner
8
PORTNAME=	MailScanner
9
PORTVERSION=	4.60.8
9
PORTVERSION=	4.61.7
10
PORTREVISION=	2
11
CATEGORIES=	mail
10
CATEGORIES=	mail
12
MASTER_SITES=	http://www.mailscanner.info/files/4/tar/
11
MASTER_SITES=	http://www.mailscanner.info/files/4/tar/
13
DISTNAME=	${PORTNAME}-install-${PORTVERSION}-${PATCHLEVEL}
12
DISTNAME=	${PORTNAME}-install-${PORTVERSION}-${PATCHLEVEL}
Lines 167-175 Link Here
167
		${WRKSRC}/bin/cron/update_phishing_sites.cron
166
		${WRKSRC}/bin/cron/update_phishing_sites.cron
168
	${PERL} -pi -e \
167
	${PERL} -pi -e \
169
		's,/bin/bash,${LOCALBASE}/bin/bash,g; \
168
		's,/bin/bash,${LOCALBASE}/bin/bash,g; \
170
		s,/usr/bin/sa-update,${LOCALBASE}/bin/sa-update,g; \
169
		s,/opt/MailScanner/bin,${PREFIX}/libexec/MailScanner,g; \
171
		s,%%RC_SUBR%%,${RC_SUBR},g;' \
170
		s,%%RC_SUBR%%,${RC_SUBR},g;' \
172
		${WRKSRC}/bin/cron/sa-update.cron
171
		${WRKSRC}/bin/cron/update_spamassassin.cron
172
	${PERL} -pi -e \
173
		's,/bin/bash,${LOCALBASE}/bin/bash,g; \
174
                s,/etc/init.d/MailScanner,${LOCALBASE}/etc/rc.d/mailscanner,g; \
175
		s,/etc/mail/,${LOCALBASE}/etc/mail/,g; \
176
		s,/usr/bin/sa-compile,${LOCALBASE}/bin/sa-compile,g; \
177
		s,/usr/bin/sa-update,${LOCALBASE}/bin/sa-update,g;' \
178
                ${WRKSRC}/bin/update_spamassassin
173
	${PERL} -pi -e \
179
	${PERL} -pi -e \
174
		's,/etc/MailScanner/MailScanner.conf,${PREFIX}/etc/MailScanner/MailScanner.conf,g;' \
180
		's,/etc/MailScanner/MailScanner.conf,${PREFIX}/etc/MailScanner/MailScanner.conf,g;' \
175
		${WRKSRC}/bin/clean.SA.cache
181
		${WRKSRC}/bin/clean.SA.cache
Lines 226-233 Link Here
226
		${PREFIX}/libexec/MailScanner/update_virus_scanners
232
		${PREFIX}/libexec/MailScanner/update_virus_scanners
227
	${INSTALL_SCRIPT} ${WRKSRC}/bin/cron/update_virus_scanners.cron \
233
	${INSTALL_SCRIPT} ${WRKSRC}/bin/cron/update_virus_scanners.cron \
228
		${PREFIX}/libexec/MailScanner/update_virus_scanners.cron
234
		${PREFIX}/libexec/MailScanner/update_virus_scanners.cron
229
	${INSTALL_SCRIPT} ${WRKSRC}/bin/cron/sa-update.cron \
235
	${INSTALL_SCRIPT} ${WRKSRC}/bin/update_spamassassin \
230
		${PREFIX}/libexec/MailScanner/sa-update.cron
236
		${PREFIX}/libexec/MailScanner/update_spamassassin
237
	${INSTALL_SCRIPT} ${WRKSRC}/bin/cron/update_spamassassin.cron \
238
		${PREFIX}/libexec/MailScanner/update_spamassassin.cron
231
	#
239
	#
232
	# Step 3: Install etc files
240
	# Step 3: Install etc files
233
	#
241
	#
(-)distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (MailScanner-install-4.60.8-1.tar.gz) = 3d7a9b877fa908fe103e8190afd0ed77
1
MD5 (MailScanner-install-4.61.7-1.tar.gz) = 62b4af78e735a1708bb30bdbd6a0c908
2
SHA256 (MailScanner-install-4.60.8-1.tar.gz) = ae8257a412989e27c3ea85575d869cd0e53be7c6868b9edce8ded03f26be7ec1
2
SHA256 (MailScanner-install-4.61.7-1.tar.gz) = 1917f06684a5ba26302224f0d786911ec248384cb5c4c607965bd0ad9541d837
3
SIZE (MailScanner-install-4.60.8-1.tar.gz) = 7705484
3
SIZE (MailScanner-install-4.61.7-1.tar.gz) = 7712590
(-)pkg-plist (-2 / +2 lines)
Lines 60-66 Link Here
60
libexec/MailScanner/update_phishing_sites.cron
60
libexec/MailScanner/update_phishing_sites.cron
61
libexec/MailScanner/update_virus_scanners
61
libexec/MailScanner/update_virus_scanners
62
libexec/MailScanner/update_virus_scanners.cron
62
libexec/MailScanner/update_virus_scanners.cron
63
libexec/MailScanner/sa-update.cron
63
libexec/MailScanner/update_spamassassin
64
libexec/MailScanner/update_spamassassin.cron
64
libexec/MailScanner/antivir-autoupdate.sample
65
libexec/MailScanner/antivir-autoupdate.sample
65
libexec/MailScanner/antivir-wrapper.sample
66
libexec/MailScanner/antivir-wrapper.sample
66
libexec/MailScanner/avast-wrapper.sample
67
libexec/MailScanner/avast-wrapper.sample
Lines 72-78 Link Here
72
libexec/MailScanner/bitdefender-wrapper.sample
73
libexec/MailScanner/bitdefender-wrapper.sample
73
libexec/MailScanner/clamav-autoupdate.sample
74
libexec/MailScanner/clamav-autoupdate.sample
74
libexec/MailScanner/clamav-wrapper.sample
75
libexec/MailScanner/clamav-wrapper.sample
75
libexec/MailScanner/clamd-wrapper.sample
76
libexec/MailScanner/command-wrapper.sample
76
libexec/MailScanner/command-wrapper.sample
77
libexec/MailScanner/css-autoupdate.sample
77
libexec/MailScanner/css-autoupdate.sample
78
libexec/MailScanner/css-wrapper.sample
78
libexec/MailScanner/css-wrapper.sample
(-)files/CHANGES.port (+7 lines)
Lines 1-3 Link Here
1
Version 4.61.7
2
==============
3
- Upgrade to 4.61.7
4
- Attention: update_spamassassin and update_spamassassin.cron are rewritten to fit
5
  FreeBSD. Untestet. If you are using non-standard directories or FreeBSD < 6 you will
6
  have to tweck update_spamassassin.
7
1
Version 4.60.8_2
8
Version 4.60.8_2
2
================
9
================
3
- Fixed error in auto-zip: If a message contained 2 different attachments 
10
- Fixed error in auto-zip: If a message contained 2 different attachments 
(-)files/patch-bin-cron-sa-update.cron (-41 lines)
Removed Link Here
1
--- ../MailScanner-install-4.53.7.orig/bin/cron/sa-update.cron	Thu May  4 07:40:53 2006
2
+++ bin/cron/sa-update.cron	Thu May  4 07:42:12 2006
3
@@ -1,22 +1,27 @@
4
 #!/bin/bash
5
 
6
-# Insert a random delay up to this value, to spread virus updates round
7
-# the clock. 1800 seconds = 30 minutes.
8
-# Set this to 0 to disable it.
9
-UPDATEMAXDELAY=3600
10
+# Add the following line to /etc/rc.conf to configure a maximum delay in
11
+# order to spread virus updates round the clock. 1800 seconds = 30 minutes.
12
+# Set this to 0 to disable it
13
+
14
+. %%RC_SUBR%%
15
+
16
+name="mailscanner"
17
+rcvar=`set_rcvar`
18
+
19
+load_rc_config $name
20
+
21
+: ${mailscanner_updatemaxdelay="600"}
22
+
23
 SAUPDATE=/usr/bin/sa-update
24
-if [ -f /etc/sysconfig/MailScanner ] ; then
25
-        . /etc/sysconfig/MailScanner
26
-fi
27
-export UPDATEMAXDELAY
28
 export SAUPDATE
29
 
30
 [ -x $SAUPDATE ] || exit 0
31
-if [ "x$UPDATEMAXDELAY" = "x0" ]; then
32
+if [ "x${mailscanner_updatemaxdelay}" = "x0" ]; then
33
   :
34
 else
35
-  logger -p mail.info -t sa-update Delaying cron job up to $UPDATEMAXDELAY seconds
36
-  perl -e "sleep int(rand($UPDATEMAXDELAY));"
37
+  logger -p mail.info -t sa-update Delaying cron job up to ${mailscanner_updatemaxdelay} seconds
38
+  perl -e "sleep int(rand(${mailscanner_updatemaxdelay}));"
39
 fi
40
 exec $SAUPDATE
41
 exit 0
(-)files/patch-bin-cron-update_spamassassin.cron (+42 lines)
Added Link Here
1
--- ../MailScanner-install-4.61.7.orig/bin/cron/update_spamassassin.cron	Mon Jul  2 12:34:52 2007
2
+++ bin/cron/update_spamassassin.cron	Mon Jul  2 12:50:12 2007
3
@@ -11,23 +11,28 @@
4
   exit;
5
 fi
6
 
7
-# Insert a random delay up to this value, to spread virus updates round
8
-# the clock. 1800 seconds = 30 minutes.
9
-# Set this to 0 to disable it.
10
-UPDATEMAXDELAY=3600
11
+# Add the following line to /etc/rc.conf to configure a maximum delay in
12
+# order to spread spamassassin updates round the clock. 1800 seconds = 30 minutes.
13
+# Set this to 0 to disable it
14
+
15
+. %%RC_SUBR%%
16
+
17
+name="mailscanner"
18
+rcvar=`set_rcvar`
19
+
20
+load_rc_config $name
21
+
22
+: ${mailscanner_sa_updatemaxdelay="3600"}
23
+
24
 SAUPDATE=/opt/MailScanner/bin/update_spamassassin
25
-if [ -f /etc/sysconfig/MailScanner ] ; then
26
-        . /etc/sysconfig/MailScanner
27
-fi
28
-export UPDATEMAXDELAY
29
 export SAUPDATE
30
 
31
 [ -x $SAUPDATE ] || exit 0
32
-if [ "x$UPDATEMAXDELAY" = "x0" ]; then
33
+if [ "x${mailscanner_sa_updatemaxdelay}" = "x0" ]; then
34
   :
35
 else
36
-  logger -p mail.info -t update_spamassassin Delaying cron job up to $UPDATEMAXDELAY seconds
37
-  perl -e "sleep int(rand($UPDATEMAXDELAY));"
38
+  logger -p mail.info -t update_spamassassin Delaying cron job up to ${mailscanner_sa_updatemaxdelay} seconds
39
+  perl -e "sleep int(rand(${mailscanner_sa_updatemaxdelay}));"
40
 fi
41
 exec $SAUPDATE
42
 exit 0
(-)files/patch-bin-update_spamassassin (+31 lines)
Added Link Here
1
--- ../MailScanner-install-4.61.7.orig/bin/update_spamassassin	Mon Jul  2 12:34:52 2007
2
+++ bin/update_spamassassin	Mon Jul  2 12:53:22 2007
3
@@ -14,26 +14,17 @@
4
   exit;
5
 fi
6
 
7
-# Insert a random delay up to this value, to spread virus updates round
8
-# the clock. 1800 seconds = 30 minutes.
9
-# Set this to 0 to disable it.
10
-UPDATEMAXDELAY=3600
11
 SAUPDATE=/usr/bin/sa-update
12
 SACOMPILE=/usr/bin/sa-compile
13
 if [ -f /etc/sysconfig/MailScanner ] ; then
14
         . /etc/sysconfig/MailScanner
15
 fi
16
-export UPDATEMAXDELAY
17
 export SAUPDATE
18
 export SACOMPILE
19
 
20
 [ -x $SAUPDATE ] || exit 0
21
-if [ "x$UPDATEMAXDELAY" = "x0" ]; then
22
-  :
23
-else
24
-  logger -p mail.info -t sa-update Delaying cron job up to $UPDATEMAXDELAY seconds
25
-  perl -e "sleep int(rand($UPDATEMAXDELAY));"
26
-fi
27
+logger -p mail.info -t sa-update Delaying cron job up to $UPDATEMAXDELAY seconds
28
+perl -e "sleep int(rand($UPDATEMAXDELAY));"
29
 
30
 # Update SpamAssassin rules
31
 $SAUPDATE
(-)files/patch-lib-MailScanner-Message.pm (-148 lines)
Removed Link Here
1
--- ../MailScanner-install-4.60.8.orig/lib/MailScanner/Message.pm	Mon Jun  4 21:52:14 2007
2
+++ lib/MailScanner/Message.pm	Mon Jun  4 21:52:31 2007
3
@@ -2,7 +2,7 @@
4
 #   MailScanner - SMTP E-Mail Virus Scanner
5
 #   Copyright (C) 2002  Julian Field
6
 #
7
-#   $Id: Message.pm 3920 2007-05-28 17:20:11Z sysjkf $
8
+#   $Id: Message.pm 3948 2007-06-04 18:25:09Z sysjkf $
9
 #
10
 #   This program is free software; you can redistribute it and/or modify
11
 #   it under the terms of the GNU General Public License as published by
12
@@ -57,7 +57,7 @@
13
 use vars qw($VERSION);
14
 
15
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
16
-$VERSION = substr q$Revision: 3920 $, 10;
17
+$VERSION = substr q$Revision: 3948 $, 10;
18
 
19
 # Attributes are
20
 #
21
@@ -126,6 +126,7 @@
22
 # %alltypes		set by CombineReports
23
 # %entity2parent	set by CreateEntitiesHelpers
24
 # %entity2file		set by CreateEntitiesHelpers
25
+# %entity2safefile	set by CreateEntitiesHelpers
26
 # %file2entity		set by CreateEntitiesHelpers (maps original evil names)
27
 # %file2safefile	set by CreateEntitiesHelpers (evil==>safe)
28
 # %safefile2file	set by CreateEntitiesHelpers (safe==>evil)
29
@@ -1528,14 +1529,17 @@
30
   $regexp = join('|', @escaped);
31
   print STDERR "Regexp is \"$regexp\"\n";
32
 
33
-  # Build a list of attachment filenames
34
-  my($file,@files,$entity);
35
+  # Build a list of attachment entities
36
+  my($file,@files,$entity,@entitylist);
37
+  $this->ListLeafEntities($this->{entity}, \@entitylist);
38
+
39
   my $totalsize = 0; #  Track total size of all attachments added to zip
40
-  while (defined($file = $dir->read)) {
41
-    next if $file =~ /^\.+$/;
42
+  foreach $entity (@entitylist) {
43
+    $file = $this->{entity2safefile}{$entity};
44
     next unless -f "$explodeinto/$file";
45
     print STDERR "Possibly adding file $file\n";
46
-    $entity = $this->{file2entity}{$this->{safefile2file}{$file}};
47
+    print STDERR "Nasty filename is " . $this->{entity2file}{$entity} . "\n";
48
+    #$entity = $this->{file2entity}{$this->{safefile2file}{$file}};
49
     print STDERR "Entity is $entity\n";
50
     next unless $entity;
51
     # Don't add the file if it's the winmail.dat file
52
@@ -1589,6 +1593,7 @@
53
 
54
   # Create all the Helpers for the new attachment
55
   $this->{entity2file}{$newentity} = $newzipname;
56
+  $this->{entity2safefile}{$newentity} = $safezipname;
57
   $this->{entity2parent}{$newentity} = 0;
58
   $this->{file2entity}{$newzipname} = $newentity;
59
   $this->{name2entity}{scalar($newentity)} = $newentity;
60
@@ -1597,12 +1602,12 @@
61
 
62
   # Delete the old attachments' entities
63
   my($attachfile, $attachentity);
64
-  foreach $file (@files) {
65
-    $attachfile = $this->{safefile2file}{$file};
66
-    $attachentity = $this->{file2entity}{$attachfile};
67
-    $this->DeleteEntity($entity, $attachentity);
68
+  foreach $entity (@entitylist) {
69
+    $attachfile = $this->{entity2safefile}{$entity};
70
+    #$attachentity = $this->{file2entity}{$attachfile};
71
+    $this->DeleteEntity($this->{entity}, $entity);
72
     # And the files themselves
73
-    unlink("$explodeinto/$file");
74
+    unlink("$explodeinto/$attachfile");
75
   }
76
 
77
 }
78
@@ -1890,6 +1895,27 @@
79
     if $workarea->{changeowner};
80
 }
81
 
82
+sub ListLeafEntities {
83
+  my($message, $entity, $entitylist) = @_;
84
+
85
+  my(@parts, $part);
86
+
87
+  # Fallen off the tree?
88
+  return unless $entity && defined($entity->head);
89
+
90
+  # Found a leaf node
91
+  if ($entity && !$entity->parts) {
92
+    push @$entitylist, $entity;
93
+    return;
94
+  }
95
+
96
+  # Walk down each sub-tree
97
+  @parts = $entity->parts;
98
+  foreach $part (@parts) {
99
+    ListLeafEntities($message, $part, $entitylist);
100
+  }
101
+}
102
+
103
 # Delete a given entity from the MIME entity tree.
104
 # Have to walk the entire tree to do this.
105
 # Bail out as soon as we've found it.
106
@@ -2860,6 +2886,7 @@
107
 
108
   # Put something useless in the 2 hashes so that they exist.
109
   $this->{entity2file}{""} = 0;
110
+  $this->{entity2safefile}{""} = 0;
111
   $this->{entity2parent}{""} = 0;
112
   $this->{file2entity}{""} = $this->{entity}; # Root of this message
113
   $this->{name2entity}{""} = 0;
114
@@ -2870,6 +2897,7 @@
115
                                  $this->{file2safefile},
116
                                  $this->{safefile2file},
117
                                  $this->{entity2file},
118
+                                 $this->{entity2safefile},
119
                                  $this->{name2entity});
120
   #print STDERR "In CreateEntitiesHelpers, this = $this\n";
121
   #print STDERR "In CreateEntitiesHelpers, this entity = " .
122
@@ -2903,7 +2931,7 @@
123
 # This is recursive. This is a class function, not a normal method.
124
 sub BuildFile2EntityAndEntity2File {
125
   my($entity, $file2entity, $file2safefile, $safefile2file, $entity2file,
126
-     $name2entity) = @_;
127
+     $entity2safefile, $name2entity) = @_;
128
 
129
   # Build the conversion hash from scalar(entity) --> real entity object
130
   # Need to do this as objects cannot be hash keys.
131
@@ -2929,6 +2957,7 @@
132
   if ($headfile) {
133
     $file2entity->{$headfile} = $entity if !$file2entity->{$headfile};
134
     $file2safefile->{$headfile} = $path;
135
+    $entity2safefile->{$entity} = $path;
136
     $safefile2file->{$path}     = $headfile;
137
     #print STDERR "File2SafeFile (\"$headfile\") = \"$path\"\n";
138
   }
139
@@ -2937,7 +2966,8 @@
140
   @parts = $entity->parts;
141
   foreach $part (@parts) {
142
     BuildFile2EntityAndEntity2File($part, $file2entity, $file2safefile,
143
-                                   $safefile2file, $entity2file, $name2entity);
144
+                                   $safefile2file, $entity2file,
145
+                                   $entity2safefile, $name2entity);
146
   }
147
 }
148
 

Return to bug 114214