I think it may be triggering spam filters. The header looks as follows:

Received: from wordswithfriends.net (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.wordswithfriends.net        wor
  • 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.

  • +1 I have a feeling the content of the message might be the issue. – Jacob Jan 29 '11 at 22:00
  • 1
    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 wordswithfriends.net

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 wordswithfriends.net servername localhost localhost.localdomain

You will show. Received: from wordswithfriends.net (wordswithfriends.net [])

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


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 <somebody@example.com>)
          by mail.example.com (qmail-ldap-1.03) with SMTP
          for <recipent@example.net>; 29 Nov 2010 00:11:37 -0000
Received: from mail.example.com ([])
          (envelope-sender <somebody@example.com>)
          by mx.example.net with ESMTP
          for <recipent@example.net>; 29 Nov 2010 00:11:39 -0000

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

  • 1
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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