ALL RIGHTS RESERVED TO THE AUTHOR(S) OF THE ORIGINAL ARTICLE(S)
Address rewriting allows changing outgoing email ID or domain name itself. This is good for hiding internal user names. For example:
SMTP user: tom-01
EMAIL ID: tom@domain.com
Server name: server01.hosting.com
However when tom-01 send an email from shell prompt or using php it looks like it was send from tom-01@server01.hosting.com
In some cases internal hosts have no valid Internet domain name, and instead use a name such as localdomain.local or something else. This can be a problem when you want to send mail over the Internet, because many mail servers reject mail addresses with invalid domain names to avoid spam.
Postfix MTA offers smtp_generic_maps parameter. You can specify lookup tables that replace local mail addresses by valid Internet addresses when mail leaves the machine via SMTP.
Open your main.cf file
Code: Select all
# vi /etc/postfix/main.cf
Code: Select all
smtp_generic_maps = hash:/etc/postfix/generic
Code: Select all
# vi /etc/postfix/generic
Code: Select all
tom-01@server01.hosting.com tom@domain.com
Code: Select all
# postmap /etc/postfix/generic
Code: Select all
# /etc/init.d/postfix restart