diff options
author | William Thomson <wltjr@gentoo.org> | 2006-11-22 19:00:28 +0000 |
---|---|---|
committer | William Thomson <wltjr@gentoo.org> | 2006-11-22 19:00:28 +0000 |
commit | 487ca742ffb2bbd687239a67a234d286b25a9a94 (patch) | |
tree | 30050d1ff0d42171bbdd2635d998bb96b701c2d0 /mail-filter | |
parent | Add blocker with dev-db/cdb, thanks to Tuan Van for reporting, bug 115594 (diff) | |
download | historical-487ca742ffb2bbd687239a67a234d286b25a9a94.tar.gz historical-487ca742ffb2bbd687239a67a234d286b25a9a94.tar.bz2 historical-487ca742ffb2bbd687239a67a234d286b25a9a94.zip |
Coverted from using sed to applying patch. Due to multiline sed statements not applying some lines, nor failing either. Patch will fail on error.
Package-Manager: portage-2.1.2_rc2
Diffstat (limited to 'mail-filter')
-rw-r--r-- | mail-filter/assp/ChangeLog | 10 | ||||
-rw-r--r-- | mail-filter/assp/assp-1.2.5-r4.ebuild | 122 | ||||
-rw-r--r-- | mail-filter/assp/files/assp-1.2.5.patch | 258 | ||||
-rw-r--r-- | mail-filter/assp/files/digest-assp-1.2.5-r4 | 3 |
4 files changed, 392 insertions, 1 deletions
diff --git a/mail-filter/assp/ChangeLog b/mail-filter/assp/ChangeLog index f566bb0e25bb..b81cf15d1d55 100644 --- a/mail-filter/assp/ChangeLog +++ b/mail-filter/assp/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for mail-filter/assp # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/assp/ChangeLog,v 1.5 2006/11/20 22:48:33 wltjr Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/assp/ChangeLog,v 1.6 2006/11/22 19:00:28 wltjr Exp $ + +*assp-1.2.5-r4 (22 Nov 2006) + + 22 Nov 2006; William L. Thomson Jr. <wltjr@gentoo.org> + +files/assp-1.2.5.patch, -assp-1.2.5.ebuild, -assp-1.2.5-r1.ebuild, + -assp-1.2.5-r2.ebuild, +assp-1.2.5-r4.ebuild: + Coverted from using sed to applying patch. Due to multiline sed statements + not applying some lines, nor failing either. Patch will fail on error. *assp-1.2.5-r3 (20 Nov 2006) diff --git a/mail-filter/assp/assp-1.2.5-r4.ebuild b/mail-filter/assp/assp-1.2.5-r4.ebuild new file mode 100644 index 000000000000..4178e84bd199 --- /dev/null +++ b/mail-filter/assp/assp-1.2.5-r4.ebuild @@ -0,0 +1,122 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/assp/assp-1.2.5-r4.ebuild,v 1.1 2006/11/22 19:00:28 wltjr Exp $ + +inherit eutils + +DESCRIPTION="Anti-Spam SMTP Proxy written in Perl." +HOMEPAGE="http://assp.sourceforge.net/" +MY_PN=ASSP +SRC_URI="mirror://sourceforge/${PN}/${MY_PN}_${PV}-Install.zip" +LICENSE="GPL-2" +SLOT="0" + +KEYWORDS="~amd64 ~x86" + +IUSE="ldap spf srs" + +DEPEND="app-arch/unzip" + +RDEPEND="dev-lang/perl + dev-perl/Net-DNS + dev-perl/File-ReadBackwards + dev-perl/Compress-Zlib + dev-perl/Email-Valid + virtual/perl-Digest-MD5 + perl-core/Time-HiRes + spf? ( dev-perl/Mail-SPF-Query ) + srs? ( dev-perl/Mail-SRS ) + ldap? ( dev-perl/perl-ldap )" + +S=${WORKDIR}/${MY_PN} + +pkg_setup() { + enewgroup assp + enewuser assp -1 -1 /dev/null assp +} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch ${FILESDIR}/assp-${PV}.patch + + local FILES=" + assp.pl + freshclam.sh + move2num.pl + rebuildspamdb.pl + repair.pl + stats.sh + stat.pl + " + # just being safe + for file in ${FILES}; do + edos2unix ${file} + done + + # remove windows stuff + rm "${S}/addservice.pl" + rm -f "${S}/Win32-quickstart-guide.txt" +} + +src_install() { + # Configuration directory + dodir /etc/assp + fowners assp:assp /etc/assp + fperms 770 /etc/assp + + # Setup directories for mail to be stored for filter + keepdir /var/lib/assp/spam /var/lib/assp/notspam + keepdir /var/lib/assp/errors/spam /var/lib/assp/errors/notspam + + # Logs directory + keepdir /var/log/assp + fowners assp:assp -R /var/log/assp + fperms 770 /var/log/assp + + # Install the app + exeinto /usr/share/assp + doexe *.pl *.sh + insinto /usr/share/assp + doins -r images/ + insinto /var/lib/assp + doins *.txt *.sav + + # Lock down the files/data + fowners assp:assp -R /usr/share/assp + fperms 770 /usr/share/assp + + # Data storage + fowners assp:assp -R /var/lib/assp + fperms 770 /var/lib/assp + + # PID directory + dodir /var/run/assp + keepdir /var/run/assp + fowners assp:assp -R /var/run/assp + fperms 770 /var/run/assp + + # Install the init.d script to listen + newinitd "${FILESDIR}/asspd.init" asspd + + dohtml *.htm +} + +pkg_postinst() { + elog + elog "To configure ASSP, start /etc/init.d/asspd then point" + elog "your browser to http://localhost:55555" + elog "Username: admin Password: nospam4me (CHANGE ASAP!)" + elog + elog "File permissions have been set to use assp:assp" + elog "with mode 770 on directories. When you configure" + elog "ASSP, make sure and use the user assp." + elog + elog "Don't change any path related options." + elog + elog "All utilities are prefixed with assp." + elog + elog "See the on-line docs for a complete tutorial." + elog +} + diff --git a/mail-filter/assp/files/assp-1.2.5.patch b/mail-filter/assp/files/assp-1.2.5.patch new file mode 100644 index 000000000000..e9ce2d04b45c --- /dev/null +++ b/mail-filter/assp/files/assp-1.2.5.patch @@ -0,0 +1,258 @@ +diff -Naur /root/assp/ASSP/assp.pl /var/tmp/portage/assp-1.2.5-r3/work/ASSP/assp.pl +--- /root/assp/ASSP/assp.pl 2006-10-25 09:57:48.000000000 +0200 ++++ /var/tmp/portage/assp-1.2.5-r3/work/ASSP/assp.pl 2006-11-21 23:12:59.000000000 +0100 +@@ -58,12 +58,12 @@ + $base=$ARGV[0];
+ } else {
+ # the last one is the one used if all else fails
+- foreach ('.','assp','/usr/local/assp','/home/assp','/usr/assp','/applications/assp','/assp','.') {
++ foreach ('/var/lib/assp/','assp','/usr/local/assp','/home/assp','/usr/assp','/applications/assp','/assp','.') {
+ $base=$_;
+- last if -e "$base/assp.cfg";
++ last if -e "/etc/assp/assp.cfg";
+ }
+ }
+-if ( !-e "$base/images/noIcon.png")
++if ( !-e "/usr/share/assp/images/noIcon.png")
+ { die "Abort: folder 'images' not correctly installed";}
+
+ loadConfig();
+@@ -91,7 +91,7 @@ + 'The address:port of your message handling system\'s smtp server(s). Secondary servers possible, will try the next if the first doesn\'t respond.<br />If only the port is entered, or the keyword <b>__INBOUND__</b>:<i>port</i> is used, then the connection will be established to the same IP where the connection was received. This is usefull when you have several IPs with different domains/profiles in your MTA.<br /> Examples: "127.0.0.1:125","127.0.0.1:125|127.0.0.5:125", "10.0.1.3", "10.0.1.3:1025", "__INBOUND__:125", "125", etc.'],
+ [AsAService,'As a Service',0,checkbox,0,'(.*)',undef,
+ 'In Windows 2000 / NT you can run it as a service; requires <a href="http://www.roth.net/perl/Daemon/" rel="external">win32::daemon</a>. Requires start from the service control panel.'],
+- [AsADaemon,'As a Daemon',0,checkbox,0,'(.*)',undef,
++ [AsADaemon,'As a Daemon',0,checkbox,1,'(.*)',undef,
+ 'In Linux/BSD/Unix/OSX fork and close file handles, kinda like "perl assp.pl &" but better. Requires restart.'],
+ [myName,'My Name',40,textinput,'ASSP.nospam','(\S+)',undef,
+ 'What the program calls itself in the email "received by" header. Usually ASSP.nospam.'],
+@@ -873,10 +873,10 @@ + [greylist,'Greylist Database',40,textinput,'greylist','(\S*)',undef,'The file with the current greylist database -- make this blank if you don\'t use it.'],
+ [delaydb,'Delaying Database',40,textinput,'delaydb','(\S*)',undef,'The file with the delay database.'],
+
+- [logfile,'ASSP Logfile',40,textinput,'maillog.txt','(\S*)',ConfigChangeLogfile,
++ [logfile,'ASSP Logfile',40,textinput,'/var/log/assp/maillog.txt','(\S*)',ConfigChangeLogfile,
+ 'Blank if you don\'t want a log file. Change it to maillog.log if you don\'t want auto rollover.
+ NOTE: Changing this field requires restarting ASSP before changes take effect.'],
+- [pidfile,'PID File',40,textinput,'pid','(\S*)',undef,'Blank to skip writing a pid file. *nix users need pid files.
++ [pidfile,'PID File',40,textinput,'asspd.pid','(\S*)',undef,'Blank to skip writing a pid file. *nix users need pid files.
+ Leave it blank in Windows.<br /> You have to restart the service before you get a pid file in the new location.<br /><hr />
+ <div class=\"menuLevel1\">Notes On File Path</div>
+ <input type="button" value="Notes" onClick="javascript:popFileEditor(\'notes/filepath.txt\',3);">
+@@ -940,9 +940,9 @@ + '],
+
+ [0,0,0,'heading','Security'],
+- [runAsUser,'Run as UID',20,textinput,'','(\S*)',undef,
++ [runAsUser,'Run as UID',20,textinput,'assp','(\S*)',undef,
+ 'The *nix user name to assume after startup: assp or nobody -- requires ASSP restart.'],
+- [runAsGroup,'Run as GID',20,textinput,'','(\S*)',undef,
++ [runAsGroup,'Run as GID',20,textinput,'assp','(\S*)',undef,
+ 'The *nix group to assume after startup: assp or nogroup -- requires ASSP restart.'],
+ [ChangeRoot,'Change Root',40,textinput,'','(.*)',undef,
+ 'Non-blank means to run in chroot jail in *nix. You need an etc/protocols file to make this work<br />
+@@ -1044,7 +1044,7 @@ + }
+ }
+ # load configuration file
+- open(F,"<$base/assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F;
++ open(F,"</etc/assp/assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F;
+ # set nonexistent settings to default values
+ foreach $c (@Config) {
+ if ($c->[0] && !(exists $Config{$c->[0]})) {
+@@ -1384,19 +1384,19 @@ + $silent=1;
+ }
+
+-if($pidfile) {open(F,">$base/$pidfile"); print F $$; close F;}
++if($pidfile) {open(F,">/var/run/assp/$pidfile"); print F $$; close F;}
+
+ sub RemovePid {
+ if ($pidfile) {
+ d('RemovePid');
+- unlink("$base/$pidfile");
++ unlink("/var/run/assp/$pidfile");
+ }
+ }
+
+ if($DEBUG) {open(DEBUG, ">$base/".time.".dbg"); binmode(DEBUG); my $oldfh = select(DEBUG); $| = 1; select($oldfh);}
+ my $logdir = $1 if $logfile=~/(.*)\/.*/;
+- mkdir "$base/$logdir",0777 if $logdir;
+-if($logfile && open(LOG,">>$base/$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
++ mkdir "$logdir",0777 if $logdir;
++if($logfile && open(LOG,">>$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
+
+ if($AsAService) {
+ eval(<<'EOT');
+@@ -1984,7 +1984,7 @@ + if($LogRollDays > 0) {
+ my $t=int(time()/($LogRollDays*24*3600)); # roll log every 14 days
+
+- if($logfile && $mlogLastT && $t != $mlogLastT && $logfile ne "maillog.log" && $asspLog) {
++ if($logfile && $mlogLastT && $t != $mlogLastT && $logfile ne "/var/log/assp/maillog.log" && $asspLog) {
+ # roll the log
+
+ my ($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
+@@ -1995,7 +1995,7 @@ + if (!$logdir) {
+ $archivelogfile = "$mm.$logfile";
+ } else {
+- mkdir "$base/$logdir",0777;
++ mkdir "$logdir",0777;
+ $archivelogfile = "$logdir/$mm.$logdirfile";
+ }
+ my $msg="$m: Rolling log file -- archive saved as '$archivelogfile'\n";
+@@ -2003,8 +2003,8 @@ + print $msg unless $silent;
+
+ close LOG;
+- rename("$base/$logfile", "$base/$archivelogfile");
+- if(open(LOG,">>$base/$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
++ rename("$logfile", "$archivelogfile");
++ if(open(LOG,">>$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
+ print LOG "$m new log file -- old log file renamed to '$archivelogfile'\n";
+ SaveConfig();
+ }
+@@ -3439,7 +3439,7 @@ + return 1;
+ }
+ my ($per_result, $smtp_comment, $header_comment, $spf_fail);
+- foreach my $recip (split(' ', $this->{rcpt})) {
++ foreach my $recip (split('/var/lib/assp/', $this->{rcpt})) {
+ ($per_result, $smtp_comment, $header_comment, $spf_fail) =
+ $query->result2($recip);
+ # Keep processing SPF records until all recipients are checked
+@@ -5749,7 +5749,7 @@ + $a{lc $1}=1;
+ }
+ }
+- foreach $a (split(' ',lc $this->{rcpt})) {
++ foreach $a (split('/var/lib/assp/',lc $this->{rcpt})) {
+ $a{$a}=1;
+ }
+ foreach $a (keys %a) {
+@@ -6108,10 +6108,10 @@ + if($UseSubjectsAsMaillogNames || $isspam==2 || $isspam==3) {
+
+ $sub.="--".(++$Counter);
+- return "$base/$maillog/$sub$maillogExt";
++ return "/var/lib/assp/$maillog/$sub$maillogExt";
+ } else {
+ my $fn=(time + $Counter++ ) % $MaxFiles;
+- "$base/$maillog/$fn$maillogExt";
++ "/var/lib/assp/$maillog/$fn$maillogExt";
+ }
+ }
+
+@@ -7386,7 +7386,7 @@ + $m=~s/^... (...) +(\d+) (\S+) ..(..)/$1-$2-$4 $3 /;
+ my $indent=" " x length($m);
+ if(!$pat) {
+- open(F,"<$base/$logfile");
++ open(F,"<$logfile");
+ seek(F,-$MaillogTailBytes,2) || seek(F,0,0);
+ local $/;
+ $s=<F>;
+@@ -7448,7 +7448,7 @@ + my %replace;
+ my $j=0;
+ my $highlightExpr='=~s/(';
+- foreach (map/^([^-].*)/, split(' ',$pat)) {
++ foreach (map/^([^-].*)/, split('/var/lib/assp/',$pat)) {
+ $replace{lc $_}=$highlights[$j % @highlights]; # pick highlight style
+ $highlightExpr.=quotemeta($_).'|';
+ if ($MaillogTailWrapColumn>0) {
+@@ -7831,7 +7831,7 @@ + }
+
+ if ($fil !~ /^\Q$base\E/i) {
+- $fil="$base/$fil";
++ $fil="/usr/share/assp/$fil";
+ }
+ if (-e $fil) {
+ my $mtime;
+@@ -8166,9 +8166,9 @@ + }
+
+ sub SaveConfig {
+- rename("$base/assp.cfg.bak","$base/assp.cfg.bak.bak");
+- rename("$base/assp.cfg","$base/assp.cfg.bak");
+- open(F,">$base/assp.cfg");
++ rename("/etc/assp/assp.cfg.bak","/etc/assp/assp.cfg.bak.bak");
++ rename("/etc/assp/assp.cfg","/etc/assp/assp.cfg.bak");
++ open(F,">/etc/assp/assp.cfg");
+ foreach (sort keys %Config) {print F "$_:=$Config{$_}\n";}
+ close F;
+ }
+@@ -8520,7 +8520,7 @@ + sub ConfigChangeLogfile {my ($name, $old, $new)=@_;
+ close LOG if $logfile;
+ $logfile=$new;
+- if($logfile && open(LOG,">>$base/$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
++ if($logfile && open(LOG,">>$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
+ mlog(0,"log file changed to '$new' from '$old' per admin request");
+ '';
+ }
+@@ -8865,7 +8865,7 @@ + # called on SIG HUP
+ my %newConfig;
+ mlog(0,"sig HUP -- reloading config");
+- open(F,"<$base/assp.cfg"); local $/; (%newConfig)=split(/:=|\n/,<F>); close F;
++ open(F,"</etc/assp/assp.cfg"); local $/; (%newConfig)=split(/:=|\n/,<F>); close F;
+ foreach $c (@Config) {
+ my ($name,$nicename,$size,$func,$default,$valid,$onchange,$description)=@$c;
+ if($Config{$name} ne $newConfig{$name}) {
+@@ -8893,7 +8893,7 @@ + }
+ # reopen log file, just for fun.
+ close LOG;
+- if(open(LOG,">>$base/$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
++ if(open(LOG,">>$logfile")) {my $oldfh = select(LOG); $| = 1; select($oldfh);}
+ print LOG "Logfile reopened on HUP\n";
+ }
+
+diff -Naur /root/assp/ASSP/move2num.pl /var/tmp/portage/assp-1.2.5-r3/work/ASSP/move2num.pl +--- /root/assp/ASSP/move2num.pl 2005-06-27 03:05:34.000000000 +0200 ++++ /var/tmp/portage/assp-1.2.5-r3/work/ASSP/move2num.pl 2006-11-21 23:12:59.000000000 +0100 +@@ -3,7 +3,7 @@ + # renames files to numbers + # (c) John Hanna, John Calvi 2003 under the terms of the GPL + +-open(F,"<assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F; ++open(F,"</etc/assp/assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F; + $spamlog=$Config{spamlog} && "$Config{base}/$Config{spamlog}" || 'spam'; + $notspamlog=$Config{notspamlog} && "$Config{base}/$Config{notspamlog}" || 'notspam'; + $MaxFiles=$Config{MaxFiles} || 14003; +diff -Naur /root/assp/ASSP/rebuildspamdb.pl /var/tmp/portage/assp-1.2.5-r3/work/ASSP/rebuildspamdb.pl +--- /root/assp/ASSP/rebuildspamdb.pl 2006-04-25 15:18:56.000000000 +0200 ++++ /var/tmp/portage/assp-1.2.5-r3/work/ASSP/rebuildspamdb.pl 2006-11-21 23:12:59.000000000 +0100 +@@ -4,7 +4,7 @@ + # (c) John Hanna 2003 under the terms of the GPL + # Updated July 2004 for simple proxy support. + +-open(F,"<assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F; ++open(F,"</etc/assp/assp.cfg"); local $/; (%Config)=split(/:=|\n/,<F>); close F; + $spamlog=$Config{spamlog} && "$Config{base}/$Config{spamlog}" || 'spam'; + $notspamlog=$Config{notspamlog} && "$Config{base}/$Config{notspamlog}" || 'notspam'; + $correctedspam=$Config{correctedspam} && "$Config{base}/$Config{correctedspam}" || 'errors/spam'; +@@ -13,7 +13,7 @@ + $whitelistdb=$Config{whitelistdb} && "$Config{base}/$Config{whitelistdb}" || 'whitelist'; + $MaxWhitelistDays=$Config{MaxWhitelistDays} || 90; + $OrderedTieHashSize=$Config{OrderedTieHashSize} || 5000; +-$Log=$Config{logfile} && "$Config{base}/$Config{logfile}" || 'maillog.txt'; ++$Log=$Config{logfile}; + $whiteRE=$Config{whiteRE}; + $KeepWhitelistedSpam=$Config{KeepWhitelistedSpam}; + $proxyserver=$Config{proxyserver}; +diff -Naur /root/assp/ASSP/stats.sh /var/tmp/portage/assp-1.2.5-r3/work/ASSP/stats.sh +--- /root/assp/ASSP/stats.sh 2005-01-01 05:58:26.000000000 +0100 ++++ /var/tmp/portage/assp-1.2.5-r3/work/ASSP/stats.sh 2006-11-21 23:12:59.000000000 +0100 +@@ -52,7 +52,7 @@ + # your system's 'newsyslog' functionality. You can send a SIGHUP to
+ # ASSP when you roll the log so it starts afresh..KRL
+
+-tail -300 -f /usr/local/assp/maillog.log | \
++tail -n 300 -f /var/log/assp/maillog.txt | \
+ awk ' \
+ /whitelisted/ { \
+ printf("%s %s \033[1;32m%-15s L\033[0mW %s \033[1;32m->\033[0m %s\n", \
diff --git a/mail-filter/assp/files/digest-assp-1.2.5-r4 b/mail-filter/assp/files/digest-assp-1.2.5-r4 new file mode 100644 index 000000000000..b1a96621e5e7 --- /dev/null +++ b/mail-filter/assp/files/digest-assp-1.2.5-r4 @@ -0,0 +1,3 @@ +MD5 ffbb815b24ea5073000dd50143edc311 ASSP_1.2.5-Install.zip 244225 +RMD160 748798f39918e6519be755d8e44a288fc82d636c ASSP_1.2.5-Install.zip 244225 +SHA256 282325e0434ef8554fe281a2b25267fde99254ea83bc7073c2acfbc47c2d31af ASSP_1.2.5-Install.zip 244225 |