Index:
[thread]
[date]
[author]
[stats]
From: markus schnalke <meillo@marmaro.de>
To : <masqmail@marmaro.de>
Date: Wed, 22 Feb 2012 16:42:02 +0100
Re: [masqmail] Different route depending the FROM header
[2012-02-22 10:23] "Sebastian M. Alvarez" <sebastianmalvarez@gmail.com>
> Hey..
Welcome!
> I have a little script resolves the piped emails coming from masqmail.
>
> I need to pipe to a script if the from passes a regex (or similar case)
> and fallback to other pipe is it does not..
>
> I've been googling a way to do this but nothing came up. Is there
> a way to change select a route depending on email headers?, or add
> conditions at the default.route script to change the pipe option
> depending on the headers?
Generally, an MTA does not operate on the message headers but the
envelope addresses. This means, masqmail (normally) does not examine
To:, Cc:, From:, etc headers, but deals with the `MAIL FROM' and
`RCPT TO' addresses it receives in the SMTP dialog.
Often the envelope addresses match the header addresses. Maybe the
envelope addresses are what you actually want.
You need to set up two routes, for each of the pipes. Then you need to
limit the routes to allowed and disallowed addresses.
Do you use a 0.3.x version? There you can use `allowed_recipients',
`denied_recipients', `allowed_senders', and `denied_senders'.
If you use a 0.2.x version? There you can use `allowed_mail_locals',
`not_allowed_mail_locals', `allowed_return_paths', and
`not_allowed_return_paths'. (There are also `allowed_rcpt_domains' and
`not_allowed_rcpt_domains'.) It's not as easy in the 0.2.x versions,
but also possible.
(Return path is the MAIL FROM, and often equal to the From: header.)
Hope that helps. Otherwise, just ask again. :-)
meillo
Index:
[thread]
[date]
[author]
[stats]