mimedefang - Sendmail MIME mail filter ChangeLog

HOWTO


# MIMEDefang
# ==========
# See the wv howto if you want to be able to convert word docs into html.
# See contrib/word-to-html in the MD source tree.

# My rc.sendmail script (below) will run MD, and everything that it runs,
# as user 'mdefang'.  If you use LDAP, MySQL, etc. and useradd and groupadd
# aren't set up to add users and groups there, add a mdefang user and group
# there instead of running this.  Note: since I started using 'mdefang' long
# ago, the default refered to in the MD docs is 'defang'.
su
getent group | grep "^mdefang:" > /dev/null 2>&1 || groupadd mdefang
id mdefang > /dev/null 2>&1 || useradd -g mdefang -m mdefang
chmod 700 /home/mdefang
exit

# Before installing Perl modules below using the CPAN module, make sure you
# have the latest version of it too.
su -c "perl -MCPAN -e shell"
o conf prerequisites_policy follow
o conf make_install_arg UNINST=1
install Bundle::CPAN
exit

# =-=-=

## SpamAssassin and friends.  Everything up to the next =-=-= is used by
## SpamAssassin directly.  Everything after that (including SpamAssassin
## itself) is used by MIMEDefang directly.  Run this first to create the
## necessary directories for source and tarballs:
cd
mkdir -p -m 0700 installed/mimedefang/spamassassin \
src/mimedefang/spamassassin


# Vipul's Razor (optionally used by SpamAssassin)
# =============
# Instead of installing razor-agents-sdk, install/upgrade these perl modules:
su -c "perl -MCPAN -e shell"
o conf prerequisites_policy follow
o conf make_install_arg UNINST=1
install Time::HiRes
install Digest::SHA1
install MIME::Base64
install Test::Simple
install Test::Harness
install Getopt::Long
install File::Copy
install URI::Escape
exit

cd
test -f installed/mimedefang/spamassassin/razor-agents-2.85.tar.bz2 &&
mv installed/mimedefang/spamassassin/razor-agents-2.85.tar.bz2 .
test ! -f razor-agents-2.85.tar.bz2 &&
wget http://downloads.sf.net/razor/razor-agents-2.85.tar.bz2
cd src/mimedefang/spamassassin
find -maxdepth 1 -type d -name "razor-agents-*" -exec rm -r {} \;
tar xjvf ~/razor-agents-2.85.tar.bz2
cd razor-agents-2.85
test $UID = 0 && chown -R root:root .

# Read 'perldoc ./Changes'

perl Makefile.PL
make
make test

# Become root to install it
su

# Install it
make install

# If you're upgrading from < 2.70, read the man pages for razor-admin,
# razor-check, razor-report, razor-revoke.  razor-client has been
# deprecated.

# If this is the first time you're installing razor-agents, run this to
# create a default config file in ~mdefang/.razor/  Replace mdefang with
# whatever username you use to run MIMEDefang.
su mdefang -c "razor-admin -create ; chmod -R go-rwx ~mdefang/.razor"

# After you verify that everything is working OK, you may want to make sure
# that ~mdefang/.razor/razor-agent.log is either symlinked to /dev/null,
# rotated nightly, or set the debug level to 0 in razor-agent.conf
# It will grow and eat up a lot of drive space (and I/O resources) on a busy
# mail server.

# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+w .

# Become yourself again
exit

# If you plan on reporting Spam to razor ('man razor-report') and haven't
# already done this, while logged in as the non-root account you would be
# reporting Spams from, run this.  It will assign a password for you.
razor-admin -create
chmod -R go-rwx ~/.razor
razor-admin -register -user=you@yourdomain.org

## As of SpamAssassin 3.0.1, Razor is not used by default any more.  Make
## sure you set this in your SA configuration:
# use_razor2 1
## and make sure that this line in /etc/mail/spamassassin/v310.pre (after you
## upgrade SA below) is NOT commented out:
# loadplugin Mail::SpamAssassin::Plugin::Razor2

