|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: Postfix, transports and dspam
From: mouss (usebsd
free.fr)
Date: Wed Mar 01 2006 - 03:26:32 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Daniel a écrit :
> I've been having a heck of a time trying to get this working properly,
> and it seems to be a pretty simple matter. Either it's not as simple as
> I think it should be, or I'm drastically over-complicating it. So, if
> everyone here can bear with me and perhaps help me out, I'd greatly
> appreciate it.
>
> My server is setup with all virtual domains with the exception of
> localhost (which is specified in mydestination). I have dspam set up as
> a content filter (content_filter = lmtp:unix:/tmp/dspam.sock) in
> main.cf, and that seems to be working properly. All the mail I get is
> being tagged appropriately by dspam.
>
> All the messages that pass through dspam have a specific signature added
> to them that lets dspam keep track of them. Because of this, I'm
> supposed to be able to send a message back to dspam if it was flagged
> incorrectly (i.e., marked as spam when it isn't) to help dspam learn. I
> specify the unique signature, tell it the correction, and it updates its
> database. Simple, eh?
>
> So here's the problem. I'm trying to get it so when mail destined for
> spam
foxybanana.com is sent to dspam, it is run through a transport
> called dspam-retrain:spam. The dspam-retrain transport calls a script
> called dspam-retrain.pl via pipe, parses the message for the necessary
> information, and then updates the database. I want to do the exact same
> thing for notspam
foxybanana.com, but calling dspam-retrain:innocent.
>
> I have this transport defined properly in master.cf, and I have a table
> with the addresses and transport:nexthop in PostgreSQL (I've tried it as
> a hash table too with the same results). Postfix is pointed to the
> transports table via transport_maps = /etc/postfix/pgsql_transport.cf.
> If I query the spam or nospam addresses using postmap -q and that file,
> it returns the desired result.
>
> The problem seems to be that as soon as the mail comes into my postfix
> server, it hits the content_filter instead of the transport. This is
> great for all the e-mail coming through, but not for spam
and notspam
.
> Those do not need to be checked for spam again, but rather sent
> specifically to the dspam-retrain transport. I thought this would
> happen automatically if the recipient address matches with the addresses
> in the transport_maps, but I'm apparently mistaken. What do I need to
> do to get this to work the way I want?
>
If that was true, then one can't filter mail for users who have a
transport entry.
Possible approaches:
1) don't care.
2) You can use multiple instances (the instance feeding dspam will feed
it using transports and relayhost, not using content_filter). This is
the most flexible.
3) You could try a FILTER statement, if you accept that multi-recipient
mail with one of these addresses is an error. If so, just FILTER based
on these two recipients, pass all recipients to your retrain script, and
don't retrain if there are many recipients (log something instead).
In any case, make sure outsiders can't send mail to these addresses (the
signature is not a sufficient protection). search for local_only in the
archives and google on how to implement this.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]