SA Bugzilla – Bug 4501
Import blacklists/whitelists from referenced external files
Last modified: 2011-08-15 04:31:45 UTC
I would like to tell SA to read addresses to add to blacklist_to, whitelist_from etc. from a separate file, like this: blacklist_from file:/etc/mail/blacklist This file would be a standard simple one-item-per-line file, with # denoting comments. The reason that the existing include mechanism isn't sufficient is that I want to share this file with other programs, which don't understand SA's keywords. (More specifically, I want to put spamtrap addresses in the file. The file would then be used to fetch addresses to put on webpages as well as to control the MTA and SA.) This could of course be generalised in two ways: 1) By adding more import mechanisms such as "db:" and "http:" in addition to plain text files, and 2) by allowing it in other places, such as rules. I guess that I could accomplish my specific goal by writing a plugin, but what do you say, have this been discussed?
Subject: Re: New: Import blacklists/whitelists from referenced external files On Mon, Jul 25, 2005 at 12:05:26PM -0700, bugzilla-daemon@bugzilla.spamassassin.org wrote: > I guess that I could accomplish my specific goal by writing a plugin, but what > do you say, have this been discussed? My first thought is that it sounds like a modification/addition to the accessdb eval/plugin.
It would seem to me that the easiest solution, which will allow you to > share this file with other programs, which don't understand SA's keywords, is to create your own external file, in whatever format you want, and have your own program which regularly passes the file generating output for each program that needs this data (SA being only one of them). Then, if your /etc/mail/blacklist file contains entries like uid@example.com, *@example2.com, uid@example3.*, you simply read this file in, and create the corresponding blacklist_from entries in /etc/spamassassin/myblacklist.cf, repeating this process daily or weekly or whenever you want. Unless others have similar need (and I don't remember such a desire being discussed in the past year or so), then it seems this is a much more efficient solution for you (and will happen faster than waiting for devs to figure out how to do something generalized).
Looks like the AccessDB plugin does more-or-less exactly this. this would definitely be best implemented as a patch to that plugin.
Remember that basic users wish to have names associated with addresses. That's how they appear in any mail system. whitelist_from with its monolithic blob of addresses makes it hard for the user to remember who is who. Therefore the Mail::SpamAssassin::Conf should say how the basic user can have a list like Bob Holmes <bh@example.com> Will Thrill <wt@example.org> etc.