[Mimedefang] Custom Configuration

Aleksandar Milivojevic amilivojevic at pbl.ca
Fri Nov 12 09:15:46 EST 2004

Yang Xiao wrote:
> Hi all,
> I'm using amavisd-new and Maia as the web interface so that users can
> easily manage their w/b lists and spam/virus/attachment settings.
> However, I would still like to use MIMEDefang for
> 1. Envelope/header checking in filter_recipient() : reject anyone
> claims to be sending from the internal domain.
> 2. LDAP lookup on RCPT TO: verify valid mailbox before accepting data.
> but not anything else, because I want amavisd-new to handle spam and
> virus checking, is this possible? and how should I go about it?

Simply.  Install both Amavisd-new and MIMEDefang, and define both in 
sendmail.mc.  Sendmail will call them in order you put them in .mc file. 
  Second filter will see changes made by the first filter.  In your 
case, it seems it would be best to call MIMEDefang first, and 
amavisd-new second (no point doing expensive aniti-virus/spam if mail is 
going to be rejected earlier because of invalid envelop, plus you save 
some bandwith since message body is not transffered).

In MIMEDefang, you would use filter_sender (to check sender's address), 
filter_recipient (to check if recipient is valid, do not drop entire 
email here, simply reject recipients that are invalid here, mail can 
have more than one, and some might be valid), and filter_end (to check 
headers).  You'd probably need to install some LDAP perl modules.  If 
you are going to have persistent connection to LDAP server, make sure it 
is made from filter_init.

Aleksandar Milivojevic <amilivojevic at pbl.ca>    Pollard Banknote Limited
Systems Administrator                           1499 Buffalo Place
Tel: (204) 474-2323 ext 276                     Winnipeg, MB  R3T 1L7

More information about the MIMEDefang mailing list