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 think it may be triggering spam filters. The header looks as follows:

Received: from (localhost.localdomain [])

How can I get rid of localhost.localdomain? I'm running Centos

/etc/hosts: localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.        wor
share|improve this question
Could you post your /etc/hosts, /etc/hostname and /etc/host.conf files? – horacv Jan 29 '11 at 19:59

I doubt this is triggering spam filters. Its hard to say without more headers, but this is common for an application running on the same machine as the smtp server. The app is submitting the message through localhost.

But you can check /etc/hosts to ensure your host name is setup correctly. As well you can check your smtp server to ensure its using the proper host name.

share|improve this answer
+1 I have a feeling the content of the message might be the issue. – Jacob Jan 29 '11 at 22:00
I've worked with quite a few spam filters and have never seen one throw a fuss over the message originating from 'localhost' in an existing receive header. – Chris S Mar 29 '13 at 2:19
@ChrisS I have seen this behavior (in a SpamAssassin ruleset from MANY years ago - and it was fixed the same day as a bug), but I wouldn't consider it typical or even likely. – voretaq7 Mar 29 '13 at 2:23


insert between and other entries, the FQDN you want, aka

The mail server picks up the first entry for ( since that is the connection used ) that has a . in it, aka FQDN.

So if you have servername localhost localhost.localdomain

You will show. Received: from ( [])

But as Steven said, I also doubt it is triggering spam filters.

share|improve this answer

Try the command hostname -f to see what your fully qualified name is. If you don't have a static address with the appropriate DNS entries use your ISP's relay to send email.

If you are sending email as localhost or localhost.localdomain, it will run into problems with spam filters. Your mail server must use its FQDN (fully qualified domain name) to send to the Internet (not required for your ISP's relay server).

Try sending email to an external email account you have access to and check the headers there. It is common to see email sent to the mail server from localhost or localhost.localdomain. The mail server must then use its name to forward the email.

Normally, your email server should known its FQDN so you should get received lines like:

Received: from localhost.localdomain ([])
          (envelope-sender <>)
          by (qmail-ldap-1.03) with SMTP
          for <>; 29 Nov 2010 00:11:37 -0000
Received: from ([])
          (envelope-sender <>)
          by with ESMTP
          for <>; 29 Nov 2010 00:11:39 -0000
share|improve this answer

I found an issue changing the order of the server names in /etc/host

before : myserver myserver.server.corp

will add a localhost header

after : myserver.server.corp myserver

will ignore the localhost header

share|improve this answer
This is exactly the same as becomingwisest's answer. Unfortunately the premise of the question is wrong, so this is a non-answer... – Chris S Mar 29 '13 at 2:18

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.