cd
rm -f installed/mimedefang/spamassassin/razor-agents-*.tar.*
mv razor-agents-2.85.tar.bz2 installed/mimedefang/spamassassin/


# DCC 1.3.132 (optionally used by SpamAssassin)
# ===========
# If you've already got a configured older version of DCC, you may
# want to take a look at /var/dcc/libexec/updatedcc.  I haven't
# tried it myself yet.

cd
test -f  installed/mimedefang/spamassassin/dcc-1.3.132.tar.bz2 &&
mv installed/mimedefang/spamassassin/dcc-1.3.132.tar.bz2 .
test ! dcc-1.3.132.tar.bz2 &&
test -f installed/mimedefang/spamassassin/dcc-1.3.132.tar.Z &&
  mv installed/mimedefang/spamassassin/dcc-1.3.132.tar.Z .
test ! -f dcc-1.3.132.tar.bz2 &&
test ! -f dcc-1.3.132.tar.Z &&
  wget http://www.rhyolite.com/dcc/source/old/dcc-1.3.132.tar.Z
test -f dcc-1.3.132.tar.Z &&
( uncompress dcc-1.3.132.tar.Z ; bzip2 -9 dcc-1.3.132.tar )
cd src/mimedefang/spamassassin
find -maxdepth 1 -type d -name "dcc-*" -exec rm -r {} \;
tar xjvf ~/dcc-1.3.132.tar.bz2
cd dcc-1.3.132
test $UID = 0 && chown -R root:root .

# Below we skip building dccd (server) and dccm (sendmail milter interface)
# because we don't need any of them to use DCC via SpamAssassin for
# MIMEDefang.  If you do want to build any of them, leave off the
# appropriate --disable-xxx option below.

./configure --disable-IPv6 --disable-server --disable-dccm
make

# Become root to install and configure it
su

# Install it
make install

# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+w .

# If it'll only be used with SA+MIMEDefang, you'll need to do something like
# this.  If you don't run MIMEDefang as user "mdefang", replace that with
# whatever account you do use.  If it'll be used elsewhere too, then you
# may want to go with a "dcc" group, then make that dir chmod 770.
chown -R mdefang /var/dcc

# If this is a first time installation:
test ! /var/dcc/map && /usr/local/bin/cdcc 'new map'
/usr/local/bin/cdcc 'add dcc.rhyolite.com'
/usr/local/bin/cdcc 'info'


# /var/dcc/dcc_conf and /var/dcc/dcc_conf-new:
test -f /var/dcc/dcc_conf-new &&
diff -u /var/dcc/dcc_conf /var/dcc/dcc_conf-new

## !! As of SpamAssassin 3.0.1, DCC is not used by default any more.
## !! Make sure you set this in your SA configuration:
# use_dcc 1
## and make sure that this line in /etc/mail/spamassassin/v310.pre (after you
## upgrade SA below) is NOT commented out:
# loadplugin Mail::SpamAssassin::Plugin::DCC
## See 'perldoc Mail::SpamAssassin::Plugin::DCC' for more info about
## configuration options for DCC.

## If you plan on setting up SA to use dccifd, which will be less resource
## intensive than having SA run dccproc, set these options in
## /var/dcc/dcc_conf:
# DCCD_ENABLE=off
# DCCM_ENABLE=off
# DCCIFD_ENABLE=on
#
## If dccifd is running and puts it's socket in /var/dcc, SpamAssassin will
## talk to dccifd instead of running dccproc.  If you will NOT be using
## dccifd, make sure you have this set in your SA configuration:
# dcc_path /usr/local/bin/dccproc
## If you want to make sure that SA uses dccifd, after starting it, set
## these SA configuration options (with SA+MD, you'll usually want to put
## them in /etc/mail/sa-mimedefang.cf):
# use_dcc 1
# dcc_home /var/dcc
# dcc_dccifd_path /var/dcc/dccifd

# Become yourself again
exit

cd
rm -f installed/mimedefang/spamassassin/dcc-*.tar.*
mv dcc-1.3.132.tar.bz2 installed/mimedefang/spamassassin/


# Pyzor 0.5 (optional)
# ===========
# Pyzor had not had a release since 0.4 on September 7, 2002 until
# 0.5 was released on May 7, 2009

# Prerequisites:
# Python

cd
test -f installed/mimedefang/spamassassin/pyzor-0.5.0.tar.bz2 &&
mv installed/mimedefang/spamassassin/pyzor-0.5.0.tar.bz2 .
test ! -f pyzor-0.5.0.tar.bz2 &&
wget http://downloads.sf.net/pyzor/pyzor-0.5.0.tar.bz2

# Verify tarball w/ sha1sum:
# (I couldn't find one elsewhere, so this will only prove that yours
# is the same as mine)
echo "ceb8a57dd3b281c06ebb62115123a629d348d3f1  pyzor-0.5.0.tar.bz2" | \
sha1sum -c

cd src/mimedefang/spamassassin
find -maxdepth 1 -type d -name "pyzor-*" -exec rm -r {} \;
tar xjvf ~/pyzor-0.5.0.tar.bz2
cd pyzor-0.5.0
test $UID = 0 && chown -R root:root .

# Become root to install it
su

## If building it fails with this error, you may need to re-build and
## install Python:
# ImportError: No module named _md5

python setup.py build
python setup.py install

# Make sure you don't have an old pyzor or pyzord in /usr/local/bin, the
# new ones will be in /usr/bin
test -f /usr/local/bin/pyzor && rm -f /usr/local/bin/pyzor
test -f /usr/local/bin/pyzord && rm -f /usr/local/bin/pyzord

# Read the usage docs:
lynx docs/usage.html

# Use 'pyzor discover' to get Pyzor to 'discover' a server
# As I write this, you should be good to go if you have this:
# public.pyzor.org:24441
# in ~mdefang/.pyzor/servers (after you run it)
su mdefang -c "pyzor discover"

# See if you can get a response from the server(s) that is/are set.
# Make sure your firewall allows port 24441/udp outbound to the Pyzor
# server.  You should get something like this:
# public.pyzor.org:24441 (200, 'OK')
# (possibly with a few Python complaints)
su mdefang -c "pyzor ping" 2> /dev/null

# Become yourself again
exit

cd
rm -f installed/mimedefang/spamassassin/pyzor-*.tar.*
mv pyzor-0.5.0.tar.bz2 installed/mimedefang/spamassassin/

# =-=-=

# MIMEDefang and friends.  Everything from here on is used directly by
# MIMEDefang.  Run this to create the necessary directories for source and
# tarballs:
mkdir -p -m 0700 ~/installed/mimedefang ~/src/mimedefang


# SpamAssassin 3.3.1 (optional)
# ==================
# Install required Perl modules (there will be more if you use an old
# version of Perl)

# If you're going to use the DKIM or DomainKeys plugins, you'll need
# to install Crypt::OpenSSL::Random and RSA.  I'll handle that first,
# without CPAN because you need to modify their Makefile.PL if your
# OpenSSL is installed under /usr/local/ssl like mine.

# Crypt::OpenSSL::Random 0.04
cd
test ! -f Crypt-OpenSSL-Random-0.04.tar.gz &&
wget http://cpan.perl.org/modules/by-module/Crypt/\
Crypt-OpenSSL-Random-0.04.tar.gz
tar xzvf Crypt-OpenSSL-Random-0.04.tar.gz
cd Crypt-OpenSSL-Random-0.04
chmod -R u+w .
# If your OpenSSL is installed under /usr/local/ssl...
# Open up Makefile.PL and add "-L/usr/local/ssl/lib " to the
# beginning of the LIBS line after the [' and add
# "-I/usr/local/ssl/include" to the beginning of the INC line
perl Makefile.PL
make
su -c "make install ; chown -R $USER . ; chmod -R u+w ."
cd
rm -r Crypt-OpenSSL-Random-0.04
rm Crypt-OpenSSL-Random-0.04.tar.gz

# Crypt::OpenSSL::RSA 0.25
cd
test ! -f Crypt-OpenSSL-RSA-0.25.tar.gz &&
wget http://cpan.perl.org/modules/by-module/Crypt/\
Crypt-OpenSSL-RSA-0.25.tar.gz
tar xzvf Crypt-OpenSSL-RSA-0.25.tar.gz
cd Crypt-OpenSSL-RSA-0.25
chmod -R u+w .
# If your OpenSSL is installed under /usr/local/ssl...
# Open up Makefile.PL and add "-L/usr/local/ssl/lib " to the
# beginning of the LIBS line after the [' and replace the
# $include line near the top with this one (which assumes
# that you don't use Kerberos):
# my $include = "-I/usr/local/ssl/include";
perl Makefile.PL
make
su -c "make install ; chown -R $USER . ; chmod -R u+w ."
cd
rm -r Crypt-OpenSSL-RSA-0.25
rm Crypt-OpenSSL-RSA-0.25.tar.gz

# Now you can install DKIM and DomainKeys modules, mentioned below

# Install the rest
su -c "perl -MCPAN -e shell"
o conf prerequisites_policy follow
o conf make_install_arg UNINST=1
install Digest::SHA1
install HTML::Parser
install Net::DNS
install LWP
install HTTP::Date
install IO::Zlib
install Archive::Tar
install MIME::Base64
install DB_File
install Net::SMTP
install Time::HiRes

# If you want to be able to use SPF checks:
# install Net::DNS::Resolver::Programmable
# install NetAddr::IP
# install Mail::SPF
# install Mail::SPF::Query

# If you want to use the RelayCountry plugin:
# install IP::Country::Fast

# If you're going to use spamd's --auth-ident option:
# install Net::Ident

# If you use IPv6:
# install IO::Socket::INET6

# If you won't be using MIMEDefang, but will be using spamc with
# spamd:
# install IO::Socket::SSL
# install Compress::Zlib

# For the DKIM plugin:
# install Mail::DKIM

# For the DomainKeys plugin:
# install Mail::DomainKeys

# For the normalize_charset config setting:
# install Data::Dump
# install Encode::Detect

# Quit out of CPAN
exit


cd
test -f installed/mimedefang/spamassassin/Mail-SpamAssassin-3.3.1.tar.bz2 &&
mv installed/mimedefang/spamassassin/Mail-SpamAssassin-3.3.1.tar.bz2 .
test ! -f Mail-SpamAssassin-3.3.1.tar.bz2 &&
wget http://www.apache.org/dist/spamassassin/source/\
Mail-SpamAssassin-3.3.1.tar.bz2

# Verify tarball w/ md5sum:
echo "bb977900c3b2627db13e9f44f9b5bfc8  Mail-SpamAssassin-3.3.1.tar.bz2" |
md5sum -c

# Verify tarball w/ sha1sum:
echo "f5748043eb286b1acb456093039a55db00c6f25e  Mail-SpamAssassin-3.3.1.\
tar.bz2" | sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys F7D39814 > /dev/null 2>&1 || gpg --recv-keys F7D39814 ) &&
wget -nc http://www.apache.org/dist/spamassassin/source/\
Mail-SpamAssassin-3.3.1.tar.bz2.asc &&
  gpg --verify Mail-SpamAssassin-3.3.1.tar.bz2.asc &&
   rm Mail-SpamAssassin-3.3.1.tar.bz2.asc

cd ~/src/mimedefang/spamassassin
find -maxdepth 1 -type d -name "Mail-SpamAssassin-*" -exec rm -r {} \;
tar xjvf ~/Mail-SpamAssassin-3.3.1.tar.bz2
cd Mail-SpamAssassin-3.3.1
test $UID = 0 && chown -R root:root .

# At this point you should read at least ./README and ./INSTALL and
# if this is an upgrade: ./UPGRADE and
# http://wiki.apache.org/spamassassin/UpgradeNotes

