Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In order to migrate to a new mailserver with little dns problems/downtime, I have set up a second postfix that is currently accessible on a subdomain mx record, eg. the main postfix accepts mail for user@example.com while the second postfix also accepts mail for user@mx2.example.com.

I added a forwarding rule to postfix saying that postfix should forward mail destined for user@example.com to user@example.com (for regular local delivery) and to user@mx2.example.com. Local delivery still works as expected, but when trying forward the mail to the new mx, postfix appeds the domain part at the end of the forwarding address, resulting in user@mx2.example.com.example.com, which of course fails and the mail bounces.

Why does postfix mess with the alias name in that way and how can I turn that of?

share|improve this question
add comment

2 Answers

That sounds complicated. Why not just lower the TTL on the MX record. Leave the old server intact temporarily. Change the MX record. Wait until the TTL expires and you confirm that email is flowing to the new server. Collect any remaining email on the old server, and finally, decomission the old server.

share|improve this answer
add comment

By default, Postfix will append the server's domain to the end of locally submitted mail. This is described here: Postfix Configuration Parameters: append_dot_mydomain (default: yes)

append_dot_mydomain (default: yes)
With locally submitted mail, append the string ".$mydomain" to addresses that have no ".domain" information. With remotely submitted mail, append the string ".$remote_header_rewrite_domain" instead.

Note 1: this feature is enabled by default. If disabled, users will not be able to send mail to "user@partialdomainname" but will have to specify full domain names instead.

Note 2: with Postfix version 2.2, message header address rewriting happens only when one of the following conditions is true:

The message is received with the Postfix sendmail(1) command,
The message is received from a network client that matches $local_header_rewrite_clients,
The message is received from the network, and the remote_header_rewrite_domain parameter specifies a non-empty value.
To get the behavior before Postfix version 2.2, specify "local_header_rewrite_clients = static:all".

You can either change your mail forwarding rule by adding a trailing dot, or turn append_dot_mydomain off in main.cf.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.