No valid exception for knowing 'Access Denied' #44
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: karolyi/py3-validate-email#44
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Exception 'AddressNotDeliverableError' is thrown both for when a server is blocked/denied and when email doesn't exist.
Gmail allows local testing if you run the following code
Inside Debug Log it will emit 'The email account that you tried to reach does not exist'
Outlook disallows local testing if you run the following code
Inside Debug Log it will emit 'Access denied, banned sending IP'
'AddressNotDeliverableError' exception cannot be both if a server got blocked and email doesn't exist.
Is it possible to access Debug object?
i am also interested to know the above error handling , since my code not able to understand the error code for block ip
@voxvici you just have to simply use the
validate_email_or_fail()
function, which will raise an exception that you catch and the error message will be in the exception arguments.@manojr2k @voxvici Out of curiosity, may I ask what you would consider the best behavior in the case of such an "Access denied" (or other messages about blacklisting or similar issues)?
Would it be sufficient if the result of the function was just
None
like in other cases where there is no verification possible (like mail server down, greylisting etc), and you can look at the debug log what was the reason for not being able to give a clear result? Or would you still need access to the error messages to programmatically react different to the various reasons that can lead to aNone
result? Or would you think an additional exception should be introduced saying "you're blacklisted"?There should be some unique id which we can identify in the code and take
the necessary action
On Thu, Feb 11, 2021 at 12:39 AM Reinhard Müller notifications@github.com
wrote:
any update reinhard ?
@manojr2k sorry I don't think that I will have an implementation proposal in short time, I need to think more about this, but your feedback is appreciated as input for that.
@reinhard-mueller
apologizes for not answering been busy with work, I've found a workaround solution for the blacklist issue ideally a blacklist exception but I've read some of the @karolyi comments before and he was talking it's hard to know when the server actually is blacklisted? if I remember correctly. It would be nice to have an additional exception due to logging and knowing what is internally happening without having to access debug
EDIT right now I've seen the "e.error_messages will be a list of error messages" comment on one of the issues, missed that one. Great work and thank you for answering to issue and updating the module