diff options
Diffstat (limited to 'mail/assp')
-rw-r--r-- | mail/assp/Makefile | 140 | ||||
-rw-r--r-- | mail/assp/distinfo | 6 | ||||
-rw-r--r-- | mail/assp/files/510.assp.in | 25 | ||||
-rw-r--r-- | mail/assp/files/assp.8.in | 3 | ||||
-rw-r--r-- | mail/assp/files/assplog.8.in | 90 | ||||
-rw-r--r-- | mail/assp/files/assplog.pl.in | 184 | ||||
-rw-r--r-- | mail/assp/files/extra-patch-assp.pl+SSL | 159 | ||||
-rw-r--r-- | mail/assp/files/patch-assp.pl | 36 | ||||
-rw-r--r-- | mail/assp/files/patch-stats.sh | 442 | ||||
-rw-r--r-- | mail/assp/files/periodic-assp.sh.in | 25 | ||||
-rw-r--r-- | mail/assp/files/pkg-install.in | 8 | ||||
-rw-r--r-- | mail/assp/pkg-descr | 8 | ||||
-rw-r--r-- | mail/assp/pkg-plist | 96 |
13 files changed, 367 insertions, 855 deletions
diff --git a/mail/assp/Makefile b/mail/assp/Makefile index 61a2a538fe2c..90ef226bb82b 100644 --- a/mail/assp/Makefile +++ b/mail/assp/Makefile @@ -6,8 +6,7 @@ # PORTNAME= assp -PORTVERSION= 1.4.3.1 -PORTREVISION= 1 +PORTVERSION= 1.5.1.2 CATEGORIES= mail MASTER_SITES= SF DISTNAME= ${PORTNAME:U}_${PORTVERSION}-Install @@ -19,58 +18,41 @@ USE_ZIP= yes NO_BUILD= yes USE_PERL5_RUN= yes -USE_DOS2UNIX= \ - ../changelog.txt \ - addservice.pl \ - assp.pl \ - files/URIBLCCTLDS.txt \ - files/bombre.txt \ - files/invalidptr.txt \ - files/ipnp.txt \ - files/nodelay.txt \ - files/redre.txt \ - images/assp.css \ - images/editor.css \ - images/shutdown.css \ - move2num.pl \ - rc/readme.txt \ - rebuildspamdb.pl \ - reports/helpreport.txt \ - reports/notspamreport.txt \ - reports/redremovereport.txt \ - reports/redreport.txt \ - reports/spamreport.txt \ - reports/whiteremovereport.txt \ - reports/whitereport.txt \ - stat.pl \ - stats.sh - MAN8= assp.8 assplog.8 -ASSP_USER= nobody -ASSP_GROUP= nobody +ASSP_USER= assp +ASSP_GROUP= assp +ASSP_UID= 587 +ASSP_GID= 587 ASSP_HOME= /var/db/assp +ASSP_LOG= /var/log/assp -PLIST_SUB= ASSP_HOME="${ASSP_HOME}" +PLIST_SUB= ASSP_HOME="${ASSP_HOME}" ASSP_LOG="${ASSP_LOG}" -SUB_FILES= assp.8 assplog.8 periodic-assp.sh pkg-install -SUB_LIST= ASSP_HOME="${ASSP_HOME}" ASSP_USER="${ASSP_USER}" \ - ASSP_GROUP="${ASSP_GROUP}" PERL="${PERL}" +SUB_FILES= assp.8 assplog.8 assplog.pl periodic-assp.sh +SUB_LIST= ASSP_USER="${ASSP_USER}" ASSP_GROUP="${ASSP_GROUP}" \ + ASSP_HOME="${ASSP_HOME}" ASSP_LOG="${ASSP_LOG}" \ + DATADIR="${DATADIR}" PERL="${PERL}" USE_RC_SUBR= ${PORTNAME} RC_SCRIPT= ${PREFIX}/etc/rc.d/${PORTNAME} OPTIONS= EMVALID "RFC822 recipient address validator" on \ - LDAP "LDAP validation of recipient addresses" on \ + LDAP "LDAP validation of recipient addresses" off \ SPF "SPF validation of client IP" on \ SRS "Sender Rewriting Scheme" on \ + SEND "Resending .eml files" on \ FBACKW "File Reading Backwards" on \ ZLIB "HTTP Header Compression on Admin Interface" on \ CLAMAV "ClamAV virus scanner" on \ DNSBL "DNS block list checking" on \ MYSQL "Use MySQL db to store white/red/delaylists" off \ + MATCHRE "Match IP ranges and CIDR blocks in lists" on \ SIMPLE "Use procedural Web Page interfaces" on \ - SSL "SSL secure sockets support" on + SENDERB "Country Code checks" on \ + MIMEMOD "Multiple Attachement detection" on \ + SSL "SSL secure sockets support" on \ + IPV6 "IPv6 sockets support" on WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}/${DISTNAME}/${PORTNAME:U} @@ -88,13 +70,17 @@ RUN_DEPENDS+= ${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap .if !defined(WITHOUT_SPF) RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS -RUN_DEPENDS+= ${SITE_PERL}/Mail/SPF/Query.pm:${PORTSDIR}/mail/p5-Mail-SPF-Query +RUN_DEPENDS+= ${SITE_PERL}/Mail/SPF.pm:${PORTSDIR}/mail/p5-Mail-SPF .endif .if !defined(WITHOUT_SRS) RUN_DEPENDS+= ${SITE_PERL}/Mail/SRS.pm:${PORTSDIR}/mail/p5-Mail-SRS .endif +.if !defined(WITHOUT_SEND) +RUN_DEPENDS+= ${SITE_PERL}/Email/Send.pm:${PORTSDIR}/mail/p5-Email-Send +.endif + .if !defined(WITHOUT_FBACKW) RUN_DEPENDS+= ${SITE_PERL}/File/ReadBackwards.pm:${PORTSDIR}/devel/p5-File-ReadBackwards .endif @@ -118,41 +104,84 @@ RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS RUN_DEPENDS+= ${SITE_PERL}/Tie/RDBM.pm:${PORTSDIR}/databases/p5-Tie-DBI .endif +.if !defined(WITHOUT_MATCHRE) +RUN_DEPENDS+= ${SITE_PERL}/Net/IP/Match/Regexp.pm:${PORTSDIR}/net-mgmt/p5-Net-IP-Match-Regexp +.endif + .if !defined(WITHOUT_SIMPLE) RUN_DEPENDS+= ${SITE_PERL}/LWP/Simple.pm:${PORTSDIR}/www/p5-libwww .endif +.if !defined(WITHOUT_SENDERB) +RUN_DEPENDS+= ${SITE_PERL}/Net/SenderBase.pm:${PORTSDIR}/mail/p5-Net-SenderBase +.endif + +.if !defined(WITHOUT_MIMEMOD) +RUN_DEPENDS+= ${SITE_PERL}/Email/MIME/Modifier.pm:${PORTSDIR}/mail/p5-Email-MIME-Modifier +.endif + .if !defined(WITHOUT_SSL) RUN_DEPENDS+= ${SITE_PERL}/IO/Socket/SSL.pm:${PORTSDIR}/security/p5-IO-Socket-SSL -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-assp.pl+SSL +.endif + +.if !defined(WITHOUT_IPV6) +RUN_DEPENDS+= ${SITE_PERL}/IO/Socket/INET6.pm:${PORTSDIR}/net/p5-IO-INET6 .endif EXTRACT_AFTER_ARGS= -d ${PORTNAME}-${PORTVERSION} +post-extract: + @echo "===> Removing incorrect group/other write permissions" + @${FIND} ${WRKDIR}/${PORTNAME}-${PORTVERSION} -type d -exec ${CHMOD} go-w {} \; + @${FIND} ${WRKDIR}/${PORTNAME}-${PORTVERSION} -type f -exec ${CHMOD} a-wx {} \; + post-patch: @${REINPLACE_CMD} -e 's|/usr/bin/perl|${PERL}|' ${WRKSRC}/*.pl +pre-install: + if ! /usr/sbin/pw groupshow ${ASSP_GROUP}; then \ + /usr/sbin/pw groupadd ${ASSP_GROUP} -g ${ASSP_GID}; \ + else \ + ${ECHO_CMD} "Using exsing ${ASSP_GROUP} group"; \ + fi; \ + if ! /usr/sbin/pw usershow ${ASSP_USER}; then \ + /usr/sbin/pw useradd ${ASSP_USER} -g ${ASSP_GROUP} -u ${ASSP_UID} -h - -d ${ASSP_HOME} -s /usr/sbin/nologin -c "ASSP Anti-Spam Proxy"; \ + else \ + ${ECHO_CMD} "Using exsing ${ASSP_USER} user"; \ + fi + do-install: - ${MKDIR} ${PREFIX}/lib/assp - ${INSTALL_SCRIPT} ${WRKSRC}/addservice.pl ${PREFIX}/lib/assp - ${INSTALL_SCRIPT} ${WRKSRC}/assp.pl ${PREFIX}/lib/assp - ${INSTALL_SCRIPT} ${WRKSRC}/move2num.pl ${PREFIX}/lib/assp - ${INSTALL_SCRIPT} ${WRKSRC}/rebuildspamdb.pl ${PREFIX}/lib/assp - ${INSTALL_SCRIPT} ${WRKSRC}/stat.pl ${PREFIX}/lib/assp - ${INSTALL_SCRIPT} ${WRKSRC}/stats.sh ${PREFIX}/lib/assp - ${MKDIR} ${PREFIX}/lib/assp/files - ${INSTALL_DATA} ${WRKSRC}/files/* ${PREFIX}/lib/assp/files - ${MKDIR} ${PREFIX}/lib/assp/reports - ${INSTALL_DATA} ${WRKSRC}/reports/* ${PREFIX}/lib/assp/reports - ${MKDIR} ${PREFIX}/lib/assp/images - ${INSTALL_DATA} ${WRKSRC}/images/* ${PREFIX}/lib/assp/images - - ${LN} -s ${PREFIX}/lib/assp/assp.pl ${PREFIX}/sbin/assp - ${LN} -s ${PREFIX}/lib/assp/stats.sh ${PREFIX}/sbin/assplog + ${MKDIR} ${DATADIR} + ${INSTALL_SCRIPT} ${WRKSRC}/assp.pl ${DATADIR} + ${INSTALL_SCRIPT} ${WRKSRC}/move2num.pl ${DATADIR} + ${INSTALL_SCRIPT} ${WRKSRC}/rebuildspamdb.pl ${DATADIR} + ${INSTALL_SCRIPT} ${WRKSRC}/stat.pl ${DATADIR} + ${MKDIR} ${DATADIR}/files + ${INSTALL_DATA} ${WRKSRC}/files/* ${DATADIR}/files + ${MKDIR} ${DATADIR}/images + ${INSTALL_DATA} ${WRKSRC}/images/* ${DATADIR}/images + ${MKDIR} ${DATADIR}/reports + ${INSTALL_DATA} ${WRKSRC}/reports/* ${DATADIR}/reports + + ${LN} -s ${DATADIR}/assp.pl ${PREFIX}/sbin/assp + + ${INSTALL_SCRIPT} ${WRKDIR}/assplog.pl ${PREFIX}/sbin/assplog ${INSTALL_MAN} ${WRKDIR}/assp.8 ${MAN8PREFIX}/man/man8 ${INSTALL_MAN} ${WRKDIR}/assplog.8 ${MAN8PREFIX}/man/man8 + ${MKDIR} ${ASSP_LOG} + ${CHOWN} ${ASSP_USER}:${ASSP_GROUP} ${ASSP_LOG} + ${CHMOD} 750 ${ASSP_LOG} + + ${MKDIR} ${ASSP_HOME} + ${CHOWN} ${ASSP_USER}:${ASSP_GROUP} ${ASSP_HOME} + ${CHMOD} 700 ${ASSP_HOME} + ${LN} -s ${DATADIR}/files ${ASSP_HOME} + ${LN} -s ${DATADIR}/images ${ASSP_HOME} + ${LN} -s ${DATADIR}/reports ${ASSP_HOME} + ${LN} -s ${ASSP_LOG} ${ASSP_HOME}/log + ${MKDIR} ${PREFIX}/etc/periodic/daily ${INSTALL_SCRIPT} ${WRKDIR}/periodic-assp.sh ${PREFIX}/etc/periodic/daily/510.assp @@ -161,7 +190,4 @@ do-install: ${INSTALL_DATA} ${WRKSRC}/docs/*.htm ${DOCSDIR} .endif -post-install: - @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL - .include <bsd.port.post.mk> diff --git a/mail/assp/distinfo b/mail/assp/distinfo index 470471ef45dc..3f28218d656d 100644 --- a/mail/assp/distinfo +++ b/mail/assp/distinfo @@ -1,3 +1,3 @@ -MD5 (ASSP_1.4.3.1-Install.zip) = 95191c8a081601a5b80557ad606d867a -SHA256 (ASSP_1.4.3.1-Install.zip) = 09331ad8ec7fddb381d4898ef0ed51990a01ce115a47c4b2a8c7a601f800c263 -SIZE (ASSP_1.4.3.1-Install.zip) = 414570 +MD5 (ASSP_1.5.1.2-Install.zip) = ca2dd0e5fed6278e4ad50926dd1ba378 +SHA256 (ASSP_1.5.1.2-Install.zip) = 418adfcf987231707be3ce149e48fbab4b9c741d807c59392ecf5fe338aa58bb +SIZE (ASSP_1.5.1.2-Install.zip) = 488068 diff --git a/mail/assp/files/510.assp.in b/mail/assp/files/510.assp.in index c6f970e70c51..0bce9032d2d3 100644 --- a/mail/assp/files/510.assp.in +++ b/mail/assp/files/510.assp.in @@ -2,30 +2,19 @@ # # $FreeBSD$ # -# Update ASSP Spam and ClamAV databases +# Run ASSP's nightly housekeeping script, rebuildspamdb.pl +# Delete old ASSP log files cd %%ASSP_HOME%% -if [ ! -f %%PREFIX%%/lib/assp/rebuildspamdb.pl ] +if [ ! -f %%DATADIR%%/rebuildspamdb.pl ] then - echo "%%PREFIX%%/lib/assp/rebuildspamdb.pl does not exist" + echo "%%DATADIR%%/rebuildspamdb.pl does not exist" rc_spamdb=2 else echo "" echo "Running ASSP rebuildspamdb.pl:" - %%PERL%% %%PREFIX%%/lib/assp/rebuildspamdb.pl && rc_spamdb=0 || rc_spamdb=3 -fi - -if [ ! -f %%PREFIX%%/lib/assp/freshclam.sh ] -then - # existence of freshclam.sh is optional, dependent - # on the WITH_CLAMAV setting, so not an error if not there - rc_clamav=0 -else - echo "" - echo "Fetching ASSP ClamAV virus database updates:" - export PATH=$PATH:%%LOCALBASE%%/bin - sh %%PREFIX%%/lib/assp/freshclam.sh && rc_clamav=0 || rc_clamav=3 + %%PERL%% %%DATADIR%%/rebuildspamdb.pl && rc_spamdb=0 || rc_spamdb=3 fi . %%RC_SUBR%% @@ -36,6 +25,6 @@ load_rc_config $name echo "" echo "Removing old ASSP log files:" -find . -name '*.maillog.txt' -mtime +$assp_logexpire -exec ls -l {} \; -exec rm {} \; +find -L . -name '*.maillog.txt' -mtime +$assp_logexpire -exec ls -l {} \; -exec rm {} \; -exit $(($rc_spamdb|$rc_clamav)) +exit $rc_spamdb diff --git a/mail/assp/files/assp.8.in b/mail/assp/files/assp.8.in index e93b7c28a79c..d90f8956dbee 100644 --- a/mail/assp/files/assp.8.in +++ b/mail/assp/files/assp.8.in @@ -271,9 +271,6 @@ nightly script to invoke .I rebuildspamdb.pl and .IR freshclam.sh . -.SH BUGS -.I ASSP -currently has no IPv6 support. .SH "SEE ALSO" .IR procmail (1), .IR assplog (8), diff --git a/mail/assp/files/assplog.8.in b/mail/assp/files/assplog.8.in index 4806d3049636..6828faecf80a 100644 --- a/mail/assp/files/assplog.8.in +++ b/mail/assp/files/assplog.8.in @@ -1,6 +1,6 @@ .TH assplog 8 "May 16, 2005" "" "ASSP" .SH NAME -assplog \- display colorized ASSP log +assplog \- ASSP log pretty-printer .SH SYNOPSIS assplog .SH DESCRIPTION @@ -8,7 +8,14 @@ assplog uses .B "tail -f" to monitor the ASSP Anti-Spam SMTP Proxy log and then displays -logged messages using ANSI color sequences for easy reading. +logged messages using ANSI color sequences and reformatted to +a consistent layout for easy reading. +.PP +.I assplog +works best on terminal windows of around 120 columns or wider. +It also assumes a black background as whitelisted messages are +displayed colored white. If you normally use a white background, +use Ctrl-MiddleButton and select Enable Reverse Video. .PP The colors have the following meaning: .PP @@ -25,6 +32,9 @@ Message passed all checks and was delivered 2. Messages that were blocked .RS .TP +Cyan +Message was delayed (sending MTA should retry later) +.TP Blue Recipient unknown (failed flat list or LDAP check) .TP @@ -38,86 +48,18 @@ Message failed Bayesian spam check 3. Administrative messages .RS .TP -Cyan -Message to assp{notspam,spam,white}@ address -.TP Yellow Admin change from web interface .TP Grey -Messages about ASSP's operation +Messages about ASSP's operation, including messages to +assp{notspam,spam,white}@ address .RE -.PP -Entries from the log are reformatted to a consistent format and -classified with one of the following tags: -.TP -BA -Bad attachement rejected -.TP -BL -DNSBL check failed -.TP -BS -Bayesian spam check failed -.TP -DL -Message from unknown sender delayed, sender requested to retry later -.TP -EM -message to ASSP's email interface (e.g., spam/notspam report, redlist addition) -.TP -HL -Bad HELO greeting -.TP -IO -Invalid sender for internal recipient - internal-only recipient -.TP -IR -Invalid recipient, failed LDAP or flat list test -.TP -IS -Invalid sender -.TP -LW -Local or Whitelisted emails -.TP -MA -Malformed RFC822 recipient address -.TP -ME -Maximum number of other errors exceeded -.TP -NP -Email that passed without being processed -.TP -OK -Email that fully passed all tests -.TP -PB -Penalty Box counter was incremented -.TP -RB -Blocked Relay attempt -.TP -SP -SPF check failed -.TP -VI -Virus detected -.TP -W+ -Whitelist addition by local user -.TP -W- -Whitelist deletion by local user -.TP -WC -Whitelist addition of address CC'd in whitelisted email .SH BUGS Note that .I assplog -suppresses many of the messages in the log (those that appear -to duplicate information in other messages). +suppresses some of the message lines from the in actual log (those that report +penalty scoring and some socket level information, for example). Unknown/new log messages are not colorized. FOR A COMPLETE AND ACCURATE VIEW OF THE LOG, USE diff --git a/mail/assp/files/assplog.pl.in b/mail/assp/files/assplog.pl.in new file mode 100644 index 000000000000..3cd8ec8225f0 --- /dev/null +++ b/mail/assp/files/assplog.pl.in @@ -0,0 +1,184 @@ +#!%%PREFIX%%/bin/perl +# assplog.pl +# ASSP log pretty-printer +# + +# xterm foreground color codes +$black = "30"; +$red = "31"; +$green = "32"; +$yellow = "33"; +$blue = "34"; +$magenta = "35"; +$cyan = "36"; +$white = "37"; + +$columns = $ENV{"COLUMNS"}; +$columns = 120 if (!$columns || $columns < 120); + +$lines = $ENV{"LINES"}; +$lines = 50 if (!$lines); + +if (!open (LOG, "tail -500f %%ASSP_LOG%%/maillog.txt |")) { + print STDERR "assplog: cannot open ASSP log\n"; + exit(1); +} + +$ipwide = 0; +while (<LOG>) { + chop; + undef $l; + ($l->{date}, $l->{time}, $l->{rest}) = split(/\s+/, $_, 3); + $patt = ".*[0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9]"; + if ($l->{rest} =~ m,^($patt)\s,) { + ($l->{msgid}, $l->{rest}) = $l->{rest} =~ m,^($patt)\s+(.*)$,; + } + $patt = "\\[[^]]+]"; + if ($l->{rest} =~ m,^($patt)\s,) { + ($l->{code}, $l->{rest}) = $l->{rest} =~ m,^($patt)\s+(.*)$,; + } + $patt = "[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+|(:?[0-9a-fA-F]*){0,7}:[0-9a-fA-F]+"; + if ($l->{rest} =~ m,^($patt)\s,) { + ($l->{cliIP}, $x, $l->{rest}) = $l->{rest} =~ m,^($patt)\s+(.*)$,; + } + $patt = "<([^@>]+@[^@>]+)?>"; + if ($l->{rest} =~ m,^($patt)\s,) { + ($l->{sender}, $x, $l->{rest}) = $l->{rest} =~ m,^($patt)\s+(.*)$,; + } + $l->{code} = "[BlockReport]" if ($l->{rest} =~ /blocked email report/); + $l->{code} = "[Connection]" if ($l->{rest} =~ /Connection idle for [0-9]+ secs - timeout/); + $l->{code} = "[DenyStrict]" if ($l->{rest} =~ /denied by denySMTPConnections strict:/); + $l->{code} = "[SenderBaseErr]" if ($l->{rest} =~ / Foreign Country/); + $l->{code} = "[SpamReport]" if ($l->{rest} =~ /^(H|Sp)am-Report:|email: (sp|h)amreport/); + $l->{code} = "[MaxErrors]" if ($l->{rest} =~ /max errors \([0-9]+\) exceeded -- dropping connection/); + $l->{code} = "[Connection]" if ($l->{rest} =~ /no recipients left -- dropping connection/); + $l->{code} = "[Connection]" if ($l->{rest} =~ /not delayed /); + $l->{code} = "[RWL]" if ($l->{rest} =~ /Received-RWL: whitelisted from/); + $l->{code} = "[Delayed]" if ($l->{rest} =~ /recipient delayed:/); + $l->{code} = "[SPF]" if ($l->{rest} =~ /Regex:SPFstrict/); + $l->{code} = "[SenderBase]" if ($l->{rest} =~ / Regex:WhiteOrg/); + $l->{code} = "[SenderBaseInfo]" if ($l->{rest} =~ /SenderBase Info/); + $l->{code} = "[Connection]" if ($l->{rest} =~ /\[SMTP Status]/); + $l->{code} = "[SenderBase]" if ($l->{rest} =~ /White Organization\/Domain in SenderBase:/); + $l->{code} = "[WhiteAddition]" if ($l->{rest} =~ /whitelist addition/); + $l->{code} = "[WhiteDeletion]" if ($l->{rest} =~ /whitelist deletion/); + if ($l->{code}) { + next if ($l->{code} =~ /\[SMTP Error]/); + next if ($l->{code} =~ /\[SMTP Reply]/); + next if ($l->{code} =~ /\[spam found]/); + $l->{color} = $magenta if ($l->{code} =~ /\[Attachment]/); + $l->{color} = $magenta if ($l->{code} =~ /\[Backscatter]/); + $l->{color} = $red if ($l->{code} =~ /\[Bayesian]/); + $l->{color} = $magenta if ($l->{code} =~ /\[BlackDomain]/); + $l->{color} = $magenta if ($l->{code} =~ /\[BlackHELO]/); + $l->{color} = $white if ($l->{code} =~ /\[BlockReport]/); + $l->{color} = $magenta if ($l->{code} =~ /\[BombBlack]/); + $l->{color} = $magenta if ($l->{code} =~ /\[BombData]/); + $l->{color} = $magenta if ($l->{code} =~ /\[BombHeader]/); + $l->{color} = $magenta if ($l->{code} =~ /\[BombRaw]/); + $l->{color} = $magenta if ($l->{code} =~ /\[BombScript]/); + $l->{color} = $magenta if ($l->{code} =~ /\[BombSender]/); + $l->{color} = $magenta if ($l->{code} =~ /\[BounceAddress]/); + $l->{color} = $magenta if ($l->{code} =~ /\[Collect]/); + $l->{color} = $black if ($l->{code} =~ /\[Connection]/); + $l->{color} = $magenta if ($l->{code} =~ /\[CountryCode]/); + $l->{color} = $cyan if ($l->{code} =~ /\[Delayed]/); + $l->{color} = $magenta if ($l->{code} =~ /\[DenyIP]/); + $l->{color} = $magenta if ($l->{code} =~ /\[DenyStrict]/); + $l->{color} = $magenta if ($l->{code} =~ /\[DNSBL]/); + $l->{color} = $magenta if ($l->{code} =~ /\[Extreme]/); + $l->{color} = $magenta if ($l->{code} =~ /\[ForgedHELO]/); + $l->{color} = $magenta if ($l->{code} =~ /\[ForgedLocalSender]/); + $l->{color} = $magenta if ($l->{code} =~ /\[FromMissing]/); + $l->{color} = $magenta if ($l->{code} =~ /\[History]/); + $l->{color} = $magenta if ($l->{code} =~ /\[InternalAddress]/); + $l->{color} = $blue if ($l->{code} =~ /\[InvalidAddress]/); + $l->{color} = $magenta if ($l->{code} =~ /\[InvalidHELO]/); + $l->{color} = $magenta if ($l->{code} =~ /\[IPfrequency]/); + $l->{color} = $magenta if ($l->{code} =~ /\[IPperDomain]/); + $l->{color} = $white if ($l->{code} =~ /\[Local]/); + $l->{color} = $magenta if ($l->{code} =~ /\[MalformedAddress]/); + $l->{color} = $magenta if ($l->{code} =~ /\[MaxErrors]/); + $l->{color} = $green if ($l->{code} =~ /\[MessageOK]/); + $l->{color} = $magenta if ($l->{code} =~ /\[MessageScore]/); + $l->{color} = $magenta if ($l->{code} =~ /\[MissingMX]/); + $l->{color} = $magenta if ($l->{code} =~ /\[MsgID]/); + $l->{color} = $green if ($l->{code} =~ /\[NoProcessing]/); + $l->{color} = $magenta if ($l->{code} =~ /\[Organization]/); + $l->{color} = $magenta if ($l->{code} =~ /\[OversizedHeader]/); + $l->{color} = $magenta if ($l->{code} =~ /\[PenaltyBox]/); + $l->{color} = $magenta if ($l->{code} =~ /\[Penalty]/); + $l->{color} = $magenta if ($l->{code} =~ /\[PTRinvalid]/); + $l->{color} = $magenta if ($l->{code} =~ /\[PTRmissing]/); + $l->{color} = $magenta if ($l->{code} =~ /\[RelayAttempt]/); + $l->{color} = $green if ($l->{code} =~ /\[RWL]/); + $l->{color} = $green if ($l->{code} =~ /\[SenderBase]/); + $l->{color} = $magenta if ($l->{code} =~ /\[SenderBaseErr]/); + $l->{color} = $black if ($l->{code} =~ /\[SenderBaseInfo]/); + $l->{color} = $black if ($l->{code} =~ /\[SpamReport]/); + $l->{color} = $magenta if ($l->{code} =~ /\[SPF]/); + $l->{color} = $magenta if ($l->{code} =~ /\[SpoofedSender]/); + $l->{color} = $magenta if ($l->{code} =~ /\[SRS]/); + $l->{color} = $magenta if ($l->{code} =~ /\[SuspiciousHelo]/); + $l->{color} = $magenta if ($l->{code} =~ /\[Trap]/); + $l->{color} = $magenta if ($l->{code} =~ /\[URIBL]/); + $l->{color} = $magenta if ($l->{code} =~ /\[VIRUS]/); + $l->{color} = $magenta if ($l->{code} =~ /\[ValidHELO]/); + $l->{color} = $white if ($l->{code} =~ /\[WhiteAddition]/); + $l->{color} = $white if ($l->{code} =~ /\[WhiteDeletion]/); + $l->{color} = $white if ($l->{code} =~ /\[Whitelisted]/); + $l->{color} = $magenta if ($l->{code} =~ /\[WhitelistOnly]/); + $ipwide-- if ($ipwide == 2 && $lines2 > $lines-1); + $ipwide-- if ($ipwide == 1 && $lines1 > $lines-1); + if ($l->{cliIP} =~ /:/ && length($l->{cliIP}) > 20) { + $ipwide = 2 if ($ipwide < 2); + $lines2 = 0; + } + elsif ($l->{cliIP} =~ /:/) { + $ipwide = 1 if ($ipwide < 1); + $lines1 = 0; + } + if ($ipwide == 2) { + $cols = $columns - 9 - 1 - 8 - 1 - 39 - 1 - 18 - 1 - 28 - 1; + printf "$l->{date} $l->{time} \033[1;$l->{color}m%-39s %-18s %-28.28s %-${cols}.${cols}s\033[0m\n", $l->{cliIP}, $l->{code}, $l->{sender}, $l->{rest}; + } + elsif ($ipwide == 1) { + $cols = $columns - 9 - 1 - 8 - 1 - 20 - 1 - 18 - 1 - 28 - 1; + printf "$l->{date} $l->{time} \033[1;$l->{color}m%-20s %-18s %-28.28s %-${cols}.${cols}s\033[0m\n", $l->{cliIP}, $l->{code}, $l->{sender}, $l->{rest}; + } + else { + $cols = $columns - 9 - 1 - 8 - 1 - 15 - 1 - 18 - 1 - 28 - 1; + printf "$l->{date} $l->{time} \033[1;$l->{color}m%-15s %-18s %-28.28s %-${cols}.${cols}s\033[0m\n", $l->{cliIP}, $l->{code}, $l->{sender}, $l->{rest}; + } + $lines1++; + $lines2++; + } + elsif ($l->{rest} =~ /^Admin/) { + $l->{color} = $yellow; + $cols = $columns - 9 - 1 - 8 - 1; + printf "$l->{date} $l->{time} \033[1;$l->{color}m%-${cols}.${cols}s\033[0m\n", $l->{rest}; + $lines1++; + $lines2++; + } + else { + next if ($l->{rest} =~ /converting to SSL$/); + next if ($l->{rest} =~ /^found .* in VERIFY-cache$/); + next if ($l->{rest} =~ /IP-Score/); + next if ($l->{rest} =~ /MessageScore/); + next if ($l->{rest} =~ /Name Server .* ResponseTime/); + next if ($l->{rest} =~ /New connection on the secure SSL port/); + next if ($l->{rest} =~ /\[SMTP Error]/); + next if ($l->{rest} =~ /\[SMTP Reply]/); + next if ($l->{rest} =~ /\[spam found]/); + next if ($l->{rest} =~ /^to: .* found .* in VERIFY-cache$/); + next if ($l->{rest} =~ /^VRFY added .* to VRFY-\/LDAPlist$/); + $l->{color} = $black; + $cols = $columns - 9 - 1 - 8 - 1; + printf "$l->{date} $l->{time} \033[1;$l->{color}m%-${cols}.${cols}s\033[0m\n", $l->{rest}; + $lines1++; + $lines2++; + } +} + +close(LOG); +exit(0); diff --git a/mail/assp/files/extra-patch-assp.pl+SSL b/mail/assp/files/extra-patch-assp.pl+SSL deleted file mode 100644 index cfced01fb18c..000000000000 --- a/mail/assp/files/extra-patch-assp.pl+SSL +++ /dev/null @@ -1,159 +0,0 @@ ---- assp.pl.orig 2009-01-26 17:49:10.000000000 -0500 -+++ assp.pl 2009-01-26 22:10:17.000000000 -0500 -@@ -97,6 +97,13 @@ - ['smtpDestination','SMTP Destination',40,\&textinput,'125','(\S*)',undef, - 'The IP <b>number!</b> and port number of your primary SMTP. If multiple servers are listed and the first listed MTA does not respond, each additional MTA will be tried. If only a port number is entered, or the dynamic keyword <b>INBOUND</b> is used with a port number, then the connection will be established to the local IP address on which the connection was received. This is useful when you have several IP addresses with different domains or profiles in your MTA. If INBOUND:PORT is used, ReportingReplies (Analyze,Help,etc and CopyMail will go to 127.0.0.1:PORT. If your needs are different, use smtpReportServer (SMTP Reporting Destination) and sendAllDestination (Copy Spam SMTP Destination)<small><i>Examples:</i> 125, 127.0.0.1:125, 127.0.0.1:125|127.0.0.5:125, INBOUND:125</small>','Basic'], - -+['listenPortSSL','SMTP Secure Listen Port',20,\&textinput,'465','(\S+)','ConfigChangeMailPort', -+ 'The port number on which ASSP will listen for incoming secure SMTP connections (normally 465). You can specify both an IP address and port number to limit connections to a specific interface.<p><small><i>Examples:</i> 465, 127.0.0.1:465, 127.0.0.1:465|127.0.0.2:465 </small></p><hr /><div class="menuLevel1">Notes On Network Setup</div><input type="button" value="Notes" onclick="javascript:popFileEditor(\'notes/network.txt\',3);" />','Basic'], -+['SSLCertFile','SSL Certificate File (PEM format)',48,\&textinput,'','(\S+)',undef, -+ "Path to the file containing the server's SSL certificate",'Basic'], -+['SSLKeyFile','SSL Key File (PEM format)',48,\&textinput,'','(\S+)',undef, -+ "Path to the file containing the server's SSL key",'Basic'], -+ - ['listenPort2','Second SMTP Listen Port',20,\&textinput,'','(\S*)','ConfigChangeMailPort2', - 'A secondary port number on which ASSP can accept SMTP connections. This is useful as a dedicated port for VPN clients or for those who cannot directly send mail to a mail server outside of their ISP\'s network because the ISP is blocking port 25. You may also specify an IP address to limit connections to a specific interface.<p><small><i>Examples:</i> 2525, 127.0.0.1:2525, 192.168.0.100:25000</small></p>'], - ['smtpAuthServer','Second SMTP Destination',20,\&textinput,'','(\S*)',undef, -@@ -1639,6 +1646,8 @@ - our $CanUseSysMemInfo = $AvailSysMemInfo; - our $AvailNetSMTP = eval('use Net::SMTP; 1'); # Net::SMTP module installed - our $CanUseNetSMTP = $AvailNetSMTP; -+our $AvailIOSocketSSL = eval('use IO::Socket::SSL; 1'); # IO::Socket::SSL module installed -+our $CanUseIOSocketSSL = $AvailIOSocketSSL; - - - #use URI::_foreign; -@@ -1747,6 +1756,7 @@ - our $VerEMM; - our $VerNetSMTP; - our $VerFileReadBackwards; -+our $VerIOSocketSSL; - our $VerLWP; - our $VerMailSPF2; - our $VerMailSPF; -@@ -1770,6 +1780,7 @@ - our $CommentEMM; - our $CommentNetSMTP; - our $CommentFileReadBackwards; -+our $CommentIOSocketSSL; - our $CommentLWP; - our $CommentMailSPF2; - our $CommentMailSPF; -@@ -1831,6 +1842,7 @@ - our $lookup_return; - our $lsn2; - our $lsn; -+our $lsnSSL; - our $maillogEnd; - our $maillogJump; - our $minusIcon; -@@ -3095,6 +3107,14 @@ - $CommentNetSMTP="Verify Recipients not available"; - mlog(0,"Net::SMTP module not installed - Verify Recipients not available"); - } -+ if ($CanUseIOSocketSSL) { -+ $ver=eval('IO::Socket::SSL->VERSION'); $VerIOSocketSSL=$ver; $ver=" version $ver" if $ver; -+ mlog(0,"IO::Socket::SSL module$ver installed - secure SSL sockets available"); -+ $CommentIOSocketSSL="Secure SSL sockets available"; -+ } elsif (!$AvailIOSocketSSL) { -+ $CommentIOSocketSSL="Secure SSL sockets not available"; -+ mlog(0,"IO::Socket::SSL module not installed - secure SSL sockets not available"); -+ } - - - -@@ -3111,6 +3131,11 @@ - mlog( 0, "NOT listening for SMTP connections on $listenPort" ) if !$lsn; - mlog( 0, "NOT listening for ADMIN http connections on $webAdminPort" ) if !$WebSocket; - mlog( 0, "NOT listening for STATISTICS http connections on $webStatPort" ) if !$StatSocket; -+ if ($CanUseIOSocketSSL && $listenPortSSL) { -+ $lsnSSL = newListen( $listenPortSSL, \&NewSMTPConnection ); -+ mlog( 0, "listening for additional SMTP connections on $listenPortSSL" ) if $lsnSSL; -+ mlog( 0, "NOT listening for additional SMTP connections on $listenPortSSL" ) if !$lsnSSL; -+ } - if ($listenPort2) { - $lsn2 = newListen( $listenPort2, \&NewSMTPConnection ); - mlog( 0, "listening for additional SMTP connections on $listenPort2" ) if $lsn2; -@@ -4119,6 +4144,11 @@ - d(106); - return; - } -+ if ($CanUseIOSocketSSL && $fh == $lsnSSL && $SSLKeyFile ne '' && $SSLCertFile ne '') { -+ # connection on the secure SSL port -+ d(107); -+ IO::Socket::SSL->start_SSL($client, SSL_key_file => $SSLKeyFile, SSL_cert_file => $SSLCertFile, SSL_use_cert => 1, SSL_server => 1); -+ } - $Con{$client}->{relayok} = $relayok; - my $ip = $client->peerhost(); - my $port = $client->peerport(); -@@ -4259,6 +4289,7 @@ - d("limiting sessions: $fh"); - $readable->remove($lsn) if $lsn; - $readable->remove($lsn2) if $lsn2; -+ $readable->remove($lsnSSL) if $lsnSSL; - $readable->remove($Relay) if $Relay; - if ($SessionLog) { - mlog( 0, "connected: $ip:$port" ) -@@ -4847,6 +4878,7 @@ - $smtpConcurrentSessions = 0 if $smtpConcurrentSessions < 0; - $readable->add($lsn) if $lsn && ( !$readable->exists($lsn) ); - $readable->add($lsn2) if $lsn2 && ( !$readable->exists($lsn2) ); -+ $readable->add($lsnSSL) if $lsnSSL && ( !$readable->exists($lsnSSL) ); - $readable->add($Relay) if $Relay && ( !$readable->exists($Relay) ); - $SMTPSession{Total}-- if $maxSMTPSessions; - $SMTPSession{$ip}-- if $maxSMTPipSessions; -@@ -5454,6 +5486,27 @@ - $this->{rcvd} =~ s/=host/$helo2/; - $this->{rcvd} =~ s/=\)/=$helo2\)/; - $this->{rcvd} = &headerWrap( $this->{rcvd} ); # wrap long lines -+ } elsif ($CanUseIOSocketSSL && $l =~ /starttls/io) { -+ # write directly to $fh, bypassing buffering -+ $fh->write( "220 2.0.0 Ready to start TLS\r\n" ); -+ # the value of $fh changes when converted to SSL -+ my $oldfh = $fh; -+ my $oldConfh = $Con{$fh}; -+ # convert to SSL -+ IO::Socket::SSL->start_SSL($fh, SSL_key_file => $SSLKeyFile, SSL_cert_file => $SSLCertFile, SSL_use_cert => 1, SSL_server => 1); -+ # copy data from old $fh -+ $Con{$fh} = $oldConfh; -+ $Con{$fh}->{client} = $fh; -+ $SMTPSession{$fh} = $SMTPSession{$oldfh}; -+ # clean up old $fh -+ delete $SocketCalls{$oldfh}; -+ $readable->remove($oldfh); -+ $writable->remove($oldfh); -+ # set up new $fh -+ $SocketCalls{$fh} = \&SMTPTraffic; -+ $readable->add($fh); -+ d("SSL: $fh $Con{$fh}"); -+ return; - } elsif ( $l =~ /mail from:\s*<?($EmailAdrRe\@$EmailDomainRe|\s*)>?/io ) { - my $fr = $1; - my $RO_e = $1; -@@ -11007,15 +11060,22 @@ - return unless $cli; - $Con{$cli}->{inerror} = $l =~ /^5[05][0-9]/; - -- if ( $l =~ /250-.*(CHUNKING|PIPELINING|XEXCH50|STARTTLS)/i ) { -+ if ( $l =~ /250-.*(CHUNKING|PIPELINING|XEXCH50)/i ) { - return; -- } elsif ( $l =~ /250 .*(CHUNKING|PIPELINING|XEXCH50|STARTTLS)/i ) { -+ } elsif ( $l =~ /250-.*STARTTLS/i && ($cli =~ /IO::Socket::SSL/ || !$CanUseIOSocketSSL) ) { -+ # suppress STARTTLS if SSL already enabled or unavailable -+ return; -+ } elsif ( $l =~ /250 .*STARTTLS/i && ($cli =~ /IO::Socket::SSL/ || !$CanUseIOSocketSSL) ) { -+ # change STARTTLS to NOOP if SSL already enabled or unavailable -+ sendque( $cli, "250 NOOP\r\n" ); -+ return; -+ } elsif ( $l =~ /250 .*(CHUNKING|PIPELINING|XEXCH50)/i ) { - sendque( $cli, "250 NOOP\r\n" ); - return; - -- # we'll filter off the chunking directive to avoid BDAT problems. -+ # we'll filter off the CHUNKING directive to avoid BDAT problems. -+ # we'll filter off the PIPELINING directive to avoid ... problems. - # we'll filter off the XEXCH50 service, as it only causes troubles -- # we'll filter off the STARTTLS directive to avoid TLS problems. - d("$l"); - - } elsif ( $l =~ /^220/ ) { diff --git a/mail/assp/files/patch-assp.pl b/mail/assp/files/patch-assp.pl index ba12d8a400ff..fbe50bfd6b18 100644 --- a/mail/assp/files/patch-assp.pl +++ b/mail/assp/files/patch-assp.pl @@ -1,37 +1,17 @@ ---- assp.pl.orig 2009-01-25 18:17:42.000000000 -0500 -+++ assp.pl 2009-01-25 18:21:31.000000000 -0500 +--- assp.pl.orig 2009-03-17 00:48:11.000000000 -0400 ++++ assp.pl 2009-03-17 11:11:45.000000000 -0400 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -- -+#!/usr/local/bin/perl - # perl antispam smtp proxy ++#!/usr/local/bin/perl -- + #use lib 'path/to/my/perlmods'; + # anti spam smtp proxy # (c) John Hanna, John Calvi, Robert Orso, AJ 2004 under the terms of the GPL - # (c) Fritz Borgstedt 2006 under the terms of the GPL -@@ -978,8 +978,8 @@ - ['ScanNP','Scan No Processing Senders',0,\&checkbox,'','(.*)',undef,''], - ['ScanLocal','Scan Local Senders',0,\&checkbox,'','(.*)',undef,''], - ['ScanCC','Scan Copied Spam Mails',0,\&checkbox,'','(.*)',undef,''], --['AvClamdPort','Port or file socket for ClamAV',30,\&textinput,'/tmp/clamd','(\S+)',undef, -- 'A socket specified in the clamav.conf file - LocalSocket. For example /tmp/clamd. If the socket has been setup as a TCP/IP socket (see the TCPSocket option in the clamav.conf file), then specify the TCP socket. For example: 3310 '], -+['AvClamdPort','Port or file socket for ClamAV',30,\&textinput,'/var/run/assp/clamd','(\S+)',undef, -+ 'A socket specified in the clamav.conf file - LocalSocket. For example /var/run/assp/clamd. If the socket has been setup as a TCP/IP socket (see the TCPSocket option in the clamav.conf file), then specify the TCP socket. For example: 3310 '], - ['ClamAVBytes','ClamAV Bytes',8,\&textinput,60000,'(\d*)',undef, - 'The number of bytes per message that will be submitted for virus scanning. Values of 100000 or larger are not recommended.'], - ['ClamAVtimeout','ClamAV Timeout',3,\&textinput,10,'(\d*)',undef, 'ClamAV will timeout after this many seconds.<br /> default: 10 seconds.'], -@@ -1159,7 +1159,7 @@ - 'A copy of the Analyze-Report will be sent to this address. For example: admin@example.com'], - ['DoAdditionalAnalyze','Spam and Ham Reports will trigger an additional Analyze Report ','0:NO ADDITIONAL REPORT|1:SEND TO SENDER|2:SEND TO EmailAnalyzeTo|3:SEND TO BOTH',\&listbox,0,'(.*)',undef, - 'Additional Analyze Report will be generated for Spam and Ham Reports. Setting the TO Address accordingly and choosing <b>EmailAnalyzeTo</b> will send the Analyze Report to the admin only.'], --['EmailFrom','From Address for Reports',40,\&textinput,'<spammaster@yourdomain.com>','(.*@.*)?',undef, -+['EmailFrom','From Address for Reports',40,\&textinput,'<postmaster@yourdomain.com>','(.*@.*)?',undef, - 'Email sent from ASSP acknowledging your submissions will be sent from this address.'], - ['EmailAllowEqual','Allow \'=\' in Addresses',0,\&checkbox,'1','(.*)',undef, - 'Allow \'=\' in addresses to be whitelisted or redlisted.'], -@@ -1404,7 +1404,7 @@ +@@ -1537,7 +1537,7 @@ [0,0,0,'heading','Server Setup'], - ['AsAService','Run ASSP as a Windows Service',0,\&checkbox,'','(.*)',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 <a href="http://www.asspsmtp.org/wiki/Quick_Start_for_Win32">Quick Start for Win32</a> wiki page.<br /> <span class="negative"> requires ASSP restart</span>'], + ['AsAService','Run ASSP as a Windows Service',0,\&checkbox,'','(.*)',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 <a href="http://apps.sourceforge.net/mediawiki/assp/index.php?title=Win32">Quick Start for Win32</a> doku page.<br /> <span class="negative"> requires ASSP restart</span>'], -['AsADaemon','Run ASSP as a Daemon',0,\&checkbox,'','(.*)',undef,'In Linux/BSD/Unix/OSX fork and close file handles. Similar to the command "perl assp.pl &", but better.<br /> -+['AsADaemon','Run ASSP as a Daemon',0,\&checkbox,'1','(.*)',undef,'In Linux/BSD/Unix/OSX fork and close file handles. Similar to the command "perl assp.pl &", but better.<br /> ++['AsADaemon','Run ASSP as a Daemon',0,\&checkbox,1,'(.*)',undef,'In Linux/BSD/Unix/OSX fork and close file handles. Similar to the command "perl assp.pl &", but better.<br /> <span class="negative"> requires ASSP restart</span>'], ['runAsUser','Run as UID',20,\&textinput,'','(\S*)',undef,'The *nix user name to assume after startup (*nix only).<p><small><i>Examples:</i> assp, nobody</small></p> <span class="negative"> requires ASSP restart</span>'], diff --git a/mail/assp/files/patch-stats.sh b/mail/assp/files/patch-stats.sh deleted file mode 100644 index f79702b2375c..000000000000 --- a/mail/assp/files/patch-stats.sh +++ /dev/null @@ -1,442 +0,0 @@ ---- stats.sh.orig 2009-01-29 13:19:18.000000000 -0500 -+++ stats.sh 2009-01-29 20:27:14.000000000 -0500 -@@ -1,15 +1,23 @@ - #!/bin/sh - -+# This version of the script is heavily modified from the now -+# unsupported original. -+# -+# This version by: -+# J.R. Oldroyd <fbsd@opal.com> -+# FreeBSD port maintained for ASSP -+# -+ - # As a shell script (running on Unix...) it expects to find the local - # copy of your standard Unix shell, the 'tail' utility and a working 'awk' - # interpreter. - --# I use the default location for ASSP's maillog file, and the 'maillog.log' -+# I use the default location for ASSP's maillog file, and the 'maillog.txt' - # name (in assp.cfg) to keep ASSP from changing it on me. - --# This script attempts to go back at least 300 lines in your maillog.log -+# This script attempts to go back at least 300 lines in your maillog.txt - # file to give you a nice screenful of goodies to review when it --# first starts. If your maillog.log is nearly empty, then just -+# first starts. If your maillog.txt is nearly empty, then just - # be patient. As things happen - the logger will reveal it in COLOR! - # ------------------------------------ KRL ------------------------- - -@@ -27,14 +35,7 @@ - # order to give you a full screen on startup. Also, it assumes - # ANSI Color mode for your screen to display the lines in color. - # --# BS (in Red) lines are those caught by the Bayesian filter !! --# LW (in White .. mostly) are those Local or Whitelisted eMails --# Ok (in Green) are eMail that fully pass alltests without exceptions. --# RB (in Cyan) .. Blocked Relay attempt --# WL+ Whitelist ADDITION by an authorized local user --# BA (in Cyan) .. Bad ATTACHEMENT rejected --# SR (in Cyan) .. spam@ report submission --# NS (in Cyan) .. notspam@ report submission -+# See "man assplog" for a description of the fields and coloring. - # - # I got the idea for this script from Mark Constable. He submitted - # a similar script to follow the Courier-MTA /var/log/maillog -@@ -46,91 +47,315 @@ - # Some fields are truncated (with a hard-coded length value, usually 40) - # to keep each line more or less intact on your screen as things scroll by - # Colors are coded with ANSI Color coding, your mileage may vary ... --# I assume the naming convention of 'maillog.log' so ASSP won't munge -+# I assume the naming convention of 'maillog.txt' so ASSP won't munge - # each current log into some difficult-to-grok name. You should try - # to use this feature - and perhaps roll the log periodically with - # 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 | \ -- awk ' \ -- /whitelisted/ { \ -- printf("%s %s \033[1;32m%-15s L\033[0mW %s \033[1;32m->\033[0m %s\n", \ -- substr($1,1,length($1)), \ -- substr($2,1,length($2)), \ -- substr($3,1,length($3)), \ -- substr($4,1,40), \ -- substr($6,1,length($6)) )\ -- } \ -- /email/ && /whitelist addition/ { \ -- printf("%s %s \033[1;32m%-15s W\033[0mA+ %s \033[1;32m->\033[0m %s\n", \ -- substr($1,1,length($1)), \ -- substr($2,1,length($2)), \ -- "+email address+", \ -- substr($4,1,40), \ -- substr($6,1,length($6)) )\ -- } \ -- /whitelist addition/ && !/email/ { \ -- printf("%s %s \033[1;32m%-15s W\033[0mL+ %s \033[1;32m %s %s\033[0m\n", \ -- substr($1,1,length($1)), \ -- substr($2,1,length($2)), \ -- substr($3,1,length($3)), \ -- substr($4,1,40), \ -- "-adds-", \ -- substr($9,1,length($9)) )\ -- } \ -- /Bayesian spam/ { \ -- printf("%s %s \033[1;31m%-15s BS %s -> %s\033[0m\n", \ -- substr($1,1,length($1)), \ -- substr($2,1,length($2)), \ -- substr($3,1,length($3)), \ -- substr($4,1,40), \ -- substr($6,1,length($6)) )\ -- } \ -- /message ok/ { \ -- printf("%s %s \033[1;32m%-15s Ok %s -> %s\033[0m\n", \ -- substr($1,1,length($1)), \ -- substr($2,1,length($2)), \ -- substr($3,1,length($3)), \ -- substr($4,1,40), \ -- substr($6,1,length($6)) )\ -- } \ -- /bad attachment/ { \ -- printf("%s %s \033[1;35m%-15s BA %s -> %s\033[0m\n", \ -- substr($1,1,length($1)), \ -- substr($2,1,length($2)), \ -- substr($3,1,length($3)), \ -- substr($4,1,40), \ -- substr($6,1,length($6)) )\ -- } \ -- /relay attempt blocked/ { \ -- printf("%s %s \033[1;35m%-15s RB %s -> %s %s %s %s %s\033[0m\n", \ -- substr($1,1,length($1)), \ -- substr($2,1,length($2)), \ -- substr($3,1,length($3)), \ -- substr($4,1,length($4)), \ -- substr($5,1,length($5)), \ -- substr($6,1,length($6)), \ -- substr($7,1,length($7)), \ -- substr($8,1,length($8)), \ -- substr($9,1,length($9)) )\ -- } \ -- /Admin update:/ { \ -- printf("\033[1;33m%s %s %s %s %s %s \033[0m\n", $1, $2, $3, $4, $5, $6) \ -- } \ -- /Email spamreport/ { \ -- printf("%s %s\033[0;36m %-15s SR %s Email SPAM Submission\033[0m\n", \ -- substr($1,1,length($1)), \ -- substr($2,1,length($2)), \ -- substr($3,1,length($3)), \ -- substr($4,1,length($4)) ) \ -- } \ -- /Email hamreport/ { \ -- printf("%s %s\033[0;36m %-15s NS %s Email NOTSPAM Submission\033[0m\n", \ -- substr($1,1,length($1)), \ -- substr($2,1,length($2)), \ -- substr($3,1,length($3)), \ -- substr($4,1,length($4)) ) \ -- }' -+tail -300 -f /var/db/assp/maillog.txt | awk ' -+ { -+ # skip over "[reason]" fields -+ p=0 -+ if ($(p+4) ~ /\[.*]/) p++ -+ } -+ /\[Local]|\[Whitelisted]|local or whitelisted/ { -+ printf("%s %s \033[1;32m%-15s\033[0m \033[1;37mLW %s\033[0m \033[1;32m->\033[0m \033[1;37m%s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+7) ) -+ next -+ } -+ /[Em]ail whitelist (addition|deletion):*/ { -+ if (/(addition|deletion)$/) -+ next -+ printf("%s %s \033[1;36m%-15s\033[0m \033[1;36mW%s %s\033[0m \033[1;37m%s\033[0m \033[1;36m%s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ (/addition:/) ? "+" : "-", -+ substr($(p+5),1,40), -+ (/addition:/) ? "-adds-" : "-deletes-", -+ $(p+9) ) -+ next -+ } -+ /whitelist addition:/ && !/[Ee]mail/ { -+ printf("%s %s \033[1;36m%-15s\033[0m \033[1;36mWC %s\033[0m \033[1;37m%s\033[0m \033[1;36m%s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ "-adds-", -+ $(p+10) ) -+ next -+ next -+ } -+ /[Ee]mail (hamreport|help|spamreport|redlist)/ { -+ printf("%s %s\033[1;36m %-15s EM %s %s%s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ $(p+5), -+ $(p+7), -+ ($(p+8)) ? " " $(p+8) : "" ) -+ next -+ } -+ /Bayesian Check (- )?Prob/ { -+ # suppress -+ next -+ } -+ /\[Bayesian]|Bayesian [Ss]pam/ { -+ printf("%s %s \033[1;31m%-15s BS %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+7) ) -+ next -+ } -+ /recipient accepted/ { -+ # suppress -+ next -+ } -+ /\[MessageOK]|message ok/ { -+ printf("%s %s \033[1;32m%-15s OK %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+7) ) -+ next -+ } -+ /bad attachment/ && !/no bad/ { -+ printf("%s %s \033[1;35m%-15s BA %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+7) ) -+ next -+ } -+ /relay attempt blocked/ { -+ printf("%s %s \033[1;35m%-15s RB %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ ($(p+10) ~ /^(.*):$/) ? $(p+11) : $(p+10) ) -+ next -+ } -+ /no recipients left -- dropping connection/ { -+ # suppress -+ next -+ } -+ /[Ii]nvalid address rejected/ { -+ printf("%s %s \033[1;34m%-15s IR %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $NF ) -+ next -+ } -+ /malformed address/ { -+ printf("%s %s \033[1;35m%-15s MA %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+8) ) -+ next -+ } -+ /\[InvalidLocalSender]|Unknown Sender (with|from) Local Domain/ { -+ printf("%s %s \033[1;34m%-15s IS %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40) ) -+ next -+ } -+ /(Commencing|Completed) (R|DNS|URI)BL checks/ { -+ # suppress -+ next -+ } -+ /((DNS|URI)BL )?Received-(R|DNS|URI)BL: (pass|neutral|fail)|URIBL fail|Bayesian Check URIBL/ { -+ # suppress -+ next -+ } -+ /failed (DNS|URI)BL|failed (R|URI)BL checks|Received-RBL: fail/ { -+ printf("%s %s \033[1;35m%-15s BL %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+7) ) -+ next -+ } -+ /(\[DNSBL]|\[DNSBLcache]).* (listed|rejected) by / { -+ printf("%s %s \033[1;35m%-15s BL %s (%s blacklisted by %s)\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ /listed/ ? $(p+11) : $(p+7), -+ /listed/ ? $(p+14) : $(p+10) ) -+ next -+ } -+ /\[SPF] .* SPF: (unknown|pass|neutral)|\[SPF] .*\(SPF neutral\)|Received-SPF(\(cache\))?: (pass|neutral)| SPF: (soft)?fail|SPFstrict/ { -+ # suppress -+ next -+ } -+ /failed SPF checks|Received-SPF(\(cache\))?: ((soft)?fail|error)/ { -+ printf("%s %s \033[1;35m%-15s SP %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+7) ) -+ next -+ } -+ /\[ForgedHELO]|has spam helo|HELO-Blacklist:/ { -+ printf("%s %s \033[1;35m%-15s HL %s -> %s %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ /found]/ ? "" : $(p+7), -+ /found]/ ? "(" $(p+10) : $(p+11) ) -+ next -+ } -+ /Forged HELO:/ { -+ printf("%s %s \033[1;35m%-15s HL %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+8) ) -+ next -+ } -+ /Sender Validation:blocked:/ { -+ printf("%s %s \033[1;35m%-15s HL %s %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+10) ) -+ next -+ } -+ /(adding new|embargoing|accepting|whitelisting) triplet|(renewing|renewing whitelisted|deleting spamming whitelisted) tuplet/ { -+ # suppress -+ next -+ } -+ /(recipient|bounce) delayed/ { -+ printf("%s %s \033[1;35m%-15s DL %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ /bounce|to:/ ? $(p+7) : $(p+8) ) -+ next -+ } -+ /DATA phase delayed/ { -+ # suppress -+ next -+ } -+ /(Admin (update:|connection from ))|AdminUpdate:/ { -+ printf("\033[1;33m%s\033[0m\n", $0) -+ next -+ } -+ /ClamAV: .* - OK $/ { -+ # suppress -+ next -+ } -+ /virus detected/ { -+ printf("%s %s\033[1;35m %-15s VI %s -> %s (%s)\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ $(p+5), $(p+7), $(p+10) ) -+ next -+ } -+ /Message-Score:/ { -+ # suppress -+ next -+ } -+ /PB:.*score: [0-9]+\+[0-9]+ => [0-9]+ reason:|PB-Message-Score|PB-IP-Score|\[scoring]/ { -+ # suppress -+ next -+ } -+# /PB:( deleting\(black\)/ { -+# printf("%s %s\033[1;35m %-15s PB %s %s %s %s (%s)\033[0m\n", -+# $1, -+# $2, -+# $(p+4), -+# $(p+8), $(p+9), $(p+10), $(p+11), -+# substr($(p+12),8,40) ) -+# next -+# } -+ /PBextreme |PBextreme:monitoring/ { -+ printf("%s %s\033[1;35m %-15s PB %s extreme %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+7) ) -+ next -+ } -+ /(\[ValidHelo]|\[InvalidHelo]|\[PTRinvalid]|\[PTRmissing])\[scoring]/ { -+ # suppress -+ next -+ } -+ /\[MessageLimit]|Message Limit/ { -+ printf("%s %s\033[1;35m %-15s PB %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ substr($(p+7),1,40) ) -+ next -+ } -+ /max errors \([0-9]+\) exceeded/ { -+ printf("%s %s\033[1;35m %-15s ME %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40) ) -+ next -+ } -+ /Message proxied without processing/ { -+ # suppress -+ next -+ } -+ /message proxied without processing/ { -+ printf("%s %s \033[1;32m%-15s NP %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ substr($(p+5),1,40), -+ $(p+7) ) -+ next -+ } -+ /Regex:(Black|NoProcessingDomain)/ { -+ # suppress -+ next -+ } -+ /invalid remote sender for internal address/ { -+ printf("%s %s \033[1;35m%-15s IO %s -> %s\033[0m\n", -+ $1, -+ $2, -+ $(p+4), -+ $(p+5), -+ substr($(p+12),1,40) ) -+ next -+ } -+ { -+ printf("%s %s ", $1, $2) -+ for (i=3; i<=NF; i++) -+ printf("\033[1;30m%s\033[0m ", $i) -+ printf("\n") -+ } -+ ' - # end of script - diff --git a/mail/assp/files/periodic-assp.sh.in b/mail/assp/files/periodic-assp.sh.in index c6f970e70c51..0bce9032d2d3 100644 --- a/mail/assp/files/periodic-assp.sh.in +++ b/mail/assp/files/periodic-assp.sh.in @@ -2,30 +2,19 @@ # # $FreeBSD$ # -# Update ASSP Spam and ClamAV databases +# Run ASSP's nightly housekeeping script, rebuildspamdb.pl +# Delete old ASSP log files cd %%ASSP_HOME%% -if [ ! -f %%PREFIX%%/lib/assp/rebuildspamdb.pl ] +if [ ! -f %%DATADIR%%/rebuildspamdb.pl ] then - echo "%%PREFIX%%/lib/assp/rebuildspamdb.pl does not exist" + echo "%%DATADIR%%/rebuildspamdb.pl does not exist" rc_spamdb=2 else echo "" echo "Running ASSP rebuildspamdb.pl:" - %%PERL%% %%PREFIX%%/lib/assp/rebuildspamdb.pl && rc_spamdb=0 || rc_spamdb=3 -fi - -if [ ! -f %%PREFIX%%/lib/assp/freshclam.sh ] -then - # existence of freshclam.sh is optional, dependent - # on the WITH_CLAMAV setting, so not an error if not there - rc_clamav=0 -else - echo "" - echo "Fetching ASSP ClamAV virus database updates:" - export PATH=$PATH:%%LOCALBASE%%/bin - sh %%PREFIX%%/lib/assp/freshclam.sh && rc_clamav=0 || rc_clamav=3 + %%PERL%% %%DATADIR%%/rebuildspamdb.pl && rc_spamdb=0 || rc_spamdb=3 fi . %%RC_SUBR%% @@ -36,6 +25,6 @@ load_rc_config $name echo "" echo "Removing old ASSP log files:" -find . -name '*.maillog.txt' -mtime +$assp_logexpire -exec ls -l {} \; -exec rm {} \; +find -L . -name '*.maillog.txt' -mtime +$assp_logexpire -exec ls -l {} \; -exec rm {} \; -exit $(($rc_spamdb|$rc_clamav)) +exit $rc_spamdb diff --git a/mail/assp/files/pkg-install.in b/mail/assp/files/pkg-install.in deleted file mode 100644 index 3ded73f4f1a1..000000000000 --- a/mail/assp/files/pkg-install.in +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ "$2" = "POST-INSTALL" ]; then - install -d -m 0700 -o %%ASSP_USER%% -g %%ASSP_GROUP%% %%ASSP_HOME%% - ln -s $PKG_PREFIX/lib/assp/files %%ASSP_HOME%% - ln -s $PKG_PREFIX/lib/assp/images %%ASSP_HOME%% - ln -s $PKG_PREFIX/lib/assp/reports %%ASSP_HOME%% -fi diff --git a/mail/assp/pkg-descr b/mail/assp/pkg-descr index 161c43fc31dc..682a15847536 100644 --- a/mail/assp/pkg-descr +++ b/mail/assp/pkg-descr @@ -4,7 +4,8 @@ regular SMTP server (sendmail, postfix, qmail, etc). ASSP performs a number of configurable spam checks, and on detecting a spam message, provides an immediate 5xx SMTP error code back to the client. Non-spam messages are passed to your regular SMTP server for further -processing and delivery. +processing and delivery. ASSP includes SSL and IPv6 support. It is a single +script with a web-based configuration tool. ASSP offers: - a whitelist of known good senders @@ -14,8 +15,9 @@ ASSP offers: - HELO checking - SPF (Sender Policy Framework) checking - DNSBL (DNS Block List) checking using many DNSBL services + - various SMTP error modes detection - Virus detection - -ASSP is a single script with a web-based configuration tool. +and many other spam detection techniques. WWW: http://assp.sourceforge.net/ +WWW: http://opal.com/jr/freebsd/ports/mail/assp/ diff --git a/mail/assp/pkg-plist b/mail/assp/pkg-plist index 7a1444fa1406..42796c367ca2 100644 --- a/mail/assp/pkg-plist +++ b/mail/assp/pkg-plist @@ -1,55 +1,67 @@ etc/periodic/daily/510.assp @dirrmtry etc/periodic/daily @dirrmtry etc/periodic -lib/assp/addservice.pl -lib/assp/assp.pl -lib/assp/files/URIBLCCTLDS.txt -lib/assp/files/bombre.txt -lib/assp/files/invalidptr.txt -lib/assp/files/ipnp.txt -lib/assp/files/nodelay.txt -lib/assp/files/redre.txt -lib/assp/images/Thumbs.db -lib/assp/images/assp.css -lib/assp/images/dropShadow.gif -lib/assp/images/editor.css -lib/assp/images/favicon.ico -lib/assp/images/info.png -lib/assp/images/logo.jpg -lib/assp/images/minusIcon.png -lib/assp/images/noIcon.png -lib/assp/images/opensource-logo.gif -lib/assp/images/plusIcon.png -lib/assp/images/project-support.jpg -lib/assp/images/shutdown.css -lib/assp/images/sourceforge-logo.gif -lib/assp/images/valid-xhtml10.gif -lib/assp/images/village.gif -lib/assp/images/xml-pill.gif -lib/assp/move2num.pl -lib/assp/rebuildspamdb.pl -lib/assp/reports/analyzereport.txt -lib/assp/reports/helpreport.txt -lib/assp/reports/notspamreport.txt -lib/assp/reports/redremovereport.txt -lib/assp/reports/redreport.txt -lib/assp/reports/spamreport.txt -lib/assp/reports/virusreport.txt -lib/assp/reports/whiteremovereport.txt -lib/assp/reports/whitereport.txt -lib/assp/stat.pl -lib/assp/stats.sh -@dirrm lib/assp/reports -@dirrm lib/assp/images -@dirrm lib/assp/files -@dirrm lib/assp +%%DATADIR%%/assp.pl +%%DATADIR%%/files/URIBLCCTLDS.txt +%%DATADIR%%/files/blackre.txt +%%DATADIR%%/files/blockreportuser.txt +%%DATADIR%%/files/bombre.txt +%%DATADIR%%/files/denyalways.txt +%%DATADIR%%/files/droplist.txt +%%DATADIR%%/files/invalidhelo.txt +%%DATADIR%%/files/invalidptr.txt +%%DATADIR%%/files/ipnp.txt +%%DATADIR%%/files/nodelay.txt +%%DATADIR%%/files/redre.txt +%%DATADIR%%/files/strictspf.txt +%%DATADIR%%/files/validptr.txt +%%DATADIR%%/files/whiteorg.txt +%%DATADIR%%/images/assp.css +%%DATADIR%%/images/dropShadow.gif +%%DATADIR%%/images/editor.css +%%DATADIR%%/images/favicon.ico +%%DATADIR%%/images/info.png +%%DATADIR%%/images/logo.jpg +%%DATADIR%%/images/minusIcon.png +%%DATADIR%%/images/noIcon.png +%%DATADIR%%/images/opensource-logo.gif +%%DATADIR%%/images/plusIcon.png +%%DATADIR%%/images/project-support.jpg +%%DATADIR%%/images/shutdown.css +%%DATADIR%%/images/sourceforge-logo.gif +%%DATADIR%%/images/valid-xhtml10.gif +%%DATADIR%%/images/village.gif +%%DATADIR%%/images/xml-pill.gif +%%DATADIR%%/move2num.pl +%%DATADIR%%/rebuildspamdb.pl +%%DATADIR%%/reports/analyzereport.txt +%%DATADIR%%/reports/blockreport_html.txt +%%DATADIR%%/reports/blockreport_sub.txt +%%DATADIR%%/reports/blockreport_text.txt +%%DATADIR%%/reports/helpreport.txt +%%DATADIR%%/reports/notspamreport.txt +%%DATADIR%%/reports/redremovereport.txt +%%DATADIR%%/reports/redreport.txt +%%DATADIR%%/reports/spamreport.txt +%%DATADIR%%/reports/virusreport.txt +%%DATADIR%%/reports/whiteremovereport.txt +%%DATADIR%%/reports/whitereport.txt +%%DATADIR%%/stat.pl +@dirrm %%DATADIR%%/reports +@dirrm %%DATADIR%%/images +@dirrm %%DATADIR%%/files +@dirrm %%DATADIR%% sbin/assp sbin/assplog %%PORTDOCS%%%%DOCSDIR%%/Legacy - ASSP Documentation.htm %%PORTDOCS%%%%DOCSDIR%%/Regular Expression Tutorial.htm %%PORTDOCS%%@dirrm %%DOCSDIR%% +@unexec rm %%ASSP_HOME%%/log @unexec rm %%ASSP_HOME%%/reports @unexec rm %%ASSP_HOME%%/images @unexec rm %%ASSP_HOME%%/files @unexec rmdir %%ASSP_HOME%% 2>/dev/null || true @unexec if [ -d %%ASSP_HOME%% ]; then echo "If you are deinstalling ASSP completely, remove the %%ASSP_HOME%% directory."; fi +@unexec rmdir %%ASSP_LOG%% 2>/dev/null || true +@unexec if [ -d %%ASSP_LOG%% ]; then echo "If you are deinstalling ASSP completely, remove the %%ASSP_LOG%% directory."; fi +@unexec echo "If you are deinstalling ASSP completely, delete the ASSP user and group." |