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

should provide better error if no receiver can be parsed #62

Open
lgrapenthin opened this issue May 27, 2015 · 2 comments
Open

should provide better error if no receiver can be parsed #62

lgrapenthin opened this issue May 27, 2015 · 2 comments

Comments

@lgrapenthin
Copy link

In smtp-send*, the return value of .getAllRecipients should be checked for null. Please refer to http://docs.oracle.com/javaee/5/api/javax/mail/Message.html#getAllRecipients()

Otherwise .sendMessage comes up with a weird null pointer exception if null is passed as addresses parameter, which happens if no receiver can be parsed.

@drewr
Copy link
Owner

drewr commented Nov 6, 2015

I took a look at this and it's hard to fix without also addressing 😂😂 what I think is a design mistake in swallowing address exceptions during message creation. We could throw some other exception instead of an NPE, but "the message had address errors, sorry" isn't much more helpful than the NPE.

What do people think about a breaking change to fix address handling? Worth fixing in 1.x, or wait for a 2.x? I'd like to modernize other parts of the code as well, so leaning toward a 2.x. I'll document other improvements I see as possibilities and if anyone wants to submit PRs, that would be great. 🙏

drewr added a commit to elastic/runbld that referenced this issue Nov 6, 2015
Works around a bug in postal where an invalid address doesn't raise
exception drewr/postal#62.
drewr added a commit to elastic/runbld that referenced this issue Nov 11, 2015
Works around a bug in postal where an invalid address doesn't raise
exception drewr/postal#62.
@opqdonut
Copy link

I'd be very happy with some sort of InvalidAddressException instead of an NPE.

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

No branches or pull requests

3 participants