PHPMailer: Supporting Microsoft Exchange NTLM Authentication

A while ago while using PHPMailer, I noticed there is a lack of Microsoft Exchange support for sending e-mail on STMP using NTLM authentication. Perhaps the close endedness of the proprietary protocol makes it hard for developer support.

One particular file I’m very interested in is the ntlm_sasl_client.php which is pretty outdated and only supports NTLM authentication WITH domain and workstation parameters filled. Meaning, the machine must be logged on to the local domain first. We also do not know the server’s realm. This is a bit problematic for web servers not directly connected to an NT domain. For this reason a different NTLM authentication scheme has to be used.

Either way I did noticed Gnome Evolution does support Microsoft Exchange and it’s open source so I should be able to salvage some protocol information from there. It follows SAMBA NTLM authentication procedure without the need to log into an NT domain. There are also a very thorough documentation on the NTLM authentication protocol. I shall start a project on this soon.

2 thoughts on “PHPMailer: Supporting Microsoft Exchange NTLM Authentication”

  1. Hello,

    this is nice, but can you post a working example please. I’m trying to get it running, but what the hell is a “Realm”, what is to be put in “Workstation” and so on??

    Best
    K

Leave a Reply to Karsten Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.