postfix发送邮件到阿里云邮箱被拒解决方案
错误如下:
31398 Apr 25 17:22:39 AY130531173153591e6cZ postfix/smtp[17402]: 761B4A041E: to=, relay=mx2.mail.aliyun.com[110. 75.48.150]:25, delay=0.12, delays=0.03/0/0.07/0.02, dsn=5.0.0, status=bounced (host mx2.mail.aliyun.com[110.75.48.150] said: 500 Error: bad syntax (in reply to MAIL FROM command))
重点是“in reply to MAIL FROM command”
需要修改outgoing mail address。
步骤如下:
1. 在 /etc/postfix/main.cf中加入
smtp_generic_maps = hash:/etc/postfix/generic
2. 生成generic文件
echo 'www-data yourusername@yourdomain.com' >> /etc/postfix/generic newaliases
3. 重启postfix
postmap /etc/postfix/generic service postfix restart