2

I did an apt-get update of a server "myserver.com" recently and now all emails sent from that server to email@myserver.com bounce with "user unknown". I believe that the server is trying to deliver to local users, but I am not sure why it changed to do this, or how to change it to send them correctly.

Any advice is welcomed! The messages are sent via the mail function in php.

EDIT:

Using Ubuntu 16

/etc/hostname is www-server.mydomain.com

/etc/hosts contains:

127.0.0.1   localhost www.mydomain.com admin.mydomain.com
127.0.1.1   mydomain

If I use sendmail on the commandline, I can send an email to myemail@gmail.com, or other email addresses, but I can no longer send to me@mydomain.com. With sendmail I don't know how to see what happens, but I have had users report emails sent to user@mydomain.com from my php based website bouncing back to the user with the message "user unknown".

If I send an email to me@mydomain.com from gmail, it works fine and I receive the email, so I know the problem is on this server

This all started happening after doing an apt-get upgrade (which had quite a few updates to do)

EDIT 2:

user@www-server:~# nslookup -query=mx mydomain.com
Server:     94.199.n.n
Address:    94.199.n.n#53

Non-authoritative answer:
mydomain.com    mail exchanger = 10 mail.mymailserver.com.

Authoritative answers can be found from:
mydomain.com    nameserver = ns2.domainprovider.com.
mydomain.com    nameserver = ns.domainprovider.com.
mail.mymailserver.com   internet address = 94.199.x.x
ns.domainprovider.com   internet address = 212.67.y.y
ns2.domainprovider.com  internet address = 62.138.z.z

Note: IP Address of this server is not mentioned in the nslookup output

Ben Holness
  • 914
  • 2
  • 10
  • 28
  • 1
    You are missing a lot of important information and what is there is confusing. It's tough to provide an answer on this. First, "myserver.com" would not be the name of your server, as "myserver" is a second level domain and servers would never "properly" be named like that. Your server would be "myserver.mydomain.com." In addition, you didn't specify where your e-mail is hosted, if it is on the same server, you didn't specify what e-mail daemon you're using. You also didn't specify anything about what operating system, which versions of what applications you updated, etc. – Appleoddity Oct 20 '17 at 04:34
  • your e-mail would be email@mydomain.com. – Appleoddity Oct 20 '17 at 04:37
  • What IPs are you using for your DNS resolvers on this server? Why do you have a `127.0.1.1 mydomain` in your hosts file? What happens if you do an `nslookup -query=mx mydomain.com` Do you receive back the records for your email hosting provider? I can only assume, based on your information, that the e-mail is hosted off-site somewhere, or on another server? – Appleoddity Oct 20 '17 at 04:52
  • I have no idea why the 127.0.1.1 is there, it was like that after the installation of the OS. I will add the output of nslookup to the main post in a second, but yes the records come back. Email is hosted on another server. – Ben Holness Oct 20 '17 at 04:58
  • Looks ok. See here if this helps: https://serverfault.com/questions/102647/sendmail-to-local-domain-ignoring-mx-records-part-2 – Appleoddity Oct 20 '17 at 05:06
  • This is linked to the other question somehow. Sorry I'm tired and on my phone if I missed something: https://serverfault.com/questions/65365/disable-local-delivery-in-sendmail – Appleoddity Oct 20 '17 at 05:12
  • No problem, I appreciate the response! I will look at the links, thanks! – Ben Holness Oct 20 '17 at 05:19

0 Answers0