diff -Naur assp_org/ASSP/assp.pl assp_patched/ASSP/assp.pl
--- assp_org/ASSP/assp.pl 2007-05-01 05:23:42.000000000 -0600
+++ assp_patched/ASSP/assp.pl 2007-06-16 11:45:31.000000000 -0600
@@ -55,13 +55,9 @@
if($ARGV[0]) {
$base=$ARGV[0];
} else {
- # the last one is the one used if all else fails
- foreach ('.','assp','/usr/local/assp','/home/assp','/etc/assp','/usr/assp','/applications/assp','/assp','.') {
- $base=$_;
- last if -e "$base/assp.cfg";
- }
+ $base='/etc/assp/';
}
-if ( !-e "$base/images/noIcon.png")
+if ( !-e "/usr/share/assp/images/noIcon.png")
{ die "Abort: folder 'images' not correctly installed";}
loadConfig();
@@ -124,8 +120,8 @@
[blackRe,'BlackRe - Expression to Identify Spam* ',60,textinput,'http://[\\w\\.]+@|\w<[a-z0-9]+[abcdfghjklmnpqrstuvwxyz0-9]{4}[a-z0-9]*>|subject: [^\\n]* \S','(.*)',ConfigCompileRe,
'If an incoming email that\'s not local or whitelisted matches this Perl regular expression it will be considered spam by the Bayesian filter.
May match text from the body or header of the email. For example: penis|virgin|X-Priority: 1','Basic'],
-[redRe,'Expression to Identify Redlisted Mail*',60,textinput,'file:files/redre.txt','(.*)',ConfigCompileRe,
-'If an email matches this Perl regular expression it will be considered redlisted. The redlist is a list of addresses that cannot contribute to the whitelist, and who are not considered local, even if their mail is from a local computer. For example, if someone goes on a vacation and turns on their email\'s autoresponder, put them on the redlist until they return. Then as they reply to every spam they receive they won\'t corrupt your non-spam collection or whitelist: \\[autoreply\\] Redlisted addresses will not be added to the whitelist. Redlisted messages will not be stored in the SPAM/NOTSPAM-collection. As all fields marked by * this field accepts a list separated by | or a specified file \'file:files/redre.txt\' .','Basic'],
+[redRe,'Expression to Identify Redlisted Mail*',60,textinput,'file:/etc/assp/redre.txt','(.*)',ConfigCompileRe,
+'If an email matches this Perl regular expression it will be considered redlisted. The redlist is a list of addresses that cannot contribute to the whitelist, and who are not considered local, even if their mail is from a local computer. For example, if someone goes on a vacation and turns on their email\'s autoresponder, put them on the redlist until they return. Then as they reply to every spam they receive they won\'t corrupt your non-spam collection or whitelist: \\[autoreply\\] Redlisted addresses will not be added to the whitelist. Redlisted messages will not be stored in the SPAM/NOTSPAM-collection. As all fields marked by * this field accepts a list separated by | or a specified file \'file:/etc/assp/redre.txt\' .','Basic'],
[SpamError,'Spam Error',80,textinput,'554 5.7.1 Mail appears to be unsolicited -- send error reports to postmaster@yourdomain.com','(5\d\d .*)',undef,
'SMTP error message to reject spam. For example:554 5.7.1 Mail appears to be unsolicited -- send error reports to postmaster@yourdomain.com'],
@@ -207,7 +203,7 @@
Valid entry types are as per spamlovers: full address, username only, or entire @domain.'],
[noProcessingIPs,'Unprocessed IPs*',60,textinput,'','(.*)',ConfigMakeRe,
'Mail from any of these IPs are ignored by ASSP.
-For example: 127.0.0.1|10.|169.254.|172.16.|192.168. As all fields marked by * this field accepts a list separated by | or a filename specified this way: \'file:files/ipnp.txt\' .'],
+For example: 127.0.0.1|10.|169.254.|172.16.|192.168. As all fields marked by * this field accepts a list separated by | or a filename specified this way: \'file:/etc/assp/ipnp.txt\' .'],
[npRe,'Expression to Identify No Processing Mail*',60,textinput,'','(.*)',ConfigCompileRe,
'If an email header matches this Perl regular expression it will pass
through unprocessed. For example: 169\.254\.122\.|172\.16\.|\\[autoreply\\].'],
@@ -228,9 +224,9 @@
For example: Secret Ham Password|307\D{0,3}730\D{0,3}4[12]\d\d
For help writing regular expressions click here.
Note that flags are "si" and the header as well as body is scanned.
- Some things you might include here are your office phone number or street address, spam rarely includes these details. As usual (marked by *) this field accepts a list separated by | or a filename specified this way: \'file:files/whitere.txt\' .','Basic'],
+ Some things you might include here are your office phone number or street address, spam rarely includes these details. As usual (marked by *) this field accepts a list separated by | or a filename specified this way: \'file:/etc/assp/whitere.txt\' .','Basic'],
[whiteListedIPs,'Whitelisted IPs*',60,textinput,'','(.*)',ConfigMakeRe,
- 'They contribute to the whitelist and to notspam. For example: 127.0.0.1|10.|169.254.|172.16.|192.168. As all fields marked by * this field accepts a list separated by | or a filename specified this way: \'file:files/ipwl.txt\' .'],
+ 'They contribute to the whitelist and to notspam. For example: 127.0.0.1|10.|169.254.|172.16.|192.168. As all fields marked by * this field accepts a list separated by | or a filename specified this way: \'file:/etc/assp/ipwl.txt\' .'],
[whiteListedDomains,'Whitelisted Domains*',60,textinput,'sourceforge.net','(.*)',ConfigMakeRe,
'Domains from which you want to receive all mail. Your ISP, domain registration, mail list servers, stock broker, or other key business partners might be good candidates. Note this matches the end of the address, so if you don\'t want to match subdomains then include the @. Note that buy.com would also match spambuy.com but .buy.com won\'t match buy.com. DO NOT put your local domains on this list. For example: sourceforge.net|@google.com|.buy.com','Basic'],
[ValidateRWL,'Enable Realtime Whitelist Validation',0,checkbox,0,'([01]?)',configUpdateRWL,
@@ -288,7 +284,7 @@
rel="external">NET::LDAP module in PERL.'],
[ispip,'ISP/Secondary MX Servers*',60,textinput,'','(\S*)',ConfigMakeRe,
'Enter any addresses that are your ISP or backup MX servers, separated by pipes (|).
- These addresses will (necessarily) bypass Griplist, IP Limiting, Delaying, Penalty Box, SPF, RBL & SRS checks. For example: 127.0.0.1|10. You can use here the same file which is used for delay-exceptions: \'file:files/nodelay.txt\'','Basic'],
+ These addresses will (necessarily) bypass Griplist, IP Limiting, Delaying, Penalty Box, SPF, RBL & SRS checks. For example: 127.0.0.1|10. You can use here the same file which is used for delay-exceptions: \'file:/etc/assp/nodelay.txt\'','Basic'],
[ispgreyvalue,'ISP/Secondary MX Grey Value',5,textinput,'0.5','(\S*)',undef,
'It is recommended that for ISP & Secondary MX servers to bypass their Griplist values
For eg. 0.5 (Completely GReyIP). If left blank then the Griplist "X" value is used.
@@ -400,9 +396,9 @@
"The White Box is always activated. The White Box works in a similar way for IPs as the Whitelist works for addresses - but it is not a whitelist: Bayesian check will be done. WhiteBox Entries will expire after this number of days. For example: 30"],
[exportExtremeFile,'Exported Black Box Extreme IPs *',40,textinput,'','(\S*)',undef,
- 'IP\'s in Black Box which surpassed the extreme level will be regularly stored to this file - if defined. It can be used, to fill safely the denysmtpfile over time. For example: file:files/exportextreme.txt'],
+ 'IP\'s in Black Box which surpassed the extreme level will be regularly stored to this file - if defined. It can be used, to fill safely the denysmtpfile over time. For example: file:/etc/assp/exportextreme.txt'],
[denySMTPConnectionsFrom,'Deny SMTP Connections from these IPs*',40,textinput,'','(\S*)',ConfigMakeRe,
-'Manually maintained list of IPs which should be denied access. For example: file:files/denysmtp.txt'],
+'Manually maintained list of IPs which should be denied access. For example: file:/etc/assp/denysmtp.txt'],
[DoNotPenalizeRed,'Do Not Penalize Redlisted Mails',0,checkbox,0,'([01]?)',undef,
'Mails matching Red Regex or Redlist will not be penalized.'],
[DoNotPenalizeBounces,'Do Not Penalize Bounced Mails',0,checkbox,1,'([01]?)',undef,
@@ -482,9 +478,9 @@
[DoInvalidPTR,'Reversed Lookup FQDN',1,textinput,0,'(.*)',undef,
'If activated - and Reversed Lookup is activated and found a record -, the PTR-FQDN record is checked against the Regex. This requires an installed Net::DNS module in PERL. 0 = deactivate, 1 = activate, 2 = log only, 3 = message-scoring .','Basic'],
-[invalidPTRRe,'Expression to Invalidate Format of PTR*',80,textinput,'file:files/invalidptr.txt','(.*)',ConfigCompileRe,
+[invalidPTRRe,'Expression to Invalidate Format of PTR*',80,textinput,'file:/etc/assp/invalidptr.txt','(.*)',ConfigCompileRe,
'Validate Format PTR will check PTR records for this.
- For example: ^\d+\.\d+\.\d+\.\d+$|^[^\.]+\.?$ or file:files/invalidptr.txt'],
+ For example: ^\d+\.\d+\.\d+\.\d+$|^[^\.]+\.?$ or file:/etc/assp/invalidptr.txt'],
[DoDomainCheck,'Validate Sender Domain MX/A',1,textinput,0,'(.*)',undef,
'If activated, each sender address is checked for a valid MX/A record.
This requires an installed Email::Valid module in PERL.
@@ -526,7 +522,7 @@
'Delete outdated entries from triplets and whitelisted tuplets databases every this many seconds.
Note: the current timeout must expire before the new setting is loaded, or you can restart.
Defaults to 1 hour.'],
-[noDelay,'Don\'t Delay these IPs*',60,textinput,'file:files/nodelay.txt','(.*)',ConfigMakeRe,
+[noDelay,'Don\'t Delay these IPs*',60,textinput,'file:/etc/assp/nodelay.txt','(.*)',ConfigMakeRe,
'Enter IP addresses that you don\'t want to be delayed, separated by pipes (|). There are misbehaving MTAs that will not be able to get a legitimate email through a Greylisting server because they do not try again later. An INCOMPLETE list of such mailers is available at cvs.puremagic.com/viewcvs/Greylisting/schema/whitelist_ip.txt.
When using mentioned list remember to add trailing dots in IP addresses which specify subnets (eg. 192.168 -> 192.168. ).
For example: 127.0.0.1|192.168.'],
@@ -638,7 +634,7 @@
0 = deactivate, 1 = activate, 2 = log only, 3 = message-scoring .','Basic'],
[URIBLServiceProvider,'URIBL Service Providers*',60,\&textinput,'multi.surbl.org','(.*)',configUpdateURIBLSP,
'Domain Names of URIBLs to use separated by "|". Default is: multi.surbl.org. You may separate this in multi.uribl.com|sc.surbl.org|ws.surbl.org|ob.surbl.org|ab.surbl.org|ph.surbl.org|jp.surbl.org and set and set the max hits to 2 for an affirmative'],
- [URIBLCCTLDS,'URIBL Country Code TLDs*',60,\&textinput,'file:files/URIBLCCTLDS.txt','(.*)',ConfigMakeRe,
+ [URIBLCCTLDS,'URIBL Country Code TLDs*',60,\&textinput,'file:/etc/assp/URIBLCCTLDS.txt','(.*)',ConfigMakeRe,
'List of country code TLDs used to determine the base domain of the uri.'],
[ValidateMaxURI,'Enable maximum number of URI domains check' ,1,textinput,'1','(.*)',undef,'
0 = deactivate, 1 = activate, 2 = log only, 3 = message-scoring .'],
@@ -751,7 +747,7 @@
[DoBombRe,'Use Bomb Regular Expression ','1',textinput,0,'(\d*)',undef,
'If activated, each message is checked against the Bomb Regular Expression. 0 = deactivate, 1 = activate, 2 = log only, 3 = message-scoring .'],
-[bombRe,'Bomb Regular Expression*',80,textinput,'file:files/bombre.txt','(.*)',ConfigCompileRe,'Header and Data will be checked against the Regex. For example: IMG [^>]*src=[\'"]cid|
]*>(<[^>]+>|\n|\r)*]+>(<[^>]+>|\n|\r)*'],
+[bombRe,'Bomb Regular Expression*',80,textinput,'file:/etc/assp/bombre.txt','(.*)',ConfigCompileRe,'Header and Data will be checked against the Regex. For example: IMG [^>]*src=[\'"]cid|]*>(<[^>]+>|\n|\r)*]+>(<[^>]+>|\n|\r)*'],
[noBombScript,'Don\'t Check Messages from these Addresses*',60,textinput,'','(.*)',ConfigMakeRe,
'Don\'t detect spam bombs or scripts in messages from these addresses. Valid entry types are as per spamlovers.'],
@@ -916,7 +912,7 @@
[logfile,'ASSP Logfile',40,textinput,'logs/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. You have to restart the service before you get a pid file in the new location.
Notes On File Path
'],
[0,0,0,'heading','Collecting'],
[spamaddresses,'Spam Collect Addresses* ',60,textinput,'put|your@spambucket.com|addresses|@here.org','(.*)',ConfigMakeRe,
@@ -1070,11 +1066,11 @@
[0,0,0,'heading','Server Setup'],
[AsAService,'Run ASSP as a Windows Service**',0,checkbox,0,'([01]?)',undef,
'In Windows NT/2000/XP/2003 ASSP can be installed as a service. This setting tells ASSP that this has been done -- it does not install the Windows service for you. Installing ASSP as a service requires several steps which are detailed in the Quick Start for Win32 wiki page.','Basic'],
-[AsADaemon,'Run ASSP as a Daemon**',0,checkbox,0,'([01]?)',undef,
+[AsADaemon,'Run ASSP as a Daemon**',0,checkbox,1,'([01]?)',undef,
'In Linux/BSD/Unix/OSX fork and close file handles. Similar to the command "perl assp.pl &", but better.','Basic'],
-[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 (*nix only).
Examples: assp, nobody','Basic'],
-[runAsGroup,'Run as GID**',20,textinput,'','(\S*)',undef,
+[runAsGroup,'Run as GID**',20,textinput,'assp','(\S*)',undef,
'The *nix group to assume after startup (*nix only).
Examples: assp, nobody','Basic'],
[ChangeRoot,'Change Root**',40,textinput,'','(.*)',undef,
'The new root directory to which ASSP should chroot (*nix only). If blank, no chroot jail will be used. Note: if you use this feature, be sure to copy or link the etc/protocols file in your chroot jail.','Basic'],
@@ -1187,7 +1183,7 @@
}
}
# load configuration file
- open(F,"<$base/assp.cfg"); local $/; (%Config)=split(/:=|\n/,); close F;
+ open(F,"); close F;
# set nonexistent settings to default values
foreach $c (@Config) {
if ($c->[0] && !(exists $Config{$c->[0]})) {
@@ -1551,19 +1547,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');
@@ -1763,29 +1759,29 @@
switchUsers($uid,$gid) if ($runAsUser || $runAsGroup);
SaveConfig();
# create folders if they're missing
- -d "$base/$spamlog" or mkdir "$base/$spamlog",0700;
- -d "$base/$notspamlog" or mkdir "$base/$notspamlog",0700;
- -d "$base/$incomingOkMail" or mkdir "$base/$incomingOkMail",0700;
- -d "$base/$viruslog" or mkdir "$base/$viruslog",0700;
- -d "$base/files" or mkdir "$base/files",0777;
- -d "$base/logs" or mkdir "$base/logs",0777;
+ -d "/var/lib/assp/$spamlog" or mkdir "/var/lib/assp/$spamlog",0700;
+ -d "/var/lib/assp/$notspamlog" or mkdir "/var/lib/assp/$notspamlog",0700;
+ -d "/var/lib/assp/$incomingOkMail" or mkdir "/var/lib/assp/$incomingOkMail",0700;
+ -d "/var/lib/assp/$viruslog" or mkdir "/var/lib/assp/$viruslog",0700;
+ -d "/var/lib/assp/files" or mkdir "/var/lib/assp/files",0777;
+ -d "/var/lib/assp/logs" or mkdir "/var/lib/assp/logs",0777;
my $dir=$correctedspam;
$dir=~s/\/.*?$//;
- -d "$base/$dir" or mkdir "$base/$dir",0700;
- -d "$base/$correctedspam" or mkdir "$base/$correctedspam",0700;
- -d "$base/$correctednotspam" or mkdir "$base/$correctednotspam",0700;
+ -d "/var/lib/assp/$dir" or mkdir "/var/lib/assp/$dir",0700;
+ -d "/var/lib/assp/$correctedspam" or mkdir "/var/lib/assp/$correctedspam",0700;
+ -d "/var/lib/assp/$correctednotspam" or mkdir "/var/lib/assp/$correctednotspam",0700;
my $pbdir = $1 if $pbdb=~/(.*)\/.*/;
mkdir "$base/$pbdir",0700 if $pbdir;
- -d "$base/notes" or mkdir "$base/notes",0777;
- if ( !-e "$base/reports/whitereport.txt") {
- -d "$base/reports" or mkdir "$base/reports",0777;
- copy("whitereport.txt", "reports/whitereport.txt");
- copy("whiteremovereport.txt", "reports/whiteremovereport.txt");
- copy("redreport.txt", "reports/redreport.txt");
- copy("redremovereport.txt", "reports/redremovereport.txt");
- copy("helpreport.txt", "reports/helpreport.txt");
- copy("notspamreport.txt", "reports/notspamreport.txt");
- copy("spamreport.txt", "reports/spamreport.txt");
+ -d "/etc/assp/notes" or mkdir "$base/notes",0770;
+ if ( !-e "/etc/assp/reports/whitereport.txt") {
+ -d "/etc/assp/reports" or mkdir "/etc/assp/reports",0770;
+ copy("/usr/share/assp/whitereport.txt", "/etc/assp/reports/whitereport.txt");
+ copy("/usr/share/assp/whiteremovereport.txt", "/etc/assp/reports/whiteremovereport.txt");
+ copy("/usr/share/assp/redreport.txt", "/etc/assp/reports/redreport.txt");
+ copy("/usr/share/assp/redremovereport.txt", "/etc/assp/reports/redremovereport.txt");
+ copy("/usr/share/assp/helpreport.txt", "/etc/assp/reports/helpreport.txt");
+ copy("/usr/share/assp/notspamreport.txt", "/etc/assp/reports/notspamreport.txt");
+ copy("/usr/share/assp/spamreport.txt", "/etc/assp/reports/spamreport.txt");
}
@@ -2201,7 +2197,7 @@
# roll log every $LogRollDays days, at midnight
my $t=int((time()+Time::Local::timelocal(localtime())-Time::Local::timelocal(gmtime()))/($LogRollDays*24*3600));
- 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 $backt=time - 1800;
my ($sec,$min,$hour,$mday,$mon,$year) = localtime($backt);
@@ -2212,7 +2208,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";
@@ -2220,8 +2216,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();
}
@@ -4162,7 +4158,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
@@ -6329,8 +6325,8 @@
- ReturnMail($this->{mailfrom},"$base/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n") if ($EmailErrorsReply==1 || $EmailErrorsReply==3);
- ReturnMail($EmailErrorsTo,"$base/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ($EmailErrorsTo && ($EmailErrorsReply==2 || $EmailErrorsReply==3));
+ ReturnMail($this->{mailfrom},"/etc/assp/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n") if ($EmailErrorsReply==1 || $EmailErrorsReply==3);
+ ReturnMail($EmailErrorsTo,"/etc/assp/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ($EmailErrorsTo && ($EmailErrorsReply==2 || $EmailErrorsReply==3));
stateReset($fh);
$this->{getline}=\&getline;
@@ -6463,13 +6459,13 @@
if (($this->{reporttype}==2) || ($this->{reporttype}==3)) {
-ReturnMail($this->{mailfrom},"$base/$file",'',"$this->{rcpt}\n\n$this->{report}\n") if ($EmailWhitelistReply==1 || $EmailWhitelistReply==3);
+ReturnMail($this->{mailfrom},"/etc/assp/$file",'',"$this->{rcpt}\n\n$this->{report}\n") if ($EmailWhitelistReply==1 || $EmailWhitelistReply==3);
-ReturnMail($EmailWhitelistTo,"$base/$file",'',"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ( $EmailWhitelistTo && ($EmailWhitelistReply==2 || $EmailWhitelistReply==3));
+ReturnMail($EmailWhitelistTo,"/etc/assp/$file",'',"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ( $EmailWhitelistTo && ($EmailWhitelistReply==2 || $EmailWhitelistReply==3));
} else {
- ReturnMail($this->{mailfrom},"$base/$file",'',"$this->{rcpt}\n\n$this->{report}\n") if ($EmailRedlistReply==1 || $EmailRedlistReply==3);
+ ReturnMail($this->{mailfrom},"/etc/assp/$file",'',"$this->{rcpt}\n\n$this->{report}\n") if ($EmailRedlistReply==1 || $EmailRedlistReply==3);
-ReturnMail($EmailRedlistTo,"$base/$file",'',"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ( $EmailRedlistTo && ($EmailRedlistReply==2 || $EmailRedlistReply==3));
+ReturnMail($EmailRedlistTo,"/etc/assp/$file",'',"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ( $EmailRedlistTo && ($EmailRedlistReply==2 || $EmailRedlistReply==3));
}
delete $this->{report};
stateReset($fh);
@@ -6626,8 +6622,8 @@
my $file=($this->{reporttype}==0) ? "reports/spamreport.txt" : "reports/notspamreport.txt";
- ReturnMail($this->{mailfrom},"$base/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n") if ($EmailErrorsReply==1 || $EmailErrorsReply==3);
- ReturnMail($EmailErrorsTo,"$base/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ($EmailErrorsTo && ($EmailErrorsReply==2 || $EmailErrorsReply==3));
+ ReturnMail($this->{mailfrom},"/etc/assp/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n") if ($EmailErrorsReply==1 || $EmailErrorsReply==3);
+ ReturnMail($EmailErrorsTo,"/etc/assp/$file",$sub,"$this->{rcpt}\n\n$this->{report}\n",$this->{mailfrom}) if ($EmailErrorsTo && ($EmailErrorsReply==2 || $EmailErrorsReply==3));
delete $this->{report};
stateReset($fh);
@@ -7341,7 +7337,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) {
@@ -7743,7 +7739,7 @@
$Stats{rblfails}=0;
$Stats{uriblfails}=0;
- open(F,"<$base/asspstats.sav");
+ open(F,");
close F;
# conversion from previous versions
@@ -7781,7 +7777,7 @@
}
}
$AllStats{starttime}=$OldStats{starttime} || $Stats{starttime};
- open(F,">$base/asspstats.sav");
+ open(F,">/var/lib/assp/asspstats.sav");
print F join("\001",%AllStats);
close F;
}
@@ -7803,10 +7799,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";
}
}
@@ -8935,12 +8931,12 @@
if($1 eq 'R') {
$qs{list}="red"; # update radios
$RedlistObject->flush() if $RedlistObject && $redlistdb !~ /mysql/;
- open(F,"<$base/$redlistdb");
+ open(F,"<$redlistdb");
$s.='
Redlist
';
} else {
$qs{list}="white"; # update radios
$WhitelistObject->flush() if $WhitelistObject && $whitelistdb !~ /mysql/;
- open(F,"<$base/$whitelistdb") if $whitelistdb !~ /mysql/;
+ open(F,"<$whitelistdb") if $whitelistdb !~ /mysql/;
$s.='
Whitelist
';
if ($whitelistdb =~ /mysql/) {
$s.='
mysql
';
@@ -9252,7 +9248,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=;
@@ -9272,7 +9268,7 @@
my $lines=0;
my $files=0;
my ($logdir, $logdirfile) = $logfile=~/^(.*[\/\\])?(.*?)$/;
- my @logfiles=reverse sort glob("$base/$logdir*$logdirfile");
+ my @logfiles=reverse sort glob("/var/lib/assp/$logdir*$logdirfile");
my $logf=File::ReadBackwards->new(shift(@logfiles),'(?:\r?\n|\r)',1); # line terminator regex
if ($logf) {
$files++;
@@ -9314,7 +9310,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) {
@@ -9481,7 +9477,7 @@
else {
#$fil="$base/$fil" if $fil!~/^(([a-z]:)?[\/\\]|\Q$base\E)/;
- $fil="$base/$fil" if $fil!~/^\Q$base\E/i;
+ $fil="/var/lib/assp/$fil" if $fil!~/^\Q\/var\/lib\/assp\/\E/i;
if ($qs{B1}=~/delete/i) {
unlink($fil);
}
@@ -9495,7 +9491,7 @@
$s2='
File saved successfully
';
}
}
- if(open(F,"<$fil")) {
+ if(open(F,";
# make line terminators uniform
@@ -9706,8 +9702,8 @@
EOT
}
- if ($fil !~ /^\Q$base\E/i) {
- $fil="$base/$fil";
+ if ($fil !~ /^\Q\/etc\/assp\/\E/i) {
+ $fil="/usr/share/assp/$fil";
}
if (-e $fil) {
my $mtime;
@@ -10032,12 +10028,12 @@
}
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;
- chmod(0666,"$base/assp.cfg");
+ chmod(0666,"/etc/assp/assp.cfg");
PrintConfigSettings();
}
sub backupFile {
@@ -10045,9 +10041,9 @@
my $f=shift;
my $bf=$f; $bf=~s/.*[\\\/]|/bak\//;
my $i=$BackupCopies-1;
- unlink("$base/$bf.$i");
+ unlink("/etc/assp/$bf.$i");
for (; $i>0; $i--) { rename("$base/$bf.".($i-1),"$base/$bf.$i"); }
- rename($f,"$base/$bf.0");
+ rename($f,"/etc/assp/$bf.0");
}
sub textinput {my ($name,$nicename,$size,$func,$default,$valid,$onchange,$description,$cssoption)=@_;
@@ -10145,7 +10141,7 @@
}
sub PrintConfigSettings {
- open(F,">$base/changeddefaults.txt");
+ open(F,">/var/lib/assp/changeddefaults.txt");
foreach $c (@Config) {
print F "S e c t i o n: $c->[4] \n" if $c->[0] eq "0";
next if $c->[0] eq "0";
@@ -10159,8 +10155,8 @@
print F "$c->[0] -- $desc: $Config{$c->[0]} \n";
}}
close F;
- chmod(0666,"$base/changeddefaults.txt");
- open(F,">$base/description.txt");
+ chmod(0666,"/var/lib/assp/changeddefaults.txt");
+ open(F,">/var/lib/assp/description.txt");
foreach $c (@Config) {
$desc=$c->[7];
$desc=~ s/\<.*\>//g;
@@ -10174,7 +10170,7 @@
}
close F;
- chmod(0666,"$base/description.txt");
+ chmod(0666,"/var/lib/assp/description.txt");
}
# This function is called on startup to clean up some settings
# Primarily these are settings that might be absent from assp.cfg
@@ -10269,7 +10265,7 @@
if ($value=~/^ *file: *(.+)/i) {
# the option list is actually saved in a file.
$fromfile=1;
- my $fil=$1; $fil="$base/$fil" if $fil!~/^\Q$base\E/i;
+ my $fil=$1; $fil="$base/$fil" if $fil!~/^\Q\/etc\/assp\/\E/i;
local $/;
my @s=stat($fil);
my $mtime=$s[9];
@@ -10317,7 +10313,7 @@
sub fileUpdated {
my $fil=shift;
- $fil="$base/$fil" if $fil!~/^(([a-z]:)?[\/\\]|\Q$base\E)/;
+ $fil="$base/$fil" if $fil!~/^(([a-z]:)?[\/\\]|\Q\/etc\/assp\/\E)/;
#$fil="$base/$fil" if $fil!~/^\Q$base\E/i;
return 1 unless $FileUpdate{$fil};
my @s=stat($fil);
@@ -10428,7 +10424,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");
'';
}
@@ -10933,7 +10929,7 @@
# called on SIG HUP
my %newConfig;
mlog(0,"sig HUP -- reloading config");
-open(F,"<$base/assp.cfg"); local $/; (%newConfig)=split(/:=|\n/,); close F;
+open(F,"); close F;
foreach $c (@Config) {
my ($name,$nicename,$size,$func,$default,$valid,$onchange,$description)=@$c;
if($Config{$name} ne $newConfig{$name}) {
@@ -10961,7 +10957,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 assp_org/ASSP/move2num.pl assp_patched/ASSP/move2num.pl
--- assp_org/ASSP/move2num.pl 2005-06-27 04:05:34.000000000 -0600
+++ assp_patched/ASSP/move2num.pl 2007-06-16 09:46:39.000000000 -0600
@@ -3,7 +3,7 @@
# renames files to numbers
# (c) John Hanna, John Calvi 2003 under the terms of the GPL
-open(F,"); close F;
+open(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 assp_org/ASSP/rebuildspamdb.pl assp_patched/ASSP/rebuildspamdb.pl
--- assp_org/ASSP/rebuildspamdb.pl 2007-05-04 12:52:26.000000000 -0600
+++ assp_patched/ASSP/rebuildspamdb.pl 2007-06-16 09:50:21.000000000 -0600
@@ -4,7 +4,7 @@
# (c) John Hanna 2003 under the terms of the GPL
# Updated July 2004 for simple proxy support.
-open(F,"); close F;
+open(F,"); close F;
$spamlog=$Config{spamlog} && "$Config{base}/$Config{spamlog}" || 'spam';
$notspamlog=$Config{notspamlog} && "$Config{base}/$Config{notspamlog}" || 'notspam';
@@ -14,7 +14,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 assp_org/ASSP/stats.sh assp_patched/ASSP/stats.sh
--- assp_org/ASSP/stats.sh 2005-01-01 05:58:26.000000000 -0700
+++ assp_patched/ASSP/stats.sh 2007-06-16 09:51:25.000000000 -0600
@@ -52,7 +52,8 @@
# 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", \