Feature Request: Get SMTP code /message #25

Closed
opened 2020-06-09 17:45:44 +02:00 by taewookim · 6 comments
taewookim commented 2020-06-09 17:45:44 +02:00 (Migrated from github.com)

Why: Would like to know if my IP/server got blacklisted

Why: Would like to know if my IP/server got blacklisted
karolyi commented 2020-06-09 17:52:27 +02:00 (Migrated from github.com)

Elaborate please?

As per the SMTP result codes you either get a 4XX in which case you can retry later, or you get a 5XX when you are denied from further retries.

If you use the (somewhat new) 63f4661fd3/validate_email/validate_email.py (L14), you should get an EmailValidationError 63f4661fd3/validate_email/exceptions.py (L4) base class with the message that occurred on denial. You can go from there and see what the exact message was; but the message is for humans and not for machines to read, hence there is no simplistic way to tell if it was a blocklist error.

Elaborate please? As per the SMTP result codes you either get a 4XX in which case you can retry later, or you get a 5XX when you are denied from further retries. If you use the (somewhat new) https://github.com/karolyi/py3-validate-email/blob/63f4661fd3c8f9b838784754d472b8a072a2fef2/validate_email/validate_email.py#L14, you should get an `EmailValidationError` https://github.com/karolyi/py3-validate-email/blob/63f4661fd3c8f9b838784754d472b8a072a2fef2/validate_email/exceptions.py#L4 base class with the message that occurred on denial. You can go from there and see what the exact message was; but the message is for humans and not for machines to read, hence there is no simplistic way to tell if it was a blocklist error.
karolyi commented 2020-06-09 18:03:13 +02:00 (Migrated from github.com)

The one with the message in the exception will be AddressNotDeliverableError:
63f4661fd3/validate_email/mx_check.py (L97)

The one with the message in the exception will be `AddressNotDeliverableError`: https://github.com/karolyi/py3-validate-email/blob/63f4661fd3c8f9b838784754d472b8a072a2fef2/validate_email/mx_check.py#L97
stale[bot] commented 2020-06-23 18:45:25 +02:00 (Migrated from github.com)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
taewookim commented 2020-06-29 20:37:38 +02:00 (Migrated from github.com)

Sorry, my apologies. for some reason, github is not sending notifications to my inbox

AddressNotDeliverableError could be based on getting the IP listed in spamhaus. in such case, will 5XX be listed as the exception?

Sorry, my apologies. for some reason, github is not sending notifications to my inbox AddressNotDeliverableError could be based on getting the IP listed in spamhaus. in such case, will 5XX be listed as the exception?
karolyi commented 2020-06-29 20:40:58 +02:00 (Migrated from github.com)

You should get the rejection message as the exception message, yes.

You should get the rejection message as the exception message, yes.
stale[bot] commented 2020-07-13 21:04:17 +02:00 (Migrated from github.com)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: karolyi/py3-validate-email#25
No description provided.