javax.mail.internet.AddressException issue

Sagar Vavhal shared this idea 3 years ago
Idea Logged

We're seeing the following error which is disallowing broadcasts to be sent:

"Mon Aug 24 2020 17:55:52.516 WARN Error broadcasting report to person Abraham Hernandez lopez: Missing local name com.hof.mi.servlet.ReportBroadcastTask"

Fri Aug 28 2020 13:36:11.181 DEBUG Broadcast Report Execution complete. Sending stored emails. com.hof.mi.process.ReportBroadcastProcess
Fri Aug 28 2020 13:36:11.181 INFO About to email REPORT (97392574) to @ com.hof.mi.process.ReportBroadcastProcess
javax.mail.internet.AddressException: Missing local name in string ``@''
	at javax.mail.internet.InternetAddress.checkAddress(
	at javax.mail.internet.InternetAddress.parse(
	at javax.mail.internet.InternetAddress.parseHeader(
	at javax.mail.internet.MimeMessage.getAddressHeader(
	at javax.mail.internet.MimeMessage.getRecipients(
	at com.hof.util.Email.send(
	at com.hof.mi.process.ReportBroadcastProcess.sendBroadcastEmail(
	at com.hof.mi.process.ReportBroadcastProcess.A(
	at com.hof.mi.process.ReportBroadcastProcess.deliverEmail(
	at com.hof.mi.process.ReportBroadcastProcess.A(
	at com.hof.mi.process.ReportBroadcastProcess.A(
	at com.hof.mi.process.ReportBroadcastProcess.broadcastReport(
	at com.hof.mi.servlet.ReportBroadcastTask.runBroadcastTask(
	at com.hof.mi.util.background.TaskRunner.A(
	at java.base/java.util.concurrent.Executors$
	at java.base/
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/
Fri Aug 28 2020 13:36:11.182 INFO Email failed: Missing local name com.hof.mi.process.ReportBroadcastProcess

Replies (1)


Hi Sagar,

In researching the following:

javax.mail.internet.AddressException: Missing local name in string ``@''
I can see that this is being generated from the Java Mail Client and that this exception is generally thrown when there is nothing in front of the @ sign. Beyond this, normally the exception would be like this:

 javax.mail.internet.AddressException: Missing local name in string ``''
Where the item in quotation marks is the String that was to contain the email address. Since the exception was:

javax.mail.internet.AddressException: Missing local name in string ``@''

It looks like that the string that was suppose to have your complete (and hopefully valid) email address actually only contained the "@" sign.

As such, it seems that Abraham Hernandez's Email address is being stored incorrectly (likely just an "@" sign). To resolve this, their stored e-mail address should be fixed.

Of course, in terms of avoiding the issue going forward you may not know there is an incorrectly stored e-mail, so I reached out to the dev team and it should be possible to workaround this in the code.

Here was the update from the dev team:

"Yes, it starts sending emails looping through the recipients and if it fails on one of them it will stop and mark the whole broadcast run as a failure. The exception isn't being caught and logged correctly within YF but it is within our code and something we can handle.

...I think a 'partial success' value could be useful, adding it may be a fair chunk of work given the labyrinthine nature of the broadcast code. Additional broadcast results are also stored with a state for each recipient though, these are now visible in the broadcast history in the schedule management page.

There's some functionality around broadcasts that notifies a group on failures of the whole broadcast. If we were looking at having it not marked as a failure for just a few recipients it would change that functionality. We could leverage that group so they are notified when only some recipients broadcasts fail. We could also add an option for how to evaluate success so clients can choose for themselves. So there's a number of ways we could approach a solution to this.

TL:DR yes the broadcast can be marked as failed if one recipient fails and yes we can add a workaround for it in the code."

As such, I've gone ahead and submitted an enhancement request so we can work around this.

Any potential updates regarding this will be posted here.



Leave a Comment
Attach a file