Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have seen many references to this problem on server fault and all over the internet, but none of the solutions has fixed my problem.

I am running Sendmail 8.14.4 on Ubuntu 13.10, this is a webserver only (call it and handles no incoming or outgoing email other than to send out automated messages to users via php mail(). Any incoming mail to is handled via a different server setup through an MX record and works as expected. As seems to be a frequent problem any email sent from the server to is locally routed and fails, but any other domain works as expected.

I have tried numerous solutions including adding define(`confDONT_PROBE_INTERFACES', `True')dnl to /etc/mail/, then running sendmailconfig and restarting sendmail. However, it does not fix the issue and on running the command echo $=w | sendmail -bt still appears in the list. I have removed from /etc/mail/local-host-names, but is there anywhere else I need to remove it? Do I need to remove any references in /etc/hosts? When I run hostname is reported, can I change this and if I did would it cause problems with any other services?

Giving up on this solution I also tried to set up a relay by adding the following to

define(`MAIL_HUB', `')dnl
define(`LOCAL_RELAY', `')dnl

However, this has also failed to fix the problem. What am I missing? I would prefer to have the email sent straight from the server if possible rather than relaying it, but at this stage any solution would be good!

Update: I have now changed the hostname to and it seems to now be hitting the mailserver correctly rather than routing locally. However I'm now getting an error saying unknown user? The mailserver has a forwarding account set up for that specific user although no actual mail box, is this a problem? I have added the log below:

Jan 27 12:13:31 www sendmail[1839]: s0RCDV3n001839: from=www-data, size=129, class=0, nrcpts=2, msgid=<>, relay=www-data@localhost
Jan 27 12:13:32 www sm-mta[1841]: s0RCDVtW001841: from=<>, size=401, class=0, nrcpts=2, msgid=<>, proto=ESMTP, daemon=MTA-v4, relay=localhost []
Jan 27 12:13:32 www sendmail[1839]: s0RCDV3n001839:,, ctladdr=www-data (33/33), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=60129, relay=[] [], dsn=2.0.0, stat=Sent (s0RCDVtW001841 Message accepted for delivery)
Jan 27 12:13:32 www sm-mta[1843]: STARTTLS=client,, version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Jan 27 12:13:36 www sm-mta[1843]: s0RCDVtW001841: to=<>, ctladdr=<> (33/33), delay=00:00:05, xdelay=00:00:04, mailer=esmtp, pri=150401, [], dsn=2.0.0, stat=Sent (Ok: queued as 378B22A89BC)
Jan 27 12:13:36 www sm-mta[1843]: STARTTLS=client,, version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Jan 27 12:13:36 www sm-mta[1843]: s0RCDVtW001841: to=<>, ctladdr=<> (33/33), delay=00:00:05, xdelay=00:00:00, mailer=esmtp, pri=150401, [], dsn=5.1.1, stat=User unknown
Jan 27 12:13:36 www sm-mta[1843]: s0RCDVtW001841: s0RCDatW001843: DSN: User unknown
Jan 27 12:13:37 www sm-mta[1843]: s0RCDatW001843: to=<>, delay=00:00:01, xdelay=00:00:01, mailer=local, pri=30000, dsn=2.0.0, stat=Sent

I have tested the user via a telnet connection to the mailserver and the user was accepted.

share|improve this question
up vote 1 down vote accepted

your server should have a (FQDN) hostname other than After that check sendmail configuration for LOCAL_DOMAIN settings. Remove '' entries if you have and have only localhost and the FQDN.

Dont forget to recompile sendmails configs after changing the .mc files.

Bests, Semir

share|improve this answer
Thank you, this does seem to have made sendmail check the MX record rather than routing locally, although I'm now getting an Unknown user error, please see the updated question. – baseten Jan 27 '14 at 12:37
check all your domain settings (have valid PTR for eg). – Semirke Jan 27 '14 at 13:01
@blask That's a different issue entirely. Please don't put separate issues in the same question after it was answered. – Michael Hampton Jan 27 '14 at 14:47
@MichaelHampton fair point, I have asked another question here:… – baseten Jan 27 '14 at 15:37

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.