Maverix: SMTP proxy for AOLserver 4.x Release 1.9.1 vlad@crystalballinc.com Maverix, Anti-Spam and Anti-Virus solution for AOLServer This is AOLserver (www.aolserver.com) module that implements SMTP protocol and acts as SMTP proxy with anti-spam and anti-virus capabilities. It includes Web interface to manage quarantined messages and administrative interface based on OSSWEB . *Compiling and Installing* To compile and run nsmaverix module special patch to AOLserver 4.x should be applied or already patched server downloaded from FTP site. It enables non-HTTP module support in the AOLServer driver infrastucture. To support anti-SPAM feature one of the following should be installed: * SpamAssasin * DSPAM : patched version . To support anti-virus feature one of the following should be installed: * ClamAV * Sophos: SAVI PostgreSQL server should be installed and running before installing OSSWEB and Maverix. Download and install patched version of AOLserver. It already includes required modules such as: nscache, nssha1, nspostgres. wget ftp://ftp.crystalballinc.com/pub/vlad/aolserver-4.1-vlad-src.tar.gz tar -xzf aolserver-4.1-vlad.tar.gz cd aolserver-4.1 ./configure make install Download and install patched version of DSPAM. If PostgreSQL client library and headers are not installed in /usr/include and /usr/lib, then edit dspam-configure.sh and specify correct path: wget ftp://ftp.crystalballinc.com/pub/vlad/dspam-3.0.0-vlad-src.tar.gz tar -xzf dspam-3.0.0-vlad.tar.gz cd dspam-3.0.0 ./dspam-configure.sh make install Download and install ClamAV, no patches necessary so it can be downloaded from the primary site as well: wget ftp://ftp.crystalballinc.com/pub/vlad/clamav-0.73.tar.gz tar -xzfclamav-.73.tar.gz cd clamav-0.73 ./configure --disable-clamav make install Download and install OSSWEB. If PostgreSQL is running under different user than you, then edit Makefile.config and change dbuser variable: wget ftp://ftp.crystalballinc.com/pub/vlad/ossweb.tar.gz tar -xzf ossweb.tar.gz cd ossweb make create_db make init make install If database user is not you then add DBUSER=user to every make command: make create_db DBUSER=user make init DBUSER=user By default OSSWEB AOLserver listens on 127.0.0.1:4080. To change edit /usr/local/aolserver/etc/nsd.tcl section ns/server/${server}/module/nssock, parameters address, hostname and port. If valid resolvable hostname is given, then address parameter can be omitted completely. Download and install Maverix. Edit Makefile to reflect correct flags and paths to the installed software: wget ftp://ftp.crystalballinc.com/pub/vlad/nsmaverix.tar.gz tar -xzf nsmaverix.tar.gz cd nsmaverix make make install *Configuring* Add the following configuration directives to the nsd.tcl file, modules section should already exist, so just add nsmaverix line there: ns_section "ns/server/${server}/modules" ns_param nsmaverix ${home}/bin/nsmaverix.so ns_section "ns/server/${server}/module/nsmaverix" ns_param port 2525 ns_param address 127.0.0.1 ns_param relay localhost:25 ns_param spamd localhost ns_param initproc maverix::init ns_param rcptproc maverix::handler::RCPT ns_param dataproc maverix::handler::DATA ns_param errorproc maverix::handler::ERROR Once enabled, maverix acts as SMTP server forwarding all messaged to configured real smtp server via relay parameter. for each SMTP command it calles configured Tcl handler which performs actual processing. The following changes should be applied to standard /etc/mail/sendmail.cf: SParse1 Rmaverix <@ $=w . > $#smtp $@ [127.0.0.1:2525] $: maverix < @ $1 > Rmaverix-sender <@ $=w . > $#smtp $@ [127.0.0.1:2525] $: maverix-sender < @ $1 > If you running postfix instead of sendmail then replace smtp port with port 2525 in /etc/postfix/master.cf for smtpd daemon and add the following lines into /etc/postfix/transport.map: maverix@`uname -n` smtp:[127.0.0.1:2525] maverix-sender@`uname -n` smtp:[127.0.0.1:2525] and type command postmap /etc/postfix/transport.map *Usage* There is ns_snmp command availabe to create SNMP sessions and make requests. ns_maverix usage: nsmaverix flag nsmaverix send nsmaverix relay nsmaverix local nsmaverix encode nsmaverix decode nsmaverix checkemail - parses email and returns as name@domain if valid nsmaverix checkdomain nsmaverix virusversion - returns version of anti-virus tool used nsmaverix spamversion - returns version of anti-spam tool used nsmaverix checkspam nsmaverix trainspam nsmaverix checkvirus nsmaverix sessions nsmaverix gethdr nsmaverix gethdrs nsmaverix getbody nsmaverix getfrom nsmaverix getfromdata nsmaverix setfrom nsmaverix setfromdata nsmaverix getrcpt nsmaverix getrcptdata nsmaverix addrcpt nsmaverix setrcptdata nsmaverix delrcpt nsmaverix setflag nsmaverix unsetflag nsmaverix getflag nsmaverix setreply nsmaverix getline nsmaverix dump *Licensing* Maverix is covered by GNU License. *Authors* Vlad Seryakov vlad@crystalballinc.com Eric Dean eric@crystalballinc.com