# Below I don't specify RUN_NET_TESTS=yes because you'd have to run 'make
# test' as the user that runs MIMEDefang, but that user won't have write
# permissions for the test files to be copied (the behind the scenes stuff
# that happens when you run 'make test').

perl Makefile.PL CONTACT_ADDRESS="postmaster@yourdomain.com" < /dev/null
make

# If you use LIDS (www.lids.org) or something like it that wouldn't like
# binding to ports, skip 'make test'.
make test

# Become root to install it
su

# Backup your existing SA configuration:
test ! -d ~/backup/sendmail/mimedefang/spamassasin &&
mkdir -p -m 0700 ~/backup/sendmail/mimedefang/spamassassin
test -f /etc/mail/sa-mimedefang.cf &&
cp -f /etc/mail/sa-mimedefang.cf ~/backup/sendmail/mimedefang/spamassassin/
test -d /etc/mail/spamassassin &&
tar cjvf ~/backup/sendmail/mimedefang/spamassassin/\
etc-mail-sa-`date +%Y%m%d`.tar.bz2 /etc/mail/spamassassin
test -d /usr/share/spamassassin &&
tar cjvf ~/backup/sendmail/mimedefang/spamassassin/\
usr-share-sa-`date +%Y%m%d`.tar.bz2 /usr/share/spamassassin

# These old man pages were in old versions of SA:
rm -f /usr/share/man/man3/Mail::SpamAssassin::ConfSourceSQL.3 \
/usr/share/man/man3/Mail::SpamAssassin::SMTP::SmartHost.3

## If you use Bayes with a 2.6x version of SA and upgrade it to 3.x, shut down
## MIMEDefang, then run this:
# su mdefang -c "sa-learn --rebuild -p /etc/mail/sa-mimedefang.cf"
## to sync your journal, then install the new SA ('make install' below), then
## run this to rebuild the Bayes db in the new format:
# su mdefang -c "sa-learn --sync -p /etc/mail/sa-mimedefang.cf"
## If you have a weird setup like I do, replace the path to sa-mimedefang.cf
## with the path to your actual config file (whatever has bayes_path defined
## in it).

# Install it
make install

# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+w .

# You may want to remove some or all of the rules in
# /usr/share/spamassassin/60_whitelist.cf, they leave open several Spammer
# holes for any Spammer that's seen SA's rules.
mv /usr/share/spamassassin/60_whitelist.cf \
/usr/share/spamassassin/60_whitelist.cf.orig

## If you run sa-learn (man sa-learn) to update things, just remember to
## pass your MD/SA config file to it so it can find the correct files and
## directories:
# -p /etc/mail/sa-mimedefang.cf

# Add this to your /etc/mail/sa-mimedefang.cf if you're using
# SA on a low-volume mail server for personal use:
# score RCVD_IN_BL_SPAMCOP_NET 4

# /etc/mail/spamassassin/*.pre files define plugins that will be loaded.
# If you want to, for example, globaly disable Pyzor, you'd open up
# /etc/mail/spamassassin/v310.pre and comment out this line:
# loadplugin Mail::SpamAssassin::Plugin::Pyzor
#
# For plugin-specific docs, read 'perldoc Mail::SpamAssassin::Plugin::xxxx'

# If you want to set up SA to use MySQL for AWL and/or Bayes, see
# sql/README.awl and sql/README.bayes

# If you want to keep your SpamAssassin rules updated, read 'man sa-update'
# and http://wiki.apache.org/spamassassin/RuleUpdates

# Become yourself again
exit

cd
rm -f installed/mimedefang/spamassassin/Mail-SpamAssassin-*.tar.*
mv Mail-SpamAssassin-3.3.1.tar.bz2 installed/mimedefang/spamassassin/


# Anomy::HTMLCleaner 1.26 (HTML cleaner - optional)
# =======================
su -c "perl -MCPAN -e shell"
o conf prerequisites_policy follow
o conf make_install_arg UNINST=1
install MIME::Base64
install MIME::QuotedPrint
exit

cd
test -f installed/mimedefang/anomy-HTMLCleaner-1.26.tar.gz &&
mv installed/mimedefang/anomy-HTMLCleaner-1.26.tar.gz .
test ! -f anomy-HTMLCleaner-1.26.tar.gz &&
wget http://mailtools.anomy.net/dist/anomy-HTMLCleaner-1.26.tar.gz

# Become root to install it
su

# This should figure out what version of perl you have, then extract the
# Anomy tarball into /usr/lib/perl5/site_perl/x.x.x/Anomy/
PERLVER=`perl --version | egrep "^This is perl" | awk '{ print $4 }' | \
cut -c2-`
test -d /usr/lib/perl5/site_perl/$PERLVER/Anomy &&
rm -r /usr/lib/perl5/site_perl/$PERLVER/Anomy
tar xzvf ./anomy-HTMLCleaner-1.26.tar.gz -C \
/usr/lib/perl5/site_perl/$PERLVER
chown -R root:root /usr/lib/perl5/site_perl/$PERLVER/Anomy
chmod 644 /usr/lib/perl5/site_perl/$PERLVER/Anomy/*
unset PERLVER

# Become yourself again
exit

cd
rm -f installed/mimedefang/anomy-HTMLCleaner-*.tar.gz
mv anomy-HTMLCleaner-1.26.tar.gz installed/mimedefang/


# File::Scan (virus scanner - optional):
# ==========
# This is so infrequently updated that it really won't do you any good any
# more.  As of MIMEDefang 2.58, support for File::Scan is no longer
# included.  Just use ClamAV.

su -c "perl -MCPAN -e shell"
o conf prerequisites_policy follow
o conf make_install_arg UNINST=1
install File::Scan
exit


# perl modules required by MD:
su -c "perl -MCPAN -e shell"
o conf prerequisites_policy follow
o conf make_install_arg UNINST=1
install IO::Stringy
install MIME::Base64
install Mail::Util
install Digest::SHA1
install HTML::Parser
install Unix::Syslog
install MIME::Tools
exit


# Remove the source and tarball for the old RP-Patched-02 version of
# MIME::Tools if they exist:
cd
test -f installed/mimedefang/MIME-tools-5.411a-RP-Patched-02.tar.gz &&
rm installed/mimedefang/MIME-tools-5.411a-RP-Patched-02.tar.gz
cd src/mimedefang
find -maxdepth 1 -type d -name "MIME-tools-*" -exec rm -r {} \;


# MIMEDefang 2.71
# ===============
# You can install them afterward, but you may want to install ClamAV and
# any other anti-virus scanners you were planning on installing now.
# Otherwise you'll have to rebuild and reinstall MIMEDefang, or modify your
# filter for it to see them.

cd
test -f installed/mimedefang/mimedefang-2.71.tar.gz &&
mv installed/mimedefang/mimedefang-2.71.tar.gz .
test ! -f mimedefang-2.71.tar.gz &&
wget http://www.mimedefang.org/static/mimedefang-2.71.tar.gz

# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "a5ff39051b0fb9021352e1a5f0b01f72  mimedefang-2.71.tar.gz" | md5sum -c

# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "bb3a8f96bc0ab6bd07777dcda40a2578475cdf04  mimedefang-2.71.tar.gz" | \
sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 126F42E0 > /dev/null 2>&1 || gpg --recv-keys 126F42E0 ) &&
wget -nc http://www.mimedefang.org/static/mimedefang-2.71.tar.gz.sig &&
  gpg --verify mimedefang-2.71.tar.gz.sig && rm mimedefang-2.71.tar.gz.sig

cd src/mimedefang
find -maxdepth 1 -type d -name "mimedefang-*" -exec rm -r {} \;
tar xzvf ~/mimedefang-2.71.tar.gz
cd mimedefang-2.71
test $UID = 0 && chown -R root:root .

# If you built sendmail with LDAPMAP, add this to the beginning of the
# configure line:
# LIBS=-lresolv

./configure \
--with-user=mdefang \
--with-spooldir=/ram/MIMEDefang
make

# Become root to install it
su

# As of MD 2.44, sa-mimedefang.cf was moved from /etc/mail/spamassassin/
# to /etc/mail/, we'll move it below if you haven't already

test ! -f /etc/mail/sa-mimedefang.cf &&
test -f /etc/mail/spamassassin/sa-mimedefang.cf &&
  mv /etc/mail/spamassassin/sa-mimedefang.cf /etc/mail/
test -f /etc/mail/sa-mimedefang.cf &&
( mkdir -p -m 0700 ~/backup/sendmail
   cp -f /etc/mail/sa-mimedefang.cf ~/backup/sendmail/ )
make install
cp examples/init-script /etc/rc.d/rc.mimedefang
chmod 755 /etc/rc.d/rc.mimedefang

# Comment out the sendmail startup code in rc.M
# Grab this rc.sendmail and put it in /etc/rc.d
# Add something to rc.local to run 'rc.sendmail start' on boot-up
# rc.sendmail will use rc.mimedefang to start|stop|restart mimedefang
# and see the top for other things it will stop|start|restart like
# sophie, trophie, clamd, etc.
cd /etc/rc.d
test -f rc.sendmail &&
( mv -f rc.sendmail rc.sendmail.old ; chmod 600 rc.sendmail.old )
wget http://englanders.us/pub/linux/misc/rc.sendmail
chmod +x rc.sendmail

# Override some of the defaults in rc.mimedefang (see it for lots more):
# (you'll want to skip this if you've already customized it)
echo "MX_STATS_SYSLOG=yes" >> /etc/mail/mimedefang.conf
echo "MX_MAXIMUM=20" >> /etc/mail/mimedefang.conf
echo "MX_MAX_RSS=30000" >> /etc/mail/mimedefang.conf
echo "MX_MAX_AS=90000" >> /etc/mail/mimedefang.conf

## Add this to your .mc file for sendmail (all on one line without the #'s ):
# INPUT_MAIL_FILTER(`mimedefang', `S=unix:/ram/MIMEDefang/mimedefang.sock, F=T,
# T=S:60s;R:60s;E:5m')
## ...or maybe like this, especially if you'll be doing lots of virus
## scanning for lots of mail:
# INPUT_MAIL_FILTER(`mimedefang', `S=unix:/ram/MIMEDefang/mimedefang.sock, F=T,
# T=C:5m,S:5m;R:5m;E:5m')

# Do this if you want to periodically clean out old MD quarantine directories
# (a must on high volume mail servers, if you quarantine a lot of messages)
# FYI, these pretty much does the same thing:
# find /ram/MIMEDefang -type f -name 'mdefang-*' -mtime +1 -print0 | \
#  xargs -0 rm
# find /var/spool/MD-Quarantine -maxdepth 1 -type d -name 'qdir-*' \
#  -mtime +7 -print0 | xargs -0 rm -r
mkdir -p -m 0700 ~/sbin
cd ~/sbin
wget -N http://englanders.us/pub/linux/misc/cleanupmd.pl
chmod 700 cleanupmd.pl
#
## And create a cron job to run it like this:
# Clean up old MIMEDefang queue directories at 4am:
# 0 4 * * *       /root/sbin/cleanupmd.pl

## If you installed DCC above, add this line to your
## /etc/mail/sa-mimedefang.cf (if you don't use dccifd):
# dcc_path /usr/local/bin/dccproc

## If you installed Pyzor above, add this line to your
## /etc/mail/sa-mimedefang.cf:
# pyzor_path /usr/local/bin/pyzor

# Become yourself again
exit

cd
rm -f installed/mimedefang/mimedefang-*.tar.gz
mv mimedefang-2.71.tar.gz installed/mimedefang/

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EST -0500)
HOWTO last updated: 2010-11-02 12:27am
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]