I usePostfixAfter a long time, I have seen many knowledge points about Postfix and want to share them with others. Let's talk about the address Operation Problems in Postfix.
1. Rewrite the address to the standard format
Before the cleanup process performs a Table query, it prefers to request the trivial-rewrite process to rewrite the new mail address to the standard user@fully.qualified.domain format. The purpose of rewriting is to reduce the number of entries in the query table and improve the query efficiency. The trivial-rewrite process can rewrite the following addresses:
* Write the address containing the source route information such as @ hosta and @ hostb: user @ site as user @ site because postfix does not support the address format containing the source route information.
* Rewrite the address in the form of user % domain to the form of user @ domain. This feature can be controlled through the allow_percent_hack parameter. The default value is yes.
* Rewrite the address containing only the user to user @ $ myorigin. This feature can be controlled through the append_at_myorigin parameter. The default value is yes. It is recommended that you do not change the default value because most postfix processes are better at handling emails with addresses such as user @ $ myorigin.
* Rewrite the address like user @ host to user @ host. $ mydomain. This feature can be controlled through the append_dot_mydomain parameter. The default value is yes.
* Rewrite the address, such as user @ site. to user @ site, that is, remove the last vertex number.
2. Regular address ing
Before the cleanup process saves a new email to the incoming message queue, the cleanup process will rewrite the address according to the query specification table to make it more readable. It is mainly used to replace the address in the Firstname. Lastname style and clear invalid fields. The default postfix does not require regular address rewriting. You can specify the value of the canonical_maps parameter to make it take effect. For example:
Canonical_maps = hash:/etc/postfix/canonical
You can also specify different rewrite specifications for the recipient and sender addresses respectively. In this case, the priority of sender_canonical_maps and recipient_canonical_maps is higher than that of canonical_maps. For example:
Sender_canonical_maps = hash:/etc/postfix/sender_canonical
Recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
3. Address Spoofing
Is to rewrite the address like the user@host.domain to user @ domain or user@other.domain, as if it was sent from another mail server. This function is disabled by default. You can use the masquerade_domains parameter to make it take effect. For example:
Masquerade_domains = $ mydomain
You can also use the masquerade_exceptions parameter to protect specific users from address spoofing, for example:
Masquerade_exceptions = root
Note: Address Spoofing only applies to the sender address.