You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by malatio <le...@gmail.com> on 2009/01/22 01:53:15 UTC

Whitelisting or passing messeges using db query

How could I hook spamassassin up to a script that connects to my db (mysql)
and marks a message as non-spam if it finds that the 'To' address is found
in a certain table?

I'm administrating a mail system that receives many messages per day to
thousands of unique addresses @mydomain. The addresses aren't associated
with mailboxes on my system, I funnel them to a catchall address and collect
them. I get a fair amount of spam that I want to take care of but I want to
make sure that messages that go to any one of these special set of thousands
of specific addresses never get filtered as spam. 

I have a list of all of the 'To' addresses which messages being sent to
should never be marked as spam in a mySQL db. New addresses are constantly
being added to the list at around 500/day, so I want to have spamassasin (or
some other part of my qmail system) actively query the db to make this check
instead of maintaining a periodically updated list on the mail server.
-- 
View this message in context: http://www.nabble.com/Whitelisting-or-passing-messeges-using-db-query-tp21593715p21593715.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: Whitelisting or passing messeges using db query

Posted by Evan Platt <ev...@espphotography.com>.
The "To" address is merely a piece of text. I can send a message to 
you, but have it say To: nobody@anywhere.com"..

I'm not sure if what you want to do is possible with spamassassin, 
but sounds like it should be done with your MTA, or maybe procmail or 
something?

At 04:53 PM 1/21/2009, you wrote:

>How could I hook spamassassin up to a script that connects to my db (mysql)
>and marks a message as non-spam if it finds that the 'To' address is found
>in a certain table?
>
>I'm administrating a mail system that receives many messages per day to
>thousands of unique addresses @mydomain. The addresses aren't associated
>with mailboxes on my system, I funnel them to a catchall address and collect
>them. I get a fair amount of spam that I want to take care of but I want to
>make sure that messages that go to any one of these special set of thousands
>of specific addresses never get filtered as spam.
>
>I have a list of all of the 'To' addresses which messages being sent to
>should never be marked as spam in a mySQL db. New addresses are constantly
>being added to the list at around 500/day, so I want to have spamassasin (or
>some other part of my qmail system) actively query the db to make this check
>instead of maintaining a periodically updated list on the mail server.


Re: Whitelisting or passing messeges using db query

Posted by Martin Gregorie <ma...@gregorie.org>.
On Wed, 2009-01-21 at 16:53 -0800, malatio wrote:
> How could I hook spamassassin up to a script that connects to my db (mysql)
> and marks a message as non-spam if it finds that the 'To' address is found
> in a certain table?
> 
Write a plugin that does the lookup and returns a reply that can be used
in an interface rule.

I've done something similar, based on the SendOut.pm plugin, which can
be found at:
http://whatever.frukt.org/mdf-sentoutdb.text.shtml

If the query is at all elaborate, you might find the plugin can be
simplified by creating a view to select the target addresses put a
simple query that searches the view in your plugin. 

Martin