This is a discussion on Re: Piping messages to programs w/multiple outputs within the mailing.postfix.users forums, part of the Mail Servers and Related category; This worked. What Victor said about the -f needing to be there was already in place.. probably from previous reading ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This worked. What Victor said about the -f needing to be there was already in place.. probably from previous reading in FILTER_README. Thanks for the help guys. On Thu, 5 Feb 2004, Noel Jones wrote: > On Thu, Feb 05, 2004 at 02:59:42PM -0600, Michael J. Dikkema wrote: > > > > Hello all, > > > > The company I work for is making an Anti-Spam appliance with Postfix as > > the MTA. I have some questions. > > > > Right now, messages destined for xyz.com are piped from postfix into my > > application, then back to sendmail -i. > > > > The first problem is that we need to have multiple outputs from the > > filter. The filter scans for a list of email addresses at xyz.com, then > > applies a per-user filter. I want to taint the subject line to let the > > user know that it's spam. User A could have the box trained such that the > > message is spam, while User B could have it trained as nonspam. When a > > message comes through in this case, I need to taint the subject line for > > User A, but not User B. How would I send this back into Postfix? I've > > thought of having my script make an SMTP connection to the ultimate > > destination, but that does away with the "backup MX" effect that this box > > currently has. > > Seems like you could just have your script submit multiple "sendmail > -i" commands, either one for each recipient, or if you can aggrate > recipients, one for each similar group. > > As an alternative, you can set filter_destination_recipient_limit = 1 > (where "filter" is the name of the transport in master.cf) to pass > your filter no more than one recipient per message. > > > > > > The second problem is that the message headers piped to my program do > > not have the full recipient list... ie: I get messages coming through that > > don't mention xyz.com in the headers at all. Is the destination in an > > environment variable or passed via argv somehow? > > > > Message headers have no relation to either the sender or recipient. > Envelope information can be passed to your filter by the postfix pipe > transport as command arguments. > > If you use the postfix "pipe" transport to send stuff to your filter, > it should look something like: > filter unix - n n - 10 pipe > flags=??? user=user:group > argv=/path/to/filter ${sender} -- ${recipient} > > man 8 pipe for details of the pipe transport. > > -- > Noel Jones > --- Michael J. Dikkema, CCNP, CCIP Network Consultant - Ikthuse Consulting mjd@moot.ca |