1

Topic: Mail from secondary.mydomain.com to mydomain.com loops back to myself

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

Hello,

I run iRedMail server for some secondary mail tasks parallelly besides an external mail service. @mydomain.com is the external service, @secondary.mydomain.com is the iRedMail server. When trying to send a test mail from the iRedMail server to the external service then iRedMail server claims to handle the other one as well:

Reporting-MTA: dns; secondary.mydomain.com
X-Postfix-Queue-ID: 4Z8vvz29YJR0dvY
X-Postfix-Sender: rfc822; postmaster@secondary.mydomain.com
Arrival-Date: Sun,  9 Mar 2025 22:33:55 +0000 (UTC)

Final-Recipient: rfc822; me@mydomain.com
Original-Recipient: rfc822;me@mydomain.com
Action: failed
Status: 5.4.6
Diagnostic-Code: X-Postfix; mail for mydomain.com loops back to myself

Is there a way to avoid that behaviour?

Kind regards...

----

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

2

Re: Mail from secondary.mydomain.com to mydomain.com loops back to myself

I just found out that the same behaviour applies when I try sending to a completely different domain name, i.e. from secondary.mydomain.com to anotherdomain.com . Then I get...

...
Diagnostic-Code: X-Postfix; mail for anotherdomain.com loops back to myself

3

Re: Mail from secondary.mydomain.com to mydomain.com loops back to myself

What config files did you change?

4

Re: Mail from secondary.mydomain.com to mydomain.com loops back to myself

Hello.

Thank you for getting back to me.

I did not change anything manually. But I think I found the reason: There was some *.mydomain.com A-record which might have confused the internal name resolution. I deleted this one and cleaned up the DNS in general ... and mail got delivered. :-)

Kind regards...