Loading ...
Sorry, an error occurred while loading the content.

sending mail with php via postfix to another mail server running on the same machine

Expand Messages
  • Brent Deverman
    Hello, I am administering a Mac OS X 10.4.6 server running another mail server called EIIMS: http://www.eudora.co.nz/ If you are not familiar it is originally
    Message 1 of 2 , May 31, 2006
    • 0 Attachment
      Hello, I am administering a Mac OS X 10.4.6 server running another
      mail server called EIIMS:

      http://www.eudora.co.nz/

      If you are not familiar it is originally a Mac program ported to Mac
      OS X so it does not have support for the normal unix mail server
      mechanisms. This means that the built-in php mail function cannot
      send email to using EIMS. Therefore I need to use postfix to send
      mail from php.

      I had postfix configured properly as a "Null Client" so that postfix
      delivers mail to another server and doesn't try to deliver mail to
      itself or listen for new mail coming in. I got the instructions for
      the null client from here:

      http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client

      I was able to successfully send email to the same server it by
      tricking postfix and not using a fully
      qualified domain (shenzhenparty) name for the hostname. Now that I
      want to use Open Directory on my server, I have to use a FQDN for my
      servers hostname (shenzhenparty.com). Now postfix is able to detect a
      mail loop again.

      I need to send email through the standard php mail command from my
      php scripts because many scripts written by others use this command.
      (Rewriting all the php apps written by third parties to uses another
      mail library is not an option.)

      This was working fine but I have changed my server to use open
      directory and in the process, I had to change the hostname of my
      server from shenzhenparty to shenzhenparty.com. My original server
      name was not a fully qualified domain name and so postfix didn't know
      it was sending mail to the same server.

      You can take a look at the log below:

      ----------
      May 29 14:30:21 shenzhenparty postfix/cleanup[23298]: 506E15F725C:
      message-id=<20060529063021.506E15F725C@...>
      May 29 14:30:21 shenzhenparty postfix/qmgr[23034]: 506E15F725C:
      from=<info@...>, size=868, nrcpt=2 (queue active)
      May 29 14:30:21 shenzhenparty postfix/error[23301]: 506E15F725C:
      to=<classifieds@...>, relay=none, delay=0,
      status=bounced (local delivery is disabled)
      May 29 14:30:21 shenzhenparty postfix/smtp[23302]: warning: host
      mail.shenzhenparty.com[210.17.235.228] greeted me with my own
      hostname shenzhenparty.com
      May 29 14:30:21 shenzhenparty postfix/smtp[23302]: warning: host
      mail.shenzhenparty.com[210.17.235.228] replied to HELO/EHLO with my
      own hostname shenzhenparty.com
      May 29 14:30:21 shenzhenparty postfix/smtp[23302]: 506E15F725C:
      to=<szclassifieds@...>, relay=mail.shenzhenparty.com
      [210.17.235.228], delay=0, status=bounced (mail for
      mail.shenzhenparty.com loops back to myself)
      May 29 14:30:21 shenzhenparty postfix/cleanup[23298]: 5B1C55F725E:
      message-id=<20060529063021.5B1C55F725E@...>
      May 29 14:30:21 shenzhenparty postfix/qmgr[23034]: 5B1C55F725E:
      from=<>, size=2809, nrcpt=1 (queue active)
      May 29 14:30:21 shenzhenparty postfix/qmgr[23034]: 506E15F725C: removed
      May 29 14:30:21 shenzhenparty postfix/error[23305]: 5B1C55F725E:
      to=<info@...>, relay=none, delay=0, status=bounced
      (local delivery is disabled)
      May 29 14:30:21 shenzhenparty postfix/qmgr[23034]: 5B1C55F725E: removed
      ----------

      Postfix seems to have an option for everything, doesn't it have an
      option to disable this loop back check? i have looked through all the
      options and have not found a way. Below is my postfix configuration
      in case that helps:

      shenzhenparty:~ deverman$ postconf -n
      command_directory = /usr/sbin
      config_directory = /etc/postfix
      daemon_directory = /usr/libexec/postfix
      debug_peer_level = 2
      html_directory = no
      inet_interfaces = localhost
      local_transport = error:local delivery is disabled
      mail_owner = postfix
      mailbox_size_limit = 0
      mailq_path = /usr/bin/mailq
      manpage_directory = /usr/share/man
      mydomain = shenzhenparty.com
      mydomain_fallback = localhost
      mynetworks_style = host
      myorigin = $mydomain
      newaliases_path = /usr/bin/newaliases
      queue_directory = /private/var/spool/postfix
      readme_directory = /usr/share/doc/postfix
      relayhost = mail.shenzhenparty.com
      sample_directory = /usr/share/doc/postfix/examples
      sendmail_path = /usr/sbin/sendmail
      setgid_group = postdrop
      smtpd_tls_key_file =
      unknown_local_recipient_reject_code = 550

      As postfix has given me a lot of trouble on this issue I don't see
      switching from EIMS to postfix as a viable option just to get php
      emails working on a Mac OS X Server. I also do not want to use an
      additional IP just to get emails working either because if I have to
      do that I might as well move to a managed solution on a linux box.

      I hope someone has a suggestion. Thanks

      ... . . . . . . ....
      - www.shenzhenparty.com

      S h e n z h e n C l a s s i f i e d s @:
      - www.shenzhenparty.com/classifieds/ -

      S h e n z h e n W e e k l y E v e n t C a l e n d a r @:
      - www.shenzhenparty.com/calendar/ -

      T o S u b s c r i b e:
      Send an email to info@...

      brent.deverman@...
      AIM/iChat: brent.deverman@...
      MSN IM: brent@...
      Google Talk: deverman@...
      skype: deverman
      Cell: (+86) 13924598570
      ... . . . . . . ....
    • Victor Duchovni
      ... Try: # Use any valid name that is not equal to the domain # in the server greeting. If localhost.shenzhenparty.com # is listed in DNS (and resolves to
      Message 2 of 2 , Jun 1, 2006
      • 0 Attachment
        On Thu, Jun 01, 2006 at 02:33:40PM +0800, Brent Deverman wrote:

        > Hello, I am administering a Mac OS X 10.4.6 server running another
        > mail server called EIIMS:
        >
        > http://www.eudora.co.nz/
        >
        > If you are not familiar it is originally a Mac program ported to Mac
        > OS X so it does not have support for the normal unix mail server
        > mechanisms. This means that the built-in php mail function cannot
        > send email to using EIMS. Therefore I need to use postfix to send
        > mail from php.
        >
        > I had postfix configured properly as a "Null Client" so that postfix
        > delivers mail to another server and doesn't try to deliver mail to
        > itself or listen for new mail coming in. I got the instructions for
        > the null client from here:
        >
        > http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client
        >
        > I was able to successfully send email to the same server it by
        > tricking postfix and not using a fully
        > qualified domain (shenzhenparty) name for the hostname. Now that I
        > want to use Open Directory on my server, I have to use a FQDN for my
        > servers hostname (shenzhenparty.com). Now postfix is able to detect a
        > mail loop again.
        >
        > I need to send email through the standard php mail command from my
        > php scripts because many scripts written by others use this command.
        > (Rewriting all the php apps written by third parties to uses another
        > mail library is not an option.)
        >
        > This was working fine but I have changed my server to use open
        > directory and in the process, I had to change the hostname of my
        > server from shenzhenparty to shenzhenparty.com. My original server
        > name was not a fully qualified domain name and so postfix didn't know
        > it was sending mail to the same server.
        >
        > You can take a look at the log below:
        >
        > ----------
        > May 29 14:30:21 shenzhenparty postfix/smtp[23302]: warning: host
        > mail.shenzhenparty.com[210.17.235.228] greeted me with my own
        > hostname shenzhenparty.com
        > May 29 14:30:21 shenzhenparty postfix/smtp[23302]: warning: host
        > mail.shenzhenparty.com[210.17.235.228] replied to HELO/EHLO with my
        > own hostname shenzhenparty.com
        > May 29 14:30:21 shenzhenparty postfix/smtp[23302]: 506E15F725C:
        > to=<szclassifieds@...>, relay=mail.shenzhenparty.com
        > [210.17.235.228], delay=0, status=bounced (mail for
        > mail.shenzhenparty.com loops back to myself)

        Try:

        # Use any valid name that is not equal to the domain
        # in the server greeting. If localhost.shenzhenparty.com
        # is listed in DNS (and resolves to 127.0.0.1), use that.
        #
        myhostname = mail.shenzhenparty.com
        #
        # Still, Use the domain to qualify unqualified email addresses.
        #
        myorigin = shenzhenparty.com

        > shenzhenparty:~ deverman$ postconf -n
        > inet_interfaces = localhost

        Use "127.0.0.1", or with Postfix 2.2 and later: "loopback-only" (without the
        double quotes).

        > mydomain = shenzhenparty.com
        > mynetworks_style = host
        > myorigin = $mydomain
        > relayhost = mail.shenzhenparty.com
        > sample_directory = /usr/share/doc/postfix/examples

        > As postfix has given me a lot of trouble on this issue I don't see
        > switching from EIMS to postfix as a viable option just to get php
        > emails working on a Mac OS X Server.

        This is not constructive here. We can take our toys and go play in our
        own sandbox too.

        --
        Viktor.

        P.S. Morgan Stanley is looking for a New York City based, Senior Unix
        system/email administrator to architect and sustain the Unix email
        environment. If you are interested, please drop me a note.

        Disclaimer: off-list followups get on-list replies or get ignored.
        Please do not ignore the "Reply-To" header.

        To unsubscribe from the postfix-users list, visit
        http://www.postfix.org/lists.html or click the link below:
        <mailto:majordomo@...?body=unsubscribe%20postfix-users>

        If my response solves your problem, the best way to thank me is to not
        send an "it worked, thanks" follow-up. If you must respond, please put
        "It worked, thanks" in the "Subject" so I can delete these quickly.
      Your message has been successfully submitted and would be delivered to recipients shortly.