Search code examples
emailloopspostfix-mtamail-serveriredmail

Mail loops back to myself


So, i have set up iredmail in iredadmin with 2 virtual domains, one is domain.com and another is domain.net

The domain.net is used for testing / development purposed so since the mail server launched, we stopped using it anymore, hence it was disabled in iredadmin.

And now we're facing problem that we just knew:

Everytime we wanted to send email from domain.com to domain.net i always received mailer daemon which is

"Undelivered Mail Returned to Sender"

Mail for domain.net loops back to myself

What to do? Here's my postfix main.cf file:

myhostname = domain.com
myorigin = domain.com
mydestination = localhost, localhost.localdomain, domain.com
mydomain = domain.com
virtual_alias_domains = 

Any advice about how to fix this error? Thanks in advance


Solution

  • Postfix doesn't know that it is also responsible for the .net address. Just add it to mydestination and everything should be fine.

    mydestination = localhost, localhost.localdomain, domain.com, domain.net
    

    Alternatively, if all mail to domain.net was to go to a single user, one would use virtual aliases:

    virtual_alias_domains = domain.net
    virtual_alias_maps = static:root
    

    This would redirect all mail to domain.net to your root user. No change to mydestination is neccessary in that case.