Skip navigation

Postfix: mail loops back to myself

1535 Views 10 Replies Latest reply: Mar 1, 2013 1:36 AM by pepmachine RSS
pepmachine Level 1 Level 1 (5 points)
Currently Being Moderated
Feb 25, 2013 4:41 AM

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.

  • Linc Davis Level 10 Level 10 (108,150 points)
    Currently Being Moderated
    Feb 25, 2013 7:45 AM (in response to pepmachine)

    best_mx_transport (default: empty)
      

    Where the Postfix SMTP client should deliver mail when it detects a "mail loops back to myself" error condition. This happens when the local MTA is the best SMTP mail exchanger for a destination not listed in $mydestination, $inet_interfaces, $proxy_interfaces, $virtual_alias_domains, or $virtual_mailbox_domains. By default, the Postfix SMTP client returns such mail as undeliverable.

       

    Specify, for example, "best_mx_transport = local" to pass the mail from the Postfix SMTP client to the local(8) delivery agent. You can specify any message delivery "transport" or "transport:nexthop" that is defined in the master.cf file. See the transport(5) manual page for the syntax and meaning of "transport" or "transport:nexthop".

      

    However, this feature is expensive because it ties up a Postfix SMTP client process while the local(8) delivery agent is doing its work. It is more efficient (for Postfix) to list all hosted domains in a table or database.

     

    Postfix Configuration Parameters

     

    See also:

     

    smtp - mail loops back to myself | postfix - Server Fault

  • Linc Davis Level 10 Level 10 (108,150 points)
    Currently Being Moderated
    Feb 25, 2013 9:36 AM (in response to pepmachine)

    What does local MTA mean?

     

    Mail Transfer Agent. The SMTP server.

     

    Where do find best_mx_transport for example (in what file)?

     

    It's not in any file by default. You would add it to the main.cf file, which on OS X Server is

     

    /Library/Server/Mail/Config/postfix/main.cf

     

    How and where (in what file) do I list all hosted domains in a table or database?

     

    In the virtual_alias_domains parameter in main.cf.

     

    Can I show you the content of certain files so you can tell me what to change?

     

    That goes beyond what I have time for. You're trying to do very advanced server configuration. I've given you pointers to the information you need. You can either follow those pointers, or hire a consultant to solve the problem for you. I don't have a specific recommendation.

  • UptimeJeff Level 4 Level 4 (3,390 points)
    Currently Being Moderated
    Feb 26, 2013 1:52 PM (in response to pepmachine)

    My guess, mail.domain.com needs an MX of its own which points to mail.domain.com

         mail.domain.com  MX   0   mail.domain.com

     

    Your server should be set to receive mail ONLY for mail.domain.com

     

    Make sure domain.com has the proper MX pointing to your mail host

         domain.com MX   smtp.mailhost.com

     

    if you post your real domain, it would be much easier to tell you what the config should look like.

  • UptimeJeff Level 4 Level 4 (3,390 points)
    Currently Being Moderated
    Feb 27, 2013 10:42 AM (in response to pepmachine)

    too short on time to digest this. its much easier to look at your real DNS as it exists.

    if you want to send your real domain, use my contact info is in my profile.

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.