Building MIMEDefang First you need to build Sendmail 8.12.8. Refer to building sendmail document. Prereques: http://www.roaringpenguin.com/mimedefang/#prereq Modules: IO::Stringy 1.211 http://www.roaringpenguin.com/mimedefang/IO-stringy-1.212.tar.gz IO::Handle Comes with Perl 5.8 Net::SMTP Net::Domain http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/libnet-1.13.tar.gz Mailtools Mail::Field 1.05 Mail::Header 1.01 Mail::Internet 1.0203 http://search.cpan.org/CPAN/authors/id/M/MA/MARKOV/MailTools-1.58.tar.gz http://www.roaringpenguin.com/mimedefang/MIME-tools-5.411a-RP-Patched-02.tar.gz MIME::Base64 2.11 http://search.cpan.org/author/JHI/perl-5.8.0/ext/MIME/Base64/Base64.pm (This is a part of Perl 5.8 now) Digest-SHA1-2.02 http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/Digest-SHA1-2.02.tar.gz Unix::Syslog http://search.cpan.org/CPAN/authors/id/M/MH/MHARNISCH/Unix-Syslog-0.100.tar.gz Mail::SpamAssassin http://search.cpan.org/CPAN/authors/id/J/JM/JMASON/Mail-SpamAssassin-2.50.tar.gz File::Scan http://search.cpan.org/CPAN/authors/id/H/HD/HDIAS/File-Scan-0.44.tar.gz HTML::Parser http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/HTML-Parser-3.27.tar.gz Perl-5.7 provide experimental core support for Unicode strings. You can compile HTML::Entities so that Unicode entities like € and € are decoded into a string containing "\x{20AC}". If you select no to the question below such entities will be left alone and only entities in the Latin-1 range is decoded. Do you want decoding on unicode entities? [no] (I answered no) Anomy::HTMLCleaner http://mailtools.anomy.net/dist/anomy-HTMLCleaner-1.19.tar.gz # gzip -d anomy-HTMLCleaner-1.19.tar.gz # tar xvf anomy-HTMLCleaner-1.19.tar # cd Anomy # On wsadmin02 # mkdir /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/Anomy # cp *.pm /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/Anomy/. on Mail relays # mkdir /opt/sfw/lib/perl5/site_perl/5.8.0/sun4-solaris/Anomy # cp *.pm /opt/sfw/lib/perl5/site_perl/5.8.0/sun4-solaris/Anomy/. Download from http://www.roaringpenguin.com/mimedefang/mimedefang-2.31.tar.gz Build on admin server workbench copy to wsadmin01:/build # cd /build # gzip -d mimedefang-2.31.tar.gz # tar xvf mimedefang-2.31.tar # cd mimedefang-2.31 # ./configure --prefix=/usr/local --with-milterlib=/build/sendmail-8.12.8/obj.SunOS.5.8.sun4/libmilter --with-milterinc=/build/sendmail-8.12.8/obj.SunOS.5.8.sun4/libmilter --disable-anti-virus Make sure the following message appear from configure: checking for Perl module IO::Socket... ok checking for Perl module MIME::Tools 5.410 ()... ok checking for Perl module MIME::WordDecoder... ok checking for Perl module Digest::SHA1... ok checking for Perl module Sys::Syslog... ok checking for Perl module Unix::Syslog... ok checking for Perl module Mail::SpamAssassin 1.6 or better... yes checking for Perl module Anomy::HTMLCleaner... yes checking for Perl module HTML::Parser... yes checking for Perl module File::Scan... yes checking that MIME-Tools has been patched... yes *** Virus scanner detection results: All virus-scanner detection disabled by --disable-anti-virus Could not find any recognized virus scanner... do not use any of the contains_virus functions in your filter. Found Mail::SpamAssassin. You may use spam_assassin_* functions Found Anomy::HTMLCleaner. You may use anomy_clean_html() Found HTML::Parser. You may use append_html_boilerplate() Note: SpamAssassin, File::Scan, HTML::Parser and Anomy::HTMLCleaner are detected at run-time, so if you install or remove any of those modules, you do not need to re-run ./configure and make a new mimedefang.pl. Note: The MIMEDefang user 'defang' does not seem to exist. Please create this user before continuing. Create defang account (refer to the document Configuring Sendmail SpamAssasin and MIMEDefang on how to setup the accounts and directories) # make install Now create the init script: /etc/init.d/mimedefang and put the following lines: #!/sbin/sh # # Startup init script for mimedefang # ########################################### #MAX_SLAVES=20 # added by K. Inscoe 19-Mar-2003 to spot 4.7.1 errors MAX_SLAVES=50 #MIN_SLAVES=10 # added by K. Inscoe 19-Mar-2003 to spot 4.7.1 errors MIN_SLAVES=30 BUSY_TIMEOUT=60 IDLE_TIMEOUT=300 #STATS_LOG="-t /var/log/md-stats" # added by K. Inscoe 19-Mar-2003 to spot 4.7.1 errors STATS_LOG="-t /var/log/md-stats" #FLUSH_STATS=-u # added by K. Inscoe 19-Mar-2003 to spot 4.7.1 errors FLUSH_STATS=-u DO_LOGGING=-l #RELAY_CHECK=-r #SENDER_CHECK=-s DEFANG_USER="-U defang" SOCKET_DIR=/var/spool/MIMEDefang PID_DIR=/var/spool/MIMEDefang MIMEDEFANG=/usr/local/bin/mimedefang MULTIPLEX=/usr/local/bin/mimedefang-multiplexor [ -x $MIMEDEFANG ] || exit 1 [ -x $MULTIPLEX ] || exit 1 case "$1" in 'start') echo "Starting MIMEDefang:" /usr/bin/rm -f $SOCKET_DIR/mimedefang.sock /usr/bin/rm -f $SOCKET_DIR/mimedefang-multiplexor.sock $MULTIPLEX -x $MAX_SLAVES \ -m $MIN_SLAVES \ -b $BUSY_TIMEOUT \ -i $IDLE_TIMEOUT \ $DO_LOGGING $STATS_LOG $FLUSH_STATS $DEFANG_USER \ -s $SOCKET_DIR/mimedefang-multiplexor.sock -p $PID_DIR/mdefang-mx.pid $MIMEDEFANG -m $SOCKET_DIR/mimedefang-multiplexor.sock $DEFANG_USER \ -p $SOCKET_DIR/mimedefang.sock $SENDER_CHECK $RELAY_CHECK \ -P $PID_DIR/mimedefang.pid ;; 'stop') echo "Stopping MIMEDefang:" /usr/bin/kill `cat $PID_DIR/mimedefang.pid` /usr/bin/kill `cat $PID_DIR/mdefang-mx.pid` /usr/bin/rm -f $PID_DIR/mimedefang.pid $PID_DIR/mdefang-mx.pid ;; 'restart') $0 stop /usr/bin/sleep 5 $0 start ;; 'hangup') echo "MIMEDefang Multiplexor Hangup for log rotation:" /usr/bin/kill -1 `cat $PID_DIR/mdefang-mx.pid` ;; 'reload') echo "MIMEDefang Multiplexor reloading filter rules:" /usr/bin/kill -INT `cat $PID_DIR/mdefang-mx.pid` ;; *) echo "Usage: $0 { start | stop | restart | hangup | reload }" exit 1 ;; esac exit 0 Before starting up MIMEDefang copy the configuration from either mail1 or mail2 from the following files: /etc/mail/mimedefang-filter /etc/mail/mimedefang-ip-key Now to install MIMEDefang on another host from the one it was compiled on: First of all if the above Perl modules are not installed you will need them installed first. Copy the following files to the remote server in the tmp directory: # scp /build/mimedefang-2.31/mimedefang-multiplexor kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/md-mx-ctrl kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/watch-mimedefang kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/mimedefang kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/mimedefang.pl kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/mimedefang.8 kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/watch-mimedefang.8 kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/mimedefang.pl.8 kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/mimedefang-multiplexor.8 kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/md-mx-ctrl.8 kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/mimedefang-filter.5 kinscoe@mail2:/tmp/. # scp /build/mimedefang-2.31/mimedefang-protocol.7 kinscoe@mail2:/tmp/. On the remote server make backups of the production files: # mkdir -p /usr/local/bin/old # cp /usr/local/bin/mimedefang-multiplexor /usr/local/bin/old/mimedefang-multiplexor # cp /usr/local/bin/md-mx-ctrl /usr/local/bin/old/md-mx-ctrl # cp /usr/local/bin/watch-mimedefang /usr/local/bin/old/watch-mimedefang # cp /usr/local/bin/mimedefang /usr/local/bin/old/mimedefang # cp /usr/local/bin/mimedefang.pl /usr/local/bin/old/mimedefang.pl # chmod 500 /usr/local/bin/old/* Install: Stop sendmail on the remote server: # /etc/init.d/sendmail stop Stop MIMEDefang on the remote server: # /etc/init.d/mimedefang stop On the remote server move from /tmp to the production directory: # mv /tmp/mimedefang-multiplexor /usr/local/bin/mimedefang-multiplexor # mv /tmp/md-mx-ctrl /usr/local/bin/md-mx-ctrl # mv /tmp/watch-mimedefang /usr/local/bin/watch-mimedefang # mv /tmp/mimedefang /usr/local/bin/mimedefang # mv /tmp/mimedefang.pl /usr/local/bin/mimedefang.pl # mv /tmp/mimedefang.8 /usr/local/man/man8/mimedefang.8 # mv /tmp/watch-mimedefang.8 /usr/local/man/man8/watch-mimedefang.8 # mv /tmp/mimedefang.pl.8 /usr/local/man/man8/mimedefang.pl.8 # mv /tmp/mimedefang-multiplexor.8 /usr/local/man/man8/mimedefang-multiplexor.8 # mv /tmp/md-mx-ctrl.8 /usr/local/man/man8/md-mx-ctrl.8 # mv /tmp/mimedefang-filter.5 /usr/local/man/man5/mimedefang-filter.5 # mv /tmp/mimedefang-protocol.7 /usr/local/man/man7/mimedefang-protocol.7 Now fix the perl line in mimedefang.pl Verify where the perl interprator is located: # which perl /opt/sfw/bin/perl Edit /usr/local/bin/mimedefang.pl and change the line: #!/usr/local/bin/perl -w to #!/opt/sfw/bin/perl -w # chown root:other /usr/local/bin/* # cmhod +x /usr/local/bin Restart MIMEDefang on remote server: # /etc/init.d/mimedefang start Change the line in /etc/mail/sendmail.cf sendmail.cf:Xmimedefang, S=unix:/var/spool/MIMEDefang/mimedefang.sock, T=S:5m;R:5m;E:5m to sendmail.cf:Xmimedefang, S=unix:/var/spool/MIMEDefang/mimedefang-multiplexor.sock, T=S:5m;R:5m;E:5m If it is not already set that way. Restart sendmail on remote server: # /etc/init.d/sendmail start