Re: PHP Mail 501 error
| From: | Niel Archer | Date: | Tue, 24 Jun 2008 20:01:21 +0000 |
| Subject: | Re: PHP Mail 501 error | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-28961@lists.php.net to get a copy of this message | ||
> Hello,
>
>
>
> We are running MediaWiki on PHP 5.2.6 with Apache for Windows.
>
>
>
> Every time we try to use an IIS mail server as an MTA we receive a 501
> error. When we use a Unix postfix based MTA it works fine.
>
>
>
> Could anyone please tell me what I need to do to modify my PHP.ini to
> get this to work?
>
>
>
> We have tried the workaround for Exchange 2003 as described in this
> article by Microsoft:
>
Hi
> http://support.microsoft.com/?id=291828
>
>
>
> But this fixes a 501 in the HELO. The problem here is the rcpt to. It
> comes up as the following:
>
>
>
> 2008-06-23 17:39:58 10.1.100.80 xxx SMTPSVC1 xxxx xxxxxxxx 0 RCPT -
> +TO:<DanMashal+<dmashal@intertrust.com>> 501 0 27 44 0 SMTP - - - -
> Could anyone please provide me with some much needed insight on this
> problem? I have been searching the web and have found a few workarounds
> but none that actually work.
From the mail() documentation:
Note: The Windows implementation of mail() differs in many ways from the
Unix implementation. First, it doesn't use a local binary for composing
messages but only operates on direct sockets which means a MTA is needed
listening on a network socket (which can either on the localhost or a
remote machine). Second, the custom headers like From:, Cc:, Bcc: and
Date: are not interpreted by the MTA in the first place, but are parsed
by PHP. As such, the to parameter should not be an address in the form
of "Something <someone@example.com>". The mail command may not parse
this properly while talking with the MTA.
From the example you show, it seems your problem is the last two
sentences. i.e. "DanMashal <dmashal@intertrust.com>" is not valid on
windows.
HTH
--
Niel Archer