[Mimedefang] mimedefang, spamassassin, multiple domains

David F. Skoll dfs at roaringpenguin.com
Wed Oct 23 17:06:01 EDT 2002


On Wed, 23 Oct 2002, Dan Tulovsky wrote:

> According to the man page, only the sa-mimedefang.cf file should be read,
> yet my whitelists are working.

Because SA also drags in some files from other places, including
/usr/share/spamassassin/*

> I am asking because I want to implement different rules based on different
> domains.  The man page for mimedefang-filter says I can call the
> spamassassin functions with an argument that is the configuration file name.
> So I plan to have a spamassassin configuration file for each domain and call
> the spam_assassin_check([ $config_file ]) function depending on what domain
> I am working with.

This will not work, because MIMEDefang creates a persistent SpamAssassin
object.  So you can't change config files from one message to the next.

In CanIt-PRO, we implemented a blacklist/whitelist mechanism entirely
separate from SpamAssassin.  Basically, we do a stream_by_recipient
first (well, not quite, but for discussion purposes, close enough...)
and then look up the sender address, domain and relay host in an SQL
database.  (These lookups are also keyed by recipient address, so each
end-user can have his/her own blacklists and whitelists.)  If it's
whitelisted or blacklisted, we don't even bother calling SpamAssassin --
we just accept or reject the message right there and then.  In fact,
blacklisting is done right at the RCPT TO: SMTP command.

Storing blacklists/whitelists in files is nasty, because it's hard to
have a secure mechanism which allows individual users to edit their
own configuration files.  Using a proper database is much nicer.

Regards,

David.




More information about the MIMEDefang mailing list