Undying email sends

Unimus support forum
Post Reply
NLRCIT
Posts: 1
Joined: Wed Mar 10, 2021 5:49 pm

Wed Mar 10, 2021 7:09 pm

Was looking at the latest version of Unimus, and testing Notifications. I couldn't find whether or not the "To Email Address" supported multiple recipients in the field or not. It worked just fine with one, and after testing it, I stopped the server. Finishing up other work, I decided to test the multiple recipient theory, and restarted the server. I added a second edress, separated from the first by a comma. Then I kicked off a backup (which is an event I configured to send an email). and saw the error messages. That's okay, there may be more/better ways to implement multiple recipients, than what I tried. Multiple addresses would be *nice to have*, but certainly not necessary. I can certainly implement an email list that would work.

Error messages when I used the comma separator:
(note: edresses were changed to protect the not-so-innocent) :roll:
  • 2021-03-10 11:30:43.249 WARN 8924 --- [TaskScheduler-1] n.u.c.service.mail.QueuedMailSenderImpl : Sending failed = 'Could not parse mail; nested exception is javax.mail.internet.AddressException: Illegal address in string ``edress1@gmail.com,edress2@gmail.com'''
Seeing that the comma didn't work, I changed the "To Email address" to use the semicolon separator instead. Here's the log entry of that change being accepted:
  • 2021-03-10 11:31:34.019 INFO 8924 --- [nio-8085-exec-3] u.s.p.v.i.VaadinNotificationsServiceImpl : User 'testuser' saves 'EmailConfig{id=0, createTime=1574442609, enabled=true, smtpServer='smtp-relay.gmail.com', smtpPort=587, authEnabled=true, smtpUsername='listemail1@gmail.com', smtpPassword='33 characters', useTls=true, mailFrom='listemail1@gmail.com', mailTo='edress1@gmail.com;edress2@gmail.com'}'
However, even though Unimus seemed to accept the change, it kept trying to send the backup message using the original 'comma'ed edress.
  • 2021-03-10 11:32:43.237 WARN 8924 --- [TaskScheduler-1] n.u.c.service.mail.QueuedMailSenderImpl : Sending failed = 'Could not parse mail; nested exception is javax.mail.internet.AddressException: Illegal address in string ``edress1@gmail.com,edress2@gmail.com'''
...
  • 2021-03-10 11:37:58.246 WARN 8924 --- [TaskScheduler-1] n.u.c.service.mail.QueuedMailSenderImpl : Sending failed = 'Could not parse mail; nested exception is javax.mail.internet.AddressException: Illegal address in string ``edress1@gmail.com,edress2@gmail.com'''
After about 5 minutes, I finally stopped the sever, and restarted it. Once back up, I changed the edress to include a semicolon between edresses, kicked off a test backup, and got the same error messages as before except it had the semicolon included. So, at that point I changed the edress back to the working (single) edress. However, like before, Unimus wouldn't stop trying to send to the semicolon'ed edress, and I had to stop and start Unimus again.

Looking at the changelog, I see that in 2.0.5 (*) there was an email send fix (?), but this must be something that isn't covered/envisioned by that fix. I also see back in 1.10.0(**), there was a feature that Unimus would keep trying to send an email for an hour, before failing. I certainly didn't let it run for an hour, so I have no idea how long it would have run. I would also suggest that the length of time (or perhaps the repetition frequency) be configurable. My audit log reviews are long enough without having hundreds of duplicate entries, a few milliseconds apart. :D

On the edress, my suggestion would be to parse of the edress field, not accepting it until non-valid characters (such as the comma or semicolon) are removed. Just a suggestion though. Of course I could have accepted the verbiage of the single "To Email Address" and assumed only one edress, but that's no fun. ;)

Dave


Changelog Entries:
###############################################################################
(*)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
= Version 2.0.5 =
Fixes:
Fixed email notifications stopped working if email server didn't respond to outbound email

(**)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
= Version 1.10.0 =
Features:
Emails expire from email sender queue after 1 hour if they fail to send within this period
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Johnny
Posts: 14
Joined: Wed Oct 05, 2016 4:12 pm

Mon Mar 22, 2021 3:18 pm

Thank you for the very detailed report :) As you figure it out, there is no way to configure Unimus to send email notifications to multiple recipients. The only way for now, as you mentioned, is to configure an email list by yourself.
However, we do have plans to re-work notification system and it will definitely include support for multiple recipients to make a life easier.
Seeing that the comma didn't work, I changed the "To Email address" to use the semicolon separator instead. Here's the log entry of that change being accepted:
  • 2021-03-10 11:31:34.019 INFO 8924 --- [nio-8085-exec-3] u.s.p.v.i.VaadinNotificationsServiceImpl : User 'testuser' saves 'EmailConfig{id=0, createTime=1574442609, enabled=true, smtpServer='smtp-relay.gmail.com', smtpPort=587, authEnabled=true, smtpUsername='listemail1@gmail.com', smtpPassword='33 characters', useTls=true, mailFrom='listemail1@gmail.com', mailTo='edress1@gmail.com;edress2@gmail.com'}'
However, even though Unimus seemed to accept the change, it kept trying to send the backup message using the original 'comma'ed edress.
Even if you change the configuration, already queued messages won't be affected and they would remain in the queue for an hour. Therefore you could still see the messages with the old "To Email Address" value in the logs.
I would also suggest that the length of time (or perhaps the repetition frequency) be configurable. My audit log reviews are long enough without having hundreds of duplicate entries, a few milliseconds apart. :D
These properties are actually already configurable however there is a lack of documentation :( We are going to write new wiki article to cover these configurations and to clarify mail queuing and the mail component behaviour.

On the logging, we definitely need to improve it to make it more transparent. Audit the logs having hundreds of duplicate entries is certainly unpleasant :? . We have created an internal ticket to cover that.
Post Reply