2

I have a Postfix server that I am using as an outbound SMTP gateway for a mail server. The postfix server has a name such as smtp.domain1.com.

Now, I have users on my mail server that are trying to send messages to poorly formatted addresses, such as to user@domin. My postfix server is rewriting the address as [email protected].

How can I configure postfix to not rewrite the address and bounce the message if the address is not complete? I believe this can be done with the append_at_myorigin paramter, but the Postifx documentation says that this feature must not be turned off.

2 Answers 2

2

If you really want to stop postfix from rewriting addresses on any "local" mail, use

local_header_rewrite_clients =

"local" in this context means mail sent from the machine itself, and any clients that connect from IP addresses in "$mynetworks", which would likely be the case if this is an internal->external SMTP gateway.

The default setting is

local_header_rewrite_clients = permit_inet_interfaces

which causes postfix to rewrite addresses for mail when the client IP matches $inet_interfaces.

There are a bunch of other options to this parameter, which might allow you to be a bit more specific, cf. local_header_rewrite_clients docs on the postfix website

3
  • This actually is not local mail. This is a relay server for an external mail server.
    – Alex
    Commented Mar 23, 2011 at 15:28
  • By default, postfix will rewrite headers for clients it considers "local" but won't for "remote" clients, so long as "remote_header_rewrite_domain" is empty (the default). If you're relaying mail from clients that match $mynetworks, those are considered local. Is that the case?
    – malcolmpdx
    Commented Mar 23, 2011 at 15:33
  • Ok, yes it is relaying from clients that match $mynetworks. Thanks for the clarification.
    – Alex
    Commented Mar 23, 2011 at 15:43
0

I'm putting this because it could save someone a few hours of messing around.

Also check that postfix is actually receiving the correct FROM header in the first place. I use ssmtp to send mails throgh postfix and it was actually ssmtp which was overriding the FROM header. I needed to set

FromLineOverride=YES

in the ssmtp.conf file to stop it overriding the from address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .