Dibly
Dibly

Reputation: 55

Not receiving emails to local users after configuring Postfix with external domain

I have configured Postfix running under Ubuntu server to only send emails, but since configuring with my external domain I am unable to receive (or send) emails to local accounts on the Ubuntu server .. e.g. root or myusername.As a result, I am not receiving any emails sent from internal systems such as cron or Smartd etc.

Running this command works :

echo "My message" | mail -s subject [email protected]

I am able to recieve the email on my gmail

However, this does not

echo "My message" | mail -s subject root

Looking at /var/log/mail, it appears to be appending my domainname to the send address..

Jan 29 11:48:46 media postfix/smtp[26029]: 6F3BEC0F80: to=<[email protected]>, orig_to=<root>, relay=none, delay=155925, delays=155925/0.04/0.06/0, dsn=4.4.1, status=deferred (connect to mydomain.com[EXTERNAL IP]:25: Connection refused)

In this example, I've replaced my actual domain with mydomain.com and EXTERNAL IP is my actual external IP address.

Upvotes: 2

Views: 562

Answers (1)

user451555
user451555

Reputation: 308

Open the file /etc/resolv.conf and checked each of the ip addresses with dig mx mydomain.com @IP_ADRESS_FROM_FILE

One of them apparently has not yet been updated and contained an old DNS record, because of which the Postfix worked incorrectly.

Upvotes: 1

Related Questions