Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check deliverability using successful response code instead of message parsing #822

Merged

Conversation

tyranron
Copy link
Contributor

@tyranron tyranron commented Jan 7, 2021

Fixes #771

This PR makes deliverability check by checking the response code to be successfult for a RCPT TO command. The whole reasoning is described in the source code:

According to RFC 5321, RCPT TO command succeeds only with 250 and 251 codes: https://tools.ietf.org/html/rfc5321#page-56

Where the 251 code is used for forwarding, which is not our case, because we always deliver to the SMTP server hosting the address itself.

So, if response.is_positive() (which is a condition for returning Ok from the command() method above), then delivery succeeds, accordingly to RFC 5321.

@CLAassistant
Copy link

CLAassistant commented Jan 7, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds good to me! Thanks a lot for this contribution!

Would just like to see a comment about 3xx codes.

core/src/smtp/mod.rs Show resolved Hide resolved
Copy link
Member

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@amaury1093 amaury1093 merged commit 39d0ecd into reacherhq:master Jan 7, 2021
@tyranron tyranron deleted the fix-deliverability-check branch January 7, 2021 16:42
@tyranron tyranron mentioned this pull request Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mail.ru emails are all invalid
3 participants