Postfix rewrite sender: why doesn't this work

Posted by Nick Coleman on Server Fault See other posts from Server Fault or by Nick Coleman
Published on 2012-10-03T07:01:06Z Indexed on 2012/10/07 15:39 UTC
Read the original article Hit count: 436

Filed under:
|

I have server A with an IP address only and a dummy FQDN (on the basis all machines should have a FQDN): pants.net.invalid. All mail is relayed through another server elsewhere, which works fine.

On server A, Postfix rewrites the sender address with smtp_generic_maps = hash:/etc/postfix/generic. According to the Rewrite manual at http://www.postfix.org/ADDRESS_REWRITING_README.html#remote, this should rewrite all outgoing external mail's Sender address:

$ cat /etc/postfix/generic
@pants.net.invalid     [email protected]

but it does not. postmap -q [email protected] returns nothing.

This works:

[email protected]     [email protected]

It seems as though it is doing regex matching even though I specify type hash:. Clearly I am misunderstanding the manual.

I don't want to use regex or pcre expressions because there are only a couple of users (root and two others) and I don't want the overhead.

I can specify the users exactly and it works. But, I would like to know what I am misunderstanding for future reference.

Thanks.

© Server Fault or respective owner

Related posts about postfix

Related posts about sender-rewriting