我有一个服务器上运行monit运行通过电子邮件警报以下configuration
set mailserver 127.0.0.1 using hostname "vps1.sender.com" set mail-format { from: [email protected] } set alert [email protected]
但邮件仍然通过本地主机的主机名来通过
Aug 7 08:40:55 mx1 postfix/smtpd[31060]: NOQUEUE: reject: RCPT from vps1.sender.com[xx.xx.xx.xx]: 504 5.5.2 <localhost>: Helo command rejected: need fully-qualified hostname; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<localhost>
这是我唯一的configuration文件。
我错过了什么?
这个问题是postfix的configuration问题。
确保/etc/postfix/main.cf中的myhostname=variables设置正确。 显然monit不能重写该设置。
Monit使用fqdn的/etc/hostname和/etc/hosts文件。 如果你没有设置这些文件,主机名文件默认包含localhost行。 您必须将其更改为您的fqdn并在/ etc / hosts文件中设置您的yourIP fqdn 。