On 2010-07-14 Hendra . wrote:
> I need a mail server with a catch-all address but limit the recipient
> pattern to [email protected], and forward it to an existing
> local account.
> The [email protected] is an auto-generated address by another
> application so these addresses will not be available as a lookup/map
> table to postfix.
Why? If you can auto-generate them, you can auto-map them for Postfix.
> So far the postfix server I've setup can already accept the catch-all
> address and forward it the local account as intended, however I want
> to reject those that do not match the xxxx-keyword pattern, even
> existing for existing account that doesn't have the keyword in the
> name.
> I've tried using the regexp in header_checks, but as soon as I added
> the negation, it doesn't work as expected.
> For example:
>
> !/^To: (.*)-keyword@(.*)$/ REJECT => all mails get rejected
That's probably because there are a *lot* headers in any given mail that
don't match this pattern. ;)
Try something like this:
if /^To: ....@example\.com$/
!/^To: (.*)-keyword@(.*)$/ REJECT
endif
Regards
Ansgar Wiechers
--
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky