TheFox / smtpd

SMTP server (library) for receiving emails, written in pure PHP.
https://fox21.at
MIT License
121 stars 30 forks source link

add ESMTP AUTH for LOGIN and PLAIN #5

Closed ashleyhood closed 8 years ago

ashleyhood commented 8 years ago

I have added the extended SMTP command AUTH with the login methods PLAIN and LOGIN.

When a client tries to authenticate with the server an event is triggered (Event::TRIGGER_AUTH_ATTEMPT) which passes login type and the clients credentials.

If PLAIN is used then the username and password are concatenated, prepend with user and then base64 encoded. The $credentials parameter is an array with this base64 encoded string.

If LOGIN is used then the username and password are sent separately as base64 encoded strings. The $credentials parameter is an associative array with the key user for the base64 encoded username and the key password with the base64 encoded password.

TheFox commented 8 years ago

First of all, Thank you very much for your contribution. I'll review your code and comment in the GitHub diff view if necessary. I added .editorconfig to the master branch. Please use the EditorConfig plugin of your favorite editor to fit the code style for further contributions.

Which RFC implementation is this? There are RFC 1425, 1651, 1869, 2821 for implementing ESMTP. I guess RFC 4954.