I've got monit running on a server to alert by email with the following config
set mailserver 127.0.0.1
using hostname "vps1.sender.com"
set mail-format { from: [email protected] }
set alert [email protected]
but the mails are still coming through with a hostname of localhost
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>
It's the only config file I have.
What am I missing?
In monitrc edit/add the line:
check system vps1.sender.com
and vps1.sender.com will be shown as the host on the email
Monit uses
/etc/hostname
and/etc/hosts
files for fqdn. If you did not setup those files, hostname file includeslocalhost
line by default. You must change this to your fqdn and setyourIP fqdn
in /etc/hosts file.The problem was a configuration issue with postfix.
Make sure the
myhostname=
variable is set correctly in /etc/postfix/main.cf. Apparently monit cant override that setting.