certera-io / certera

A central validation server for Let's Encrypt certificates
https://docs.certera.io
Other
69 stars 14 forks source link

Notifications not sent but test email is working (when Alternative Email field is filled in) #21

Open gik000 opened 3 years ago

gik000 commented 3 years ago

The notifications are not sent, but I can successfully receive the test email.

That is very strange.

The only think I can suppose about it is that we are not working under SSL connection (to the mail server).

certeraio commented 3 years ago

That is indeed strange. If you can receive a test email, you should definitely be getting the other notifications. Can you confirm the SMTP configuration on the "Settings" page, please? Also can you provide a screenshot of your Notifications page (should it not contain a Slack Webhook URL), please?

gik000 commented 3 years ago

The problem is when you set alternative emails.

If there is only one mail (i.e. in "Recipients" field), everything works fine, on the other hand if you put 2 email in "Additional Recipients" (I tested with 2 addresses), whether are " ; " separated or ";" (with no space between) the notification is not send.

certeraio commented 3 years ago

Hmm, that's really strange. I'll try it out more now that there are some clear scenarios to test out.

The code that does the sending is this: https://github.com/certera-io/certera/blob/master/src/Certera.Core/Notifications/MailSender.cs#L29

Sending from the settings/test page is this: https://github.com/certera-io/certera/blob/master/src/Certera.Web/Pages/Settings/Index.cshtml.cs#L90-L92

There's something there to account for commas and semicolon delimiters.

The code that sends expirations is here: https://github.com/certera-io/certera/blob/master/src/Certera.Web/Services/NotificationService.cs#L234-L236

It also has comma and semicolon delimiter handling.

Anyways, I'll try it out and see if I can reproduce the problem on my end.