javax.mail.internet.AddressException issue

Sagar Vavhal shared this idea 4 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(InternetAddress.java:1216)
	at javax.mail.internet.InternetAddress.parse(InternetAddress.java:1096)
	at javax.mail.internet.InternetAddress.parseHeader(InternetAddress.java:663)
	at javax.mail.internet.MimeMessage.getAddressHeader(MimeMessage.java:733)
	at javax.mail.internet.MimeMessage.getRecipients(MimeMessage.java:565)
	at com.hof.util.Email.send(Email.java:609)
	at com.hof.mi.process.ReportBroadcastProcess.sendBroadcastEmail(ReportBroadcastProcess.java:4673)
	at com.hof.mi.process.ReportBroadcastProcess.A(ReportBroadcastProcess.java:4646)
	at com.hof.mi.process.ReportBroadcastProcess.deliverEmail(ReportBroadcastProcess.java:3591)
	at com.hof.mi.process.ReportBroadcastProcess.A(ReportBroadcastProcess.java:3548)
	at com.hof.mi.process.ReportBroadcastProcess.A(ReportBroadcastProcess.java:3028)
	at com.hof.mi.process.ReportBroadcastProcess.broadcastReport(ReportBroadcastProcess.java:2446)
	at com.hof.mi.servlet.ReportBroadcastTask.runBroadcastTask(ReportBroadcastTask.java:139)
	at com.hof.mi.util.background.TaskRunner.A(TaskRunner.java:80)
	at com.hof.mi.util.background.TaskRunner.run(TaskRunner.java:157)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Fri Aug 28 2020 13:36:11.182 INFO Email failed: Missing local name com.hof.mi.process.ReportBroadcastProcess

Replies (1)

photo
0

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 ``@yellowfin.com.au''
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.

Regards,

Mike

Leave a Comment
 
Attach a file