...
Return-Path: <[email protected]>
...
Received-SPF: none (google.com: [email protected] does not designate permitted sender hosts) client-ip=10.23.58.124;
Authentication-Results: mx.google.com;
spf=neutral (google.com: [email protected] does not designate permitted sender hosts) smtp.mail=[email protected]
Return-Path: <[email protected]>
...
Received-SPF: none (google.com: [email protected] does not designate permitted sender hosts) client-ip=10.23.58.124;
Authentication-Results: mx.google.com;
spf=neutral (google.com: [email protected] does not designate permitted sender hosts) smtp.mail=[email protected]
Since apache is a pseudo account in Linux, all messages sent to apache will go to root. Therefore, it might not be a good practice to use apache as the return-path, we'd be better to change the address.
Fortunately, Postifx has rules to rewrite the address at:
Generic mapping for outgoing SMTP mail
Let's see how we rewrite the return-path in Postfix.
- Set the parameter smtp_generic_maps to the database /etc/postfix/generic in /etc/postfix/main.cf.
- Map apache to another address no-reply:
- Create and activate the database.
- Don't forget to restart the service.
[root@test ~]# vi /etc/postfix/main.cf
...
smtp_generic_maps = hash:/etc/postfix/generic
[root@test ~]# vi /etc/postfix/generic
...
[email protected] [email protected]
[root@test ~]# postmap /etc/postfix/generic
[root@test ~]# service postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ]
...
Return-Path: <[email protected]>
...
Received-SPF: none (google.com: [email protected] does not designate permitted sender hosts) client-ip=10.23.58.124;
Authentication-Results: mx.google.com;
spf=neutral (google.com: [email protected] does not designate permitted sender hosts) smtp.mail=[email protected]
Return-Path: <[email protected]>
...
Received-SPF: none (google.com: [email protected] does not designate permitted sender hosts) client-ip=10.23.58.124;
Authentication-Results: mx.google.com;
spf=neutral (google.com: [email protected] does not designate permitted sender hosts) smtp.mail=[email protected]
We succeeded to rewrite the return-path and sender address in Postfix. But, wait a minute. There seems something unfinished. Yes, you're right. you can see that I left [email protected] in the status of:
... does not designate permitted sender hostsThis is a SPF issue. We can go further on this problem of sending a trusted email, please refer to my post for more details:
How to Make Your Mail Trusted by Gmail and Yahoo Mail