Link to home
Start Free TrialLog in
Avatar of Gonthax
Gonthax

asked on

PHP, SMTP and IIS - Relaying and "501 Syntactically invalid" error

Hi there,

I'm running PHP-based forum software on a web server.  The software sends e-mail to our users when an event happens, such as sending validation e-mail, or a post was replied to, etc.  I'm using IIS to host the forums, and would like to use Window's built in SMTP server to allow PHP to send mail through it.

I have it up and running and mostly working...  What I did was install the SMTP server, and allowed 127.0.0.1 to relay through it so it would send e-mail out.  Question One: Is this correct (and best) practice?

Question Two: The odd thing is that on about 30% of the mail servers my server connects to to send a message, I get a warning back that says, "501 Syntactically invalid HELO argument(s)" in my Event Viewer.

Technically I don't use the SMTP server to receive mail, only to send it.  I assume this is because those mail servers are trying to use reverse DNS and failing because I don't have an MX record pointing to my forum server?  If not, what do I do to fix that warning?

Thanks,
G
Avatar of meverest
meverest
Flag of Australia image

Hello,

answer 1: Sure - if the only use for the smtp server is to relay mail generated by the web apps, then that will be fine.  If you wanted, you could go one step further and allow only localhost to *connect*.  Since all mail will be outbound, and no need to accept external connections for local mail delivery, then there is no reason why anyone else will need access to the smtp service.

answer 2: 'syntactically incorrect' suggests more than just a reverse lookup failure.  are you sure that the error is generated by the remote server, or could it be the smtp delivery agent you are using in your php code?

cheers.




ASKER CERTIFIED SOLUTION
Avatar of crissand
crissand

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gonthax
Gonthax

ASKER

It turned out to be an underscore in the hostname of the computer.  I removed that, tested it using your telnet suggestion, and that the command went through properly!

meverest, I'll make a new topic for you for points -- I didn't see the Assisted Answer feature when I accepted crissand's comment.

Thanks both of you!
-G