1

Topic: Undelivered Mail Returned to Sender Error

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer?downloadable installer
- Linux/BSD distribution name and version: ubuntu 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi everyone,

Why i'm experiencing Undelivered Mail return to sender error most of the time as below:

This is the mail system at host mydomain.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<me@mydomain.com>: Host or domain name not found. Name service error
    for name=mail.mydomain.com type=A: Host not found

"The scenario happens intermittently, even right after sending a message successfully to the same recipient and when i send another email to that recipient i'm getting mailer daemon."  What is really the problem?

Thanks,
JunG

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Undelivered Mail Returned to Sender Error

This is the mail system at host mydomain.com
Name service error for name=mail.mydomain.com

Seems you have an MX record for mydomain.com pointing at mail.mydomain.com, but mail.mydomain.com has no A record.
Adding an A record for mail.mydomain.com should fix the problem

3

Re: Undelivered Mail Returned to Sender Error

Hi Cthulhu,

Thanks for the info.  I will ask our webmaster to add A record as per your advise.
However, what i did on my end is that, i enabled the ipv6 in /etc/postfix/main.cf and in ubuntu also. I will observe if this will temporarily fix this issue.

Thanks,
JunG

4

Re: Undelivered Mail Returned to Sender Error

Hi Cthulhu,

As i can see from the cpanel, there is an A record entry in mail.mydomain.com. but still getting not found error, even after changing the value of inet_protocol and inet_interfaces in /etc/postfix/main.cf  wherein the vlaue is "All" and restarted the postfix.

I've also changed the  inet_protocol and inet_interfaces value to "ipv4" but still not resolved.

Below is the /etc/resolv.conf
nameserver 127.0.0.53
options edns0

Any help is much appreciated.

Thanks.
JunG

5

Re: Undelivered Mail Returned to Sender Error

So you run an DNS resolver on your own machine?

apt-get install dnsutils

Then:
dig A mail.mydomain.com @127.0.0.53
dig AAAA mail.mydomain.com @127.0.0.53

dig A mail.mydomain.com @1.1.1.1
dig AAAA mail.mydomain.com @1.1.1.1

First gets the ipv4 and ipv6 entries for mail.mydomain,com useing your own DNS resolver
Second uses the cloudflare one.

Check if the results differ, if yes then the problem is caused by your local DNS resolver and undependant to iredmail

6

Re: Undelivered Mail Returned to Sender Error

Hi Cthulhu,

Sorry for the late reply...

Below is the output after executing the command.

So you run an DNS resolver on your own machine? 
output: I installed the iredmail on premise and point the iredmail server local IP Address to public address.

dig A mail.mydomain.com @127.0.0.53
   ;mail.mydomain.com. 0  IN    A    IP Address of my iredmail server

dig AAAA mail.mydomain.com @127.0.0.53
  ;mail.mydomain.com.  IN   AAAA

dig A mail.mydomain.com @1.1.1.1
   ;; connection timed out; no servers could be reached

dig AAAA mail.mydomain.com @1.1.1.1
   ;; connection timed out; no servers could be reached


My question is:
1. In /etc/resolv.conf, what should be the correct nameserver ip?
    below is the entry in /etc/resolv.conf
         nameserver    127.0.0.53
         options edns0
   
Thanks,
JunG