question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when sending email notifications via SES

See original GitHub issue

(Note: I’m not using Apprise directly but via Ouroboros. It didn’t feel right to open a bug there so I’ve opened it here)

When email notifications are configured to use SES an error is thrown that prevents messages from being sent:

2019-01-30 13:25:54 : DEBUG : NotifyEmail : Securing connection with TLS...
2019-01-30 13:25:54 : DEBUG : NotifyEmail : Applying user credentials...
2019-01-30 13:25:55 : WARNING : NotifyEmail : A Connection error occured sending Email notification to email-smtp.us-east-1.amazonaws.com.
2019-01-30 13:25:55 : DEBUG : NotifyEmail : Socket Exception: (554, b"Transaction failed: Duplicate header 'Content-Type'.")

This may have been fixed by #33 but since I’m not using Apprise directly I haven’t had a chance to confirm it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
djlcommented, Jan 30, 2019

That was much simpler than I had expected. The problem was two-fold:

  1. The manually set headers aren’t required
  2. The subtype was incorrect - it should’ve been plain instead of text.

Fixed both issues in #42.

0reactions
djlcommented, Jan 30, 2019

That makes sense! Thank you for doing all this debugging on your own.

Standing by what i wrote before, definitely try removing the two Content-Type lines I added on L355 and L359 of NotifyEmail.py and it will probably work!

Argh. I forgot to mention that, yes, removing both lines does make it work. The problem with doing that is that you may end up with the wrong content type (unless you want the default content-type of text/html).

I’m 99% sure I’ve solved this problem in other projects, though. I’ll dig around and find out how before submitting the pull request.

For the second part and your example email; first off, i’m glad you almost got it. But it is really complicated. The catch is the example.com part; AWS will involve somehow capturing 2 domains in the same URL and it will also require you to identify what location you’re in as i see reference to east and west servers. I wouldn’t want to just hardcode one. Templating might not be possible, but i’ll think on it. Maybe there is some way we can simplify that URL for you.

I’m totally fine with not having a template. Even if there was a template available, I’d probably stick to manually constructing the URL anyway.

Also, is there a reason you have the format set to text? or is that just because you were testing?

Yes. I hate HTML email 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Amazon SES email sending errors - AWS Documentation
Troubleshoot types of email sending-specific errors that you might encounter when you send an email through Amazon SES.
Read more >
Amazon SES error while sending email MessageRejected
The error may be MessageRejected or one of the errors specified in the Common Errors topic of the Amazon Simple Email Service API...
Read more >
Email notifications not working when using AWS
Sending of an Email Campaign fails, when using Amazon Simple Email Service (Amazon SES). Error "Email address is not verified.
Read more >
Why aren't the emails that I send through Amazon SES being ...
Skip directly to the demo: 0:31For more details see the Knowledge Center article with this video: ...
Read more >
[Solution] aws ses email not received - Courier
To resolve the error, verify that all the required handlebar parameters have been added to the templated email parameters when sending the email....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found