php-windows Digest 25 Jun 2008 00:22:47 -0000 Issue 3494

Topics (messages 28960 through 28963):

Re: PHP Mail 501 error
        28960 by: Dan Mashal
        28961 by: Niel Archer
        28963 by: Dan Mashal

IE/ IIS / PHP - Form posted twice in case of redirection
        28962 by: Sukhwinder Singh

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
OK but why is PHP mail doing this and how do I get IIS to accept the
message? Is there anything in the PHP.ini I can add/change to fix this?
It works fine with Unix mail servers.

Dan

-----Original Message-----
From: Brereton, Stephen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 24, 2008 3:54 AM
To: Dan Mashal; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] PHP Mail 501 error


Just a thought, and may be wrong, but as RCPT TO in rfc 2821
(http://www.rfc-editor.org/rfc/rfc2821.txt)
Only one layer of backets is used?

-----Original Message-----
From: Dan Mashal [mailto:[EMAIL PROTECTED]

Sent: 23 June 2008 19:42
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] PHP Mail 501 error


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:




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+<[EMAIL PROTECTED]>> 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.




Thanks,

Dan


* * * * * * * * * * * *

Help protect the environment - please don't print this email unless you
really need to.
* * * * * * * * * * * *

This communication is from City of York Council.

The information contained within, and in any attachment(s), is
confidential and legally privileged. It is for the exclusive use of the
intended recipient(s). If you are not the intended recipient(s), please
note that any form of distribution, copying or use of this
communication, or the information within, is strictly prohibited and may
be unlawful. Equally, you must not disclose all, or part, of its
contents to any other person.

If you have received this communication in error, please return it
immediately to the sender, then delete and destroy any copies of it.

City of York Council disclaims any liability for action taken in
reliance on the content of this communication.


--- End Message ---
--- Begin 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+<[EMAIL PROTECTED]>> 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 <[EMAIL PROTECTED]>". 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 <[EMAIL PROTECTED]>" is not valid on
windows.

HTH

--
Niel Archer



--- End Message ---
--- Begin Message ---
That is correct Neil. The second you try to add a display name to the
RCPT command it fails. I think windows only accepts a display name in
the DATA field. I'm thinking this is a Mediawiki problem at this point..
not a PHP problem.

Dan

-----Original Message-----
From: Niel Archer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 24, 2008 1:01 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] PHP Mail 501 error

> 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+<[EMAIL PROTECTED]>> 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 <[EMAIL PROTECTED]>". 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 <[EMAIL PROTECTED]>" is not valid on
windows.

HTH

--
Niel Archer



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message --- I am facing a strange problem of IE double posting in case of self post. PHP 5.2.6 / IIS 5.1 on windows XP.

Before starting I must tell you that:

It works with firefox, Apache / PHP combination.

It works with IE / Apache / PHP combination

But it DOES NOT work with  IE/PHP/ IIS


This is the case with all IE versions and it happens on even the windows 2003 server.

I have a form with just one field which uploads a single file and posts back to same PHP file. The file is a csv file and it is properly read and inserted into database. After it is successfully inserted I issue a redirect to some other page using header("Location:users.php"). And when I see the records in database, they inserted twice. If I don't do the redirect to some other page And display the message on the same page that everything is all right then records are inserted only once.

It doesn't matter to what page I redirect to or if I attach any query string or not. It is just that header("Location:any_url") causes IE to submit the form TWICE. Not more than twice. I have checked the IIS logs and confirmed that form is actually getting submitted twice.

21:16:31 127.0.0.1 POST /xxx/import.php 303
21:16:31 127.0.0.1 POST /xxx/import.php 303
21:16:31 127.0.0.1 GET /xxx/users.php 200
21:16:31 127.0.0.1 GET /xxx/users.php 200

Actual path it takes to import the users is this:

users.php has a link to import.php. import php first displays a form for uploading and then posts to itself. After the files is properly uploaded and inserted into database I return the user to users.php again using that Location header. So there is no way that there is any kind of looping or something.



Just to check if it is IE which has any problem with PHP header I upgraded IE to version 7. Now when I post the form rather than posting it twice IE just displays a message "Internet Explorer cannot display the webpage" and records are into database only once.

I am not sure if it is IIS, PHP or IE Problem.

This is not the first time I have experienced this. I had earlier faced the same problem but I thought I should just switch to Apache rather than use IIS for development. But now the problem is that production server is Windows 2003 server with IIS. (The version of PHP IIS or windows shouldn't not matter though)


Thanks,

Sukhwinder Singh
--- End Message ---

Reply via email to