diff options
author | jylefort <jylefort@FreeBSD.org> | 2005-05-28 09:56:27 +0000 |
---|---|---|
committer | jylefort <jylefort@FreeBSD.org> | 2005-05-28 09:56:27 +0000 |
commit | bbe67b39f3f3316c90bee65ef690a5705b07bf89 (patch) | |
tree | 490e45b86e4ff1501d5001110bff6ad3ac15c152 /mail | |
parent | 890147bc4e572d34a38ee57f1d6422c8bbf33949 (diff) | |
download | FreeBSD-ports-bbe67b39f3f3316c90bee65ef690a5705b07bf89.zip FreeBSD-ports-bbe67b39f3f3316c90bee65ef690a5705b07bf89.tar.gz |
Add assp.
Anti-Spam SMTP Proxy is a spam filter that sits on port 25 in front of your
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.
ASSP offers:
- a whitelist of known good senders
- Bayesian checks on message headers and contents
- recipient address validation using LDAP and RFC822 conformance
- relay denial
- HELO checking
- SPF (Sender Policy Framework) checking
- DNSBL (DNS Block List) checking using many DNSBL services
- Virus detection
ASSP is a single script with a web-based configuration tool.
WWW: http://assp.sourceforge.net/
PR: ports/81570
Submitted by: J.R. Oldroyd <fbsd@opal.com>
Diffstat (limited to 'mail')
-rw-r--r-- | mail/Makefile | 1 | ||||
-rw-r--r-- | mail/assp/Makefile | 100 | ||||
-rw-r--r-- | mail/assp/distinfo | 2 | ||||
-rw-r--r-- | mail/assp/files/510.assp.in | 31 | ||||
-rw-r--r-- | mail/assp/files/assp.8.in | 277 | ||||
-rw-r--r-- | mail/assp/files/assp.sh.in | 23 | ||||
-rw-r--r-- | mail/assp/files/assplog.8.in | 103 | ||||
-rw-r--r-- | mail/assp/files/patch-assp.pl | 39 | ||||
-rw-r--r-- | mail/assp/files/patch-stats.sh | 176 | ||||
-rw-r--r-- | mail/assp/files/periodic-assp.sh.in | 31 | ||||
-rw-r--r-- | mail/assp/files/pkg-install.in | 6 | ||||
-rw-r--r-- | mail/assp/pkg-descr | 21 | ||||
-rw-r--r-- | mail/assp/pkg-plist | 25 |
13 files changed, 835 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile index 6ded375..c7ea7ab 100644 --- a/mail/Makefile +++ b/mail/Makefile @@ -17,6 +17,7 @@ SUBDIR += archmbox SUBDIR += arrow SUBDIR += asmail + SUBDIR += assp SUBDIR += autorespond SUBDIR += autosig SUBDIR += avenger diff --git a/mail/assp/Makefile b/mail/assp/Makefile new file mode 100644 index 0000000..c52c711 --- /dev/null +++ b/mail/assp/Makefile @@ -0,0 +1,100 @@ +# New ports collection makefile for: assp +# Date created: 16 May 2005 +# Whom: J.R. Oldroyd <fbsd@opal.com> +# +# $FreeBSD$ +# + +PORTNAME= assp +PORTVERSION= 1.1.1.b12 +CATEGORIES= mail +MASTER_SITES= http://opal.com/freebsd/ports/mail/assp/ + +MAINTAINER= fbsd@opal.com +COMMENT= Anti-Spam SMTP Proxy + +# NB: for 1.1.1.b12 Net::DNS::Packet is required even if SPF and DNSBL not used +RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS + +USE_ZIP= yes +NO_WRKSUBDIR= yes +NO_BUILD= yes +USE_REINPLACE= yes +USE_PERL5_RUN= yes + +MAN8= assp.8 assplog.8 + +ASSP_USER= nobody +ASSP_GROUP= nobody +ASSP_HOME= /var/db/assp + +PLIST_SUB= ASSP_HOME="${ASSP_HOME}" + +SUB_FILES= assp.8 assplog.8 assp.sh periodic-assp.sh pkg-install +SUB_LIST= ASSP_HOME="${ASSP_HOME}" ASSP_USER="${ASSP_USER}" \ + ASSP_GROUP="${ASSP_GROUP}" PERL="${PERL}" + +USE_RC_SUBR= assp.sh + +OPTIONS= EMVALID "RFC822 recipient address validator" on \ + LDAP "LDAP validation of recipient addresses" on \ + SPF "SPF validation of client IP" on \ + CLAMAV "ClamAV virus scanner" on \ + DNSBL "DNS block list checking" on + +.include <bsd.port.pre.mk> + +.if !defined(WITHOUT_EMVALID) +RUN_DEPENDS+= ${SITE_PERL}/Email/Valid.pm:${PORTSDIR}/mail/p5-Email-Valid +.endif + +.if !defined(WITHOUT_LDAP) +RUN_DEPENDS+= ${SITE_PERL}/Net/LDAP.pm:${PORTSDIR}/net/p5-perl-ldap +.endif + +.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 +.endif + +.if !defined(WITHOUT_DNSBL) +RUN_DEPENDS+= ${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS +.endif + +.if !defined(WITHOUT_CLAMAV) +RUN_DEPENDS+= wget:${PORTSDIR}/ftp/wget +PLIST_SUB+= ASSP_CLAMAV="" +.else +PLIST_SUB+= ASSP_CLAMAV="@comment " +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|/usr/bin/perl|${PERL}|' ${WRKSRC}/*.pl + +do-install: + ${MKDIR} ${PREFIX}/lib/assp + ${INSTALL_SCRIPT} ${WRKSRC}/*.pl ${PREFIX}/lib/assp + ${INSTALL_SCRIPT} ${WRKSRC}/stats.sh ${PREFIX}/lib/assp +.if defined(WITH_CLAMAV) + ${INSTALL_SCRIPT} ${WRKSRC}/freshclam.sh ${PREFIX}/lib/assp +.endif + ${INSTALL_DATA} ${WRKSRC}/*report.txt ${PREFIX}/lib/assp + + ${LN} -s ${PREFIX}/lib/assp/assp.pl ${PREFIX}/sbin/assp + ${LN} -s ${PREFIX}/lib/assp/stats.sh ${PREFIX}/sbin/assplog + + ${INSTALL_MAN} ${WRKDIR}/assp.8 ${MAN8PREFIX}/man/man8 + ${INSTALL_MAN} ${WRKDIR}/assplog.8 ${MAN8PREFIX}/man/man8 + + ${MKDIR} ${PREFIX}/etc/periodic/daily + ${INSTALL_SCRIPT} ${WRKDIR}/periodic-assp.sh ${PREFIX}/etc/periodic/daily/510.assp + +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/*.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 new file mode 100644 index 0000000..f455446 --- /dev/null +++ b/mail/assp/distinfo @@ -0,0 +1,2 @@ +MD5 (assp-1.1.1.b12.zip) = ccf11f30f7edbd05d1ab96d68dc5027d +SIZE (assp-1.1.1.b12.zip) = 183265 diff --git a/mail/assp/files/510.assp.in b/mail/assp/files/510.assp.in new file mode 100644 index 0000000..6b76b89 --- /dev/null +++ b/mail/assp/files/510.assp.in @@ -0,0 +1,31 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# Update ASSP Spam and ClamAV databases + +cd %%ASSP_HOME%% + +if [ ! -f %%PREFIX%%/lib/assp/rebuildspamdb.pl ] +then + echo "%%PREFIX%%/lib/assp/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 +fi + +exit $(($rc_spamdb|$rc_clamav)) diff --git a/mail/assp/files/assp.8.in b/mail/assp/files/assp.8.in new file mode 100644 index 0000000..31a575c --- /dev/null +++ b/mail/assp/files/assp.8.in @@ -0,0 +1,277 @@ +.TH assp 8 "May 16, 2005" "" "ASSP" +.SH NAME +assp \- Anti-Spam SMTP Proxy +.SH SYNOPSIS +assp [ base_dir [ admin_port ] ] +.PP +%%PREFIX%%/etc/rc.d/assp.sh start|stop|restart|status +.SH DESCRIPTION +.I "Anti-Spam SMTP Proxy" +is a spam filter that sits on port 25 in front +of your regular SMTP server +.RI ( exim (8), +.IR postfix (8), +.IR qmail (8), +.IR sendmail (8), +etc). +.PP +.I ASSP +relays the SMTP dialog between an incoming client and your SMTP +server, intercepting the dialog as needed. +.I 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. Spam messages can be blocked +from delivery or subject-tagged and delivered. +.PP +.I ASSP +offers: +.RS +.IP - 2m +a whitelist of known good senders +.IP - +Bayesian checks on message headers and contents +.IP - +local user validation using RFC822 checks, flat lists or LDAP lookup +.IP - +relay denial +.IP - +HELO checking +.IP - +SPF (Sender Policy Framework) checking +.IP - +DNSBL (DNS Block List) checking using many block list services +.IP - +Virus detection +.RE +.PP +.I ASSP +is entirely administrator-managed and is almost totally +transparent to users. In particular, users do not need to +manage +.IR procmail (1) +spam filters or challenge-response systems of their own. +.PP +The +.I base_dir +argument gives the name of +.IR ASSP 's +working directory. If omitted +it defaults to the current directory. +.PP +.I ASSP +is configured using a web interface. +The +.I admin_port +argument gives the network port for accessing +.IR ASSP 's +configuration menu. It defaults to 55555. +To access the configuration menu, start +.I ASSP +and then point your browser at +.IR http://localhost:55555 . +The default admin password is +.IR nospam4me . +.PP +Initial setup of +.I ASSP +involves several steps: +.IP 1. +Review +.IR ASSP 's +configuration options and adjust as necessary. Be sure +to change the admin password. By default +.IR ASSP 's +filters are all set to +.I "Test Mode" +which means all messages will be delivered to their recipients. +Leave everything in Test Mode for now. +.IP 2. +Decide on which network port(s) +.I ASSP +will listen and on which your normal SMTP server will listen. +Typically, +.I ASSP +will listen on port 25 and your SMTP server will be moved to +something like port 125 or 587. +.IP 3. +Reconfigure your SMTP server to its new port. +.IP 4. +Reconfigure +.I ASSP +to port 25 and restart +.IR ASSP . +Since +.I ASSP +is in Test Mode, all messages will be delivered to their +recipients. +.IP 5. +Arrange for all users' outbound email to be processed by +.IR ASSP . +This is necessary for +.I ASSP +to be able to automatically maintain its whitelist. +If a user's MUA uses SMTP to port 25, this will happen +without further intervention. If an MUA invokes +.I /usr/sbin/sendmail +and you're using the default +.IR sendmail (8) +configuration with submit queues, this will also happen +without further intervention. Otherwise, you need to take +whatever steps are necessary for each MUA that's being used. +.IP 6. +Optionally, send a message containing a list of email addresses +that you want to receive email from to +.IR assp-white@yourdomain.com . +Have all your users do this. This will seed +.IR ASSP 's +whitelist. Messages from senders on the whitelist will +never be blocked. +.IP 7. +To set up the Bayesian word list filtering, do the following: +.RS +.IP 7a. +Ensure some senders' addresses are in the whitelist, either +by sending email to them or by seeding the whilelist as described +above. +.IP 7b. +Allow some time (could be hours or days, depending on the +volume of email you receive) for enough email to collect. +Mesages from senders on the whitelist will be copied in the +.I notspam +directory. Other messages will either be passed or be copied +in the +.I spam +directory based on word scores in the initial greylist. +.IP 7c. +Periodically examine the messages in +.IR ASSP 's +.IR notspam +and +.I spam +directories to make sure they're sorted correctly. Move +any to the other directory as needed. If you're unsure about +a particular message, just delete it. +Also, examine +.I maillog.txt +for information about what +.I ASSP +is doing. +.IP 7d. +After about 400 messages have collected, filtering mode can +be enabled. +In the +.I %%ASSP_HOME%% +directory, run the +.I %%PREFIX%%/lib/assp/rebuildspamdb.pl +script to create the spam database from the logged messages. +This is the part where the Bayesian filter ``learns'' about +the words in your +.I spam +and +.I notspam +collections. +.IP 7e. +Uncheck the appropriate Test Mode box in +.IR ASSP 's +configuration menu to enable message blocking. +.IP 7f. +It is recommended that the +.I UseSubjectsAsMaillogNames +configuration option is eventually unchecked and that the +script +.I %%PREFIX%%/lib/assp/move2num.pl +is run in the +.I %%ASSP_HOME%% +directory. This causes messages to be stored with numeric +filenames, and overwritten after some time. The benefits +of this are that the size of the stored messages will +be limited and that older messages are removed from the +collection. This keeps the Bayesian word list current. +This need not be done immediately; you can do this once +you no longer feel the need to examine the spam messages +in detail. +.RE +.IP 8. +.IR ASSP 's +other filtering options (local user validation, RFC822 +conformance, client HELO validation, SPF validation, +the use of DNSBLs and the ClamAV virus checker) +can be enabled by examining and adjusting their +configuration options as needed and then unchecking the +appropriate Test Mode boxes. +.PP +Once +.I ASSP +is live, users should forward a copy of any spam message that +still gets through to +.I assp-spam@yourdomain.com +in order to add it to +.IR ASSP 's +spam database. Any non-spam that was mis-classified as spam +can be copied to +.IR assp-notspam@yourdomain.com . +.PP +The +.I rebuildspamdb.pl +script needs to be re-run periodically to update the spam database +from the latest logged messages. There is a +.IR periodic (8) +script that will do this overnight. +.PP +For full details of using +.IR ASSP , +see the +.I ASSP +website and documentation. +.SH "STARTING ASSP AT BOOT TIME" +The +.I /usr/local/etc/rc.d/assp.sh +script is run automatically at system boot time. +Several variables can be set in +.I /etc/rc.conf +to control the behavior. +.IP assp_enable +set to +.I "YES" +to start ASSP at boot time +.IP assp_args +passed to the ASSP client, default is +.I assp_args="%%ASSP_HOME%%" +.SH FILES +.IP %%ASSP_HOME%% +location of ASSP config file, log file and spam databases +.IP %%ASSP_HOME%%/notspam +copies of non-spam messages received +.IP %%ASSP_HOME%%/spam +copies of spam messages received +.IP %%ASSP_HOME%%/errors/{notspam,spam} +messages forwarded to assp-notspam@ and assp-spam@ addresses +.IP %%ASSP_HOME%%/maillog.txt +.IR ASSP 's +log file +.IP %%PREFIX%%/lib/assp/freshclam.sh +script to update virus definitions +.IP %%PREFIX%%/lib/assp/move2num.pl +script to rename stored messages to numeric filenames +.IP %%PREFIX%%/lib/assp/rebuildspamdb.pl +script to update spam database +.IP %%PREFIX%%/etc/periodic/daily/510.assp +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), +.IR exim (8), +.IR postfix (8), +.IR qmail (8), +.IR sendmail (8), +%%PREFIX%%/share/doc/assp/ASSP Documentation.htm +.br +http://assp.sourceforge.net/ diff --git a/mail/assp/files/assp.sh.in b/mail/assp/files/assp.sh.in new file mode 100644 index 0000000..8443f5b --- /dev/null +++ b/mail/assp/files/assp.sh.in @@ -0,0 +1,23 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: assp +# REQUIRE: LOGIN +# KEYWORD: FreeBSD + +. %%RC_SUBR%% + +name=assp +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/assp +command_interpreter=%%PERL%% +pidfile=%%ASSP_HOME%%/pid + +load_rc_config $name +: ${assp_enable="NO"} +: ${assp_flags="%%ASSP_HOME%%"} + +run_rc_command "$1" diff --git a/mail/assp/files/assplog.8.in b/mail/assp/files/assplog.8.in new file mode 100644 index 0000000..126e2d8 --- /dev/null +++ b/mail/assp/files/assplog.8.in @@ -0,0 +1,103 @@ +.TH assplog 8 "May 16, 2005" "" "ASSP" +.SH NAME +assplog \- display colorized ASSP log +.SH SYNOPSIS +assplog +.SH DESCRIPTION +.I 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. +.PP +The colors have the following meaning: +.PP +1. Messages that were delivered +.RS +.TP +White +Sender was on whitelist (or was added to whitelist) +.TP +Green +Message passed all checks and was delivered +.RE +.PP +2. Messages that were blocked +.RS +.TP +Blue +Recipient unknown (failed flat list or LDAP check) +.TP +Magenta +Message failed any of the other checks +.TP +Red +Message failed Bayesian spam check +.RE +.PP +3. Administrative messages +.RS +.TP +Cyan +Message to assp-{notspam,spam,white}@ address +.TP +Yellow +Admin change from web interface +.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 +HL +Bad HELO greeting +.TP +IR +Invalid recipient, failed LDAP or flat list test +.TP +LW +Local or Whitelisted emails +.TP +MA +Malformed RFC822 recipient address +.TP +NS +assp-notspam@ report submission +.TP +Ok +Email that fully passed all tests +.TP +RB +Blocked Relay attempt +.TP +SP +SPF check failed +.TP +WA+ +Whitelist addition by local user +.TP +WL+ +Whitelist addition of address CC'd in whitelisted email +.TP +SR +assp-spam@ report submission +.SH BUGS +.I assplog +does not display all log messages; for a complete view of +the log, use +.B "tail -f" +directly on the log file. +.SH FILES +.IP %%ASSP_HOME%%/maillog.txt +location of ASSP log file +.SH "SEE ALSO" +.IR assp (8), +.IR tail (1) diff --git a/mail/assp/files/patch-assp.pl b/mail/assp/files/patch-assp.pl new file mode 100644 index 0000000..596aa93 --- /dev/null +++ b/mail/assp/files/patch-assp.pl @@ -0,0 +1,39 @@ +--- assp.pl.orig Tue Mar 15 06:41:24 2005 ++++ assp.pl Wed May 18 11:33:35 2005 +@@ -58,7 +58,7 @@ + 'The address:port of your message handling system\'s smtp server. For example: 127.0.0.1:125'], + [AsAService,'As a Service',0,checkbox,'','(\S*)',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,'','(\S*)',undef, ++ [AsADaemon,'As a Daemon',0,checkbox,1,'(\S*)',undef, + 'In Linux/BSD/Unix/OSX fork and close file handles, kinda like "perl assp.pl &" but better. Requires restart.'], + [myName,'My Name',20,textinput,'ASSP-nospam','(\S+)',undef, + 'What the program calls itself in the email "received by" header. Usually ASSP-nospam.'], +@@ -355,7 +355,7 @@ + No mail is delivered! For example: assp-notspam'], + [EmailWhitelist,'Add to Whitelist Address',20,textinput,'assp-white','(.*)',undef, + 'Any mail sent by local/authenticated users to this username will be interpreted as a request to add addresses to the whitelist.<br /> No mail is delivered! For example: assp-white'], +- [EmailFrom,'From Address for Email',20,textinput,'ASSP <>','(.+)',undef, ++ [EmailFrom,'From Address for Email',20,textinput,'ASSP <postmaster@yourdomain.com>','(.+)',undef, + 'Email sent from ASSP acknowledging your submissions will be sent from this address.<br /> + Some mailers don\'t like the default setting. For example: ASSP <> or Mail Administrator + <mailadmin@mydomain.com>'], +@@ -423,9 +423,9 @@ + 'ASSP closes and renames the log file after this number of days. Decimals are ok. For example: 14 or 0.5'], + + [0,0,0,heading,'Security'], +- [runAsUser,'Run as UID',20,textinput,'','(\S*)',undef, ++ [runAsUser,'Run as UID',20,textinput,'nobody','(\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,'nobody','(\S*)',undef, + 'The *nix group to assume after startup: assp or nogroup -- requires ASSP restart.'], + [ChangeRoot,'Change Root',60,textinput,'','(.*)',undef, + 'Non-blank means to run in chroot jail in *nix. You need an etc/protocols file to make this work<br /> +@@ -4462,4 +4462,4 @@ + dynablock.njabl.org + ); + } +-1; +\ No newline at end of file ++1; diff --git a/mail/assp/files/patch-stats.sh b/mail/assp/files/patch-stats.sh new file mode 100644 index 0000000..060ae16 --- /dev/null +++ b/mail/assp/files/patch-stats.sh @@ -0,0 +1,176 @@ +--- stats.sh.orig Fri Aug 6 20:26:26 2004 ++++ stats.sh Thu May 26 22:24:20 2005 +@@ -4,12 +4,12 @@ + # 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 ------------------------- + +@@ -30,8 +30,11 @@ + # 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 ++# RB (in Magenta) .. Blocked Relay attempt ++# HL (in Magenta) .. Blocked due to spam HELO ++# SP (in Magenta) .. Blocked by failed SPF lookup ++# WA+ Whitelist ADDITION by an authorized local user ++# WL+ Whitelist ADDITION of address CC'd in whitelisted email + # BA (in Cyan) .. Bad ATTACHEMENT rejected + # SR (in Cyan) .. spam@ report submission + # NS (in Cyan) .. notspam@ report submission +@@ -46,32 +49,32 @@ + # 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 | \ ++tail -300 -f /var/db/assp/maillog.txt | \ + awk ' \ + /whitelisted/ { \ +- printf("%s %s \033[1;32m%-15s L\033[0mW %s \033[1;32m->\033[0m %s\n", \ ++ 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", \ + 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", \ ++ /whitelist addition/ && /email new/ { \ ++ printf("%s %s \033[1;36m%-15s WA+ %s\033[0m \033[1;37m%s\033[0m\n", \ + substr($1,1,length($1)), \ + substr($2,1,length($2)), \ + "+email address+", \ +- substr($4,1,40), \ +- substr($6,1,length($6)) )\ ++ "-adds-", \ ++ substr($7,1,length($7)) )\ + } \ + /whitelist addition/ && !/email/ { \ +- printf("%s %s \033[1;32m%-15s W\033[0mL+ %s \033[1;32m %s %s\033[0m\n", \ ++ printf("%s %s \033[1;32m%-15s\033[0m \033[1;37mWL+ %s\033[0m \033[1;32m%s\033[0m \033[1;37m%s\033[0m\n", \ + substr($1,1,length($1)), \ + substr($2,1,length($2)), \ + substr($3,1,length($3)), \ +@@ -79,12 +82,12 @@ + "-adds-", \ + substr($9,1,length($9)) )\ + } \ +- /Bayesian spam/ { \ ++ /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($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/ { \ +@@ -95,7 +98,7 @@ + substr($4,1,40), \ + substr($6,1,length($6)) )\ + } \ +- /bad attachment/ { \ ++ /bad attachment/ && !/no bad/ { \ + printf("%s %s \033[1;35m%-15s BA %s -> %s\033[0m\n", \ + substr($1,1,length($1)), \ + substr($2,1,length($2)), \ +@@ -104,29 +107,66 @@ + 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", \ ++ printf("%s %s \033[1;35m%-15s RB %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($4,1,40), \ + substr($9,1,length($9)) )\ + } \ ++ /Invalid address rejected/ { \ ++ printf("%s %s \033[1;34m%-15s IR %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($NF,1,length($NF)) )\ ++ } \ ++ /malformed address/ { \ ++ printf("%s %s \033[1;35m%-15s MA %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($7,1,length($7)) )\ ++ } \ ++ /failed RBL checks/ { \ ++ printf("%s %s \033[1;35m%-15s BL %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)) )\ ++ } \ ++ /failed SPF checks/ { \ ++ printf("%s %s \033[1;35m%-15s SP %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)) )\ ++ } \ ++ /has spam helo/ { \ ++ printf("%s %s \033[1;35m%-15s HL %s -> %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)), \ ++ substr($10,1,length($10)) )\ ++ } \ + /Admin update:/ { \ +- printf("\033[1;33m%s %s %s %s %s %s \033[0m\n", $1, $2, $3, $4, $5, $6) \ ++ printf("\033[1;33m%s\033[0m\n", $0) \ + } \ + /Email spamreport/ { \ +- printf("%s %s\033[0;36m %-15s SR %s Email SPAM Submission\033[0m\n", \ ++ printf("%s %s\033[1;36m %-15s SR %s\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", \ ++ printf("%s %s\033[1;36m %-15s NS %s\033[0m\n", \ + substr($1,1,length($1)), \ + substr($2,1,length($2)), \ + substr($3,1,length($3)), \ diff --git a/mail/assp/files/periodic-assp.sh.in b/mail/assp/files/periodic-assp.sh.in new file mode 100644 index 0000000..6b76b89 --- /dev/null +++ b/mail/assp/files/periodic-assp.sh.in @@ -0,0 +1,31 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# Update ASSP Spam and ClamAV databases + +cd %%ASSP_HOME%% + +if [ ! -f %%PREFIX%%/lib/assp/rebuildspamdb.pl ] +then + echo "%%PREFIX%%/lib/assp/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 +fi + +exit $(($rc_spamdb|$rc_clamav)) diff --git a/mail/assp/files/pkg-install.in b/mail/assp/files/pkg-install.in new file mode 100644 index 0000000..b264dbe --- /dev/null +++ b/mail/assp/files/pkg-install.in @@ -0,0 +1,6 @@ +#!/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/*.txt %%ASSP_HOME%% +fi diff --git a/mail/assp/pkg-descr b/mail/assp/pkg-descr new file mode 100644 index 0000000..161c43f --- /dev/null +++ b/mail/assp/pkg-descr @@ -0,0 +1,21 @@ +Anti-Spam SMTP Proxy is a spam filter that sits on port 25 in front of your +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. + +ASSP offers: + - a whitelist of known good senders + - Bayesian checks on message headers and contents + - recipient address validation using LDAP and RFC822 conformance + - relay denial + - HELO checking + - SPF (Sender Policy Framework) checking + - DNSBL (DNS Block List) checking using many DNSBL services + - Virus detection + +ASSP is a single script with a web-based configuration tool. + +WWW: http://assp.sourceforge.net/ diff --git a/mail/assp/pkg-plist b/mail/assp/pkg-plist new file mode 100644 index 0000000..6da2c5f --- /dev/null +++ b/mail/assp/pkg-plist @@ -0,0 +1,25 @@ +etc/periodic/daily/510.assp +@unexec rmdir %D/etc/periodic/daily 2>/dev/null || true +@unexec rmdir %D/etc/periodic 2>/dev/null || true +lib/assp/addservice.pl +lib/assp/assp.pl +lib/assp/move2num.pl +lib/assp/notspamreport.txt +lib/assp/rebuildspamdb.pl +lib/assp/repair.pl +lib/assp/spamreport.txt +lib/assp/stat.pl +lib/assp/stats.sh +lib/assp/whitereport.txt +%%ASSP_CLAMAV%%lib/assp/freshclam.sh +@dirrm lib/assp +sbin/assp +sbin/assplog +%%PORTDOCS%%%%DOCSDIR%%/ASSP Documentation.htm +%%PORTDOCS%%%%DOCSDIR%%/Regular Expression Tutorial.htm +%%PORTDOCS%%@dirrm %%DOCSDIR%% +@unexec rm -f %%ASSP_HOME%%/notspamreport.txt 2>/dev/null || true +@unexec rm -f %%ASSP_HOME%%/spamreport.txt 2>/dev/null || true +@unexec rm -f %%ASSP_HOME%%/whitereport.txt 2>/dev/null || true +@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 |