You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Peter Clark <pe...@innoviatech.com> on 2007/06/27 15:54:43 UTC

White list from external file?

We run an in house contacts program, I've exported every email  
address in it to a text file - My intention is to white list every  
individual email, what's the easiest way to do this? Ideally I'd be  
able to point the config to "look" at a text file that contains all  
these emails, and it'll auto white list them all. Failing that, I was  
going to add "whitelist_from" to the beginning of every line and  
append it to the local.cf!
There are over 3000 individual email addresses - if each was added  
individually to the local.cf - huge config! :)

Thanks!

Peter


Re: White list from external file?

Posted by Jari Fredriksson <ja...@iki.fi>.
Peter Clark wrote:
> We run an in house contacts program, I've exported every email
> address in it to a text file - My intention is to white list every
> individual email, what's the easiest way to do this? Ideally I'd be
> able to point the config to "look" at a text file that contains all
> these emails, and it'll auto white list them all. Failing that, I was
> going to add "whitelist_from" to the beginning of every line and
> append it to the local.cf!
> There are over 3000 individual email addresses - if each was added
> individually to the local.cf - huge config! :)

I have implemented this by using maildrop and calling spamc from it's /etc/maildroprc

maildrop has a C like scripting language and has a lookup() function which takes a look into a text file and tries to find the address from it.

A snippet from my /etc/maildroprc:

------------------------------------------------------------------------------

SCAN_SPAM=1

if ( /^From:\s*(.*)/ && lookup( $MATCH1, "/usr/etc/maildrop_sender_whitelist", "D" ))
{
    xfilter "reformail -a'X-Whitelisted: $MATCH1 in /usr/etc/maildrop_sender_whitelist'"
    SCAN_SPAM=0
}


if ( $SCAN_SPAM > 0 )
{
        xfilter "spamc -H -x -d spamd -u spam"
}
else
{
        xfilter "reformail -a'X-Whitelisted: because some reason earlier in /etc/maildroprc'"
}

------------------------------------------------------------------------------

The script has variable SCAN_SPAM which is set to 0 (false) by several checks and the system calls SpamAssassin only when necessary.

The script as shown works with maildrop 2.x, it has to be altered a bit when used with older versions.

Maildrop replaces the more usual procmail in  the mail delivery chain.

The file maildrop_sender_whitelist contains email addresses (or regexp) one on a line, it would be ideal for your purpose.




Re: White list from external file?

Posted by Duane Hill <d....@yournetplus.com>.
On Wed, 27 Jun 2007, Peter Clark wrote:

> We run an in house contacts program, I've exported every email address in it 
> to a text file - My intention is to white list every individual email, what's 
> the easiest way to do this? Ideally I'd be able to point the config to "look" 
> at a text file that contains all these emails, and it'll auto white list them 
> all. Failing that, I was going to add "whitelist_from" to the beginning of 
> every line and append it to the local.cf!
> There are over 3000 individual email addresses - if each was added 
> individually to the local.cf - huge config! :)

Have you considered using SQL?

http://wiki.apache.org/spamassassin/UsingSQL

Re: White list from external file?

Posted by Peter Clark <pe...@innoviatech.com>.
I think SQL is probably the way to go...


Spamassassin -> MPP (messagepartners) -> CommuniGate

On Jun 27, 2007, at 3:09 PM, John D. Hardin wrote:

> On Wed, 27 Jun 2007, Peter Clark wrote:
>
>> There are over 3000 individual email addresses - if each was added
>> individually to the local.cf - huge config! :)
>
> whitelisting is best done in whatever calls SA. How is SA hooked up to
> your MTA?


Re: White list from external file?

Posted by "John D. Hardin" <jh...@impsec.org>.
On Wed, 27 Jun 2007, Peter Clark wrote:

> There are over 3000 individual email addresses - if each was added
> individually to the local.cf - huge config! :)

whitelisting is best done in whatever calls SA. How is SA hooked up to 
your MTA?

--
 John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
 jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  Microsoft is not a standards body.
-----------------------------------------------------------------------
 7 days until The 231st anniversary of the Declaration of Independence