Postfix: mail loops back to myself
I have the feeling that my issue is not very complicated (if you know Postfix that is) or maybe my reasoning is wrong but I can’t seem to make it work. I hope somebody can point me in the right direction!
I am trying to set up a local mailserver on my macmini loaded with OS X Server (all latest versions) The sole purpose would be sending calendar invitations via the local email server.
I am using the same domain name.
My (hosted) email address looks like this: name@domain.com and runs on the host server.
My local server address is: server.domain.com.
I created an extra A record for mail: mail.domain.com.
My server has a machine record for mail.domain.com and a mail exchanger (MX) record also for mail.domain.com.
My local server Mail setting is: Provide mail for: domain.com (not mail.domain.com). I am not sure if this is correct, both ways allow mail to be send, both ways result in the loop error.
My issue: from my OSX Server account (name@mail.domain.com) I can send email to any address except to name@domain.com. Whatever I do (tried several suggestions altering the main.cf file) it keeps returning my email with the ‘mail for domain.com loops back to myself’ error.
Sending an email from my name@domain.com account to name@mail.domain.com works fine. Sending a mail from name@mail.domain.com to name@mail.domain.com (to the same address) also works fine.
I experimented with these lines in main.cf:
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = domain.com
myhostname = mail.domain.com
I tried many variables but the loop error doesn’t go away…
I hope somebody knows how to configure the main.cf file to fix this looping error!
Many thanks in advance.
Pepijn.