Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got monit running on a server to alert by email with the following config

set mailserver
 using hostname ""

set mail-format { from: }

set alert

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[xx.xx.xx.xx]: 504 5.5.2 <localhost>: Helo command
 rejected: need fully-qualified hostname; from=<>
 to=<> proto=ESMTP helo=<localhost>

It's the only config file I have.

What am I missing?

share|improve this question
up vote 1 down vote accepted

The problem was a configuration issue with postfix.

Make sure the myhostname= variable is set correctly in /etc/postfix/ Apparently monit cant override that setting.

share|improve this answer

Monit uses /etc/hostname and /etc/hosts files for fqdn. If you did not setup those files, hostname file includes localhost line by default. You must change this to your fqdn and set yourIP fqdn in /etc/hosts file.

share|improve this answer
Both are set to – Christian Aug 7 '13 at 9:18
Does you subdomain registered in any DNS server? Or just named in server hosts file? – Sencer H. Aug 7 '13 at 9:21
Maybe we both looking wrong place! What if problem caused by mail service? While I read second time it dawned on me. <localhost> is printed in mail log. I think you must check your mail service configuration. – Sencer H. Aug 7 '13 at 9:37
I KNOW WHAT IT IS!! In postfix, it had myhostname=localhost how annoying! Thanks for your time though. – Christian Aug 7 '13 at 9:38
You're welcome. – Sencer H. Aug 7 '13 at 9:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.