Topic: Weird (?) postfix rewriting of invalid domains on incoming email
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? Old installer
- Linux/BSD distribution name and version: Ubuntu 16.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
I have a single incoming email that has shown some curious rewriting behaviour in postfix that I don't really understand. The logs don't really seem to provide any helpful insight - I may need to log more verbosely and try to reproduce the behaviour but I wondered if the behaviour had been seen before.
I run a few mail domains on my server: call them domain1.com, domain2.com ...
Let's say the mail server itself has hostname / DNS: mail.domain.com
I received an email today, along with some colleagues on other external services, from outside. My address details were correct and the email was delivered through postfix into dovecot on my domain.
However, one of the other To: email address had an invalid domain, call it email@example.com, which has no MX records available. Of course, I received my copy and my colleagues received their copies and I suppose the original sender received a bounce of some sort.
For some reason I don't understand, my postfix rewrote the baddomain.com incoming address, changing it to firstname.lastname@example.org in the email in my mailbox. When I did a reply-all, my server then threw an error message because email@example.com (of course) doesn't exist.
It's not a big problem, because you can edit the addressees and delete the problem name when you know it is there - but I'd prefer a more robust solution.
Looking at the replies received from colleagues, a few have mail servers that replace firstname.lastname@example.org with IMCEAINVALIDemail@example.com - is that a way that certain other products handle this? Others seem to have just dropped the offending address.
Any thoughts on this puzzle, please?