Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 domain.com) and handles no incoming or outgoing email other than to send out automated messages to users via php mail(). Any incoming mail to someone@domain.com 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 someone@domain.com 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/sendmail.mc, then running sendmailconfig and restarting sendmail. However, it does not fix the issue and on running the command echo $=w | sendmail -bt domain.com still appears in the list. I have removed domain.com 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 domain.com 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 sendmail.mc:

define(`MAIL_HUB', `example.com.')dnl
define(`LOCAL_RELAY', `example.com.')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 www.domain.com 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=<201401271213.s0RCDV3n001839@www.domain.com>, relay=www-data@localhost
Jan 27 12:13:32 www sm-mta[1841]: s0RCDVtW001841: from=<www-data@www.domain.com>, size=401, class=0, nrcpts=2, msgid=<201401271213.s0RCDV3n001839@www.domain.com>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jan 27 12:13:32 www sendmail[1839]: s0RCDV3n001839: to=someone@domain.com,someone@anotherdomain.com, ctladdr=www-data (33/33), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=60129, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s0RCDVtW001841 Message accepted for delivery)
Jan 27 12:13:32 www sm-mta[1843]: STARTTLS=client, relay=spool.mail.gandi.net., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Jan 27 12:13:36 www sm-mta[1843]: s0RCDVtW001841: to=<someone@anotherdomain.com>, ctladdr=<www-data@www.domain.com> (33/33), delay=00:00:05, xdelay=00:00:04, mailer=esmtp, pri=150401, relay=spool.mail.gandi.net. [217.70.184.6], dsn=2.0.0, stat=Sent (Ok: queued as 378B22A89BC)
Jan 27 12:13:36 www sm-mta[1843]: STARTTLS=client, relay=mail.domain.com., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Jan 27 12:13:36 www sm-mta[1843]: s0RCDVtW001841: to=<someone@domain.com>, ctladdr=<www-data@www.domain.com> (33/33), delay=00:00:05, xdelay=00:00:00, mailer=esmtp, pri=150401, relay=mail.domain.com. [79.170.40.74], 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=<www-data@www.domain.com>, 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

1 Answer 1

up vote 1 down vote accepted

your server should have a (FQDN) hostname other than domain.com. After that check sendmail configuration for LOCAL_DOMAIN settings. Remove 'domain.com' 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. –  blask Jan 27 at 12:37
    
check all your domain settings (have valid PTR for eg). –  Semirke Jan 27 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 at 14:47
    
@MichaelHampton fair point, I have asked another question here: serverfault.com/questions/570170/… –  blask Jan 27 at 15:37

Your Answer

 
discard

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.