I came across a strange PHP application with Postfix. It worked as expected, but after migrating to Exchange 2010, strange delays appeared when trying to send mail. The send() function hangs for about 30 seconds… sometimes it returns a timeout, sometimes it simply hangs.
After debugging, we discovered that it hangs after sending CRLF.CRLF in the DATA section, and this is where it waits for the server response. After about 30 seconds, the server responds with its magic 250 and everything is fine.
The problem is that PHP treats this waiting time as a server failure and returns a timeout.
Checking the MaxAcknowledgementDelay parameter on the connector and changing its value from 30 to 0 helped:
Get-ReceiveConnector "Connector Name" | fl Set-ReceiveConnector "Connector Name" -MaxAcknowledgementDelay 0
It is also worth changing:
Set-ReceiveConnector "Connector Name" -Tarpitinterval 0
and done… 😉