Question

I have a server from which I am trying to send myself an email. I have a domain name, example.com. The A record for example.com points to this server. The MX record points elsewhere. I have the email me@example.com.

When I try to send myself an email (using python smtplib), I get the following:

SMTPRecipientsRefused: {'me@example.com': (550, '5.1.1 <me@example.com>... User unknown')}

I can send emails to recipients with any other domain name just fine. I can also send emails to usernames that correspond to users that exist on the server, and these emails end up in the appropriate /var/spool/mail file. From this, it is obvious that the server believes it is the intended recipient of email sent to users of example.com.

I have already changed the hostname of the server to something other than example.com. This did not solve the problem.

I am using sendmail.

How do I get the server to realize that it is not the mail server for example.com?

Was it helpful?

Solution

Change the hostname to something other than example.com. Then:

If using sendmail:

apt-get install sendmail
sudo sendmailconfig

If using postfix:

sudo apt-get install postfix
sudo dpkg-reconfigure postfix
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top