awdeorio / mailmerge

A simple, command line mail merge tool.
MIT License
144 stars 41 forks source link

Crashes on email adresses with illegal characters #143

Open philpagel opened 2 years ago

philpagel commented 2 years ago

When an email address contains invalid characters (i.e. on-ASCII) mailmerge crashes with a stack trace. Expected behavior: some kind of error message instead of crash. Ideally, continuing to send the remaining emails.

Example: email: müller@somewhere.com which contains an umlaut that shouldn't be there. Result: UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 10: ordinal not in range(128)

awdeorio commented 2 years ago

Thanks for your diligent reporting @philpagel ! This absolutely needs a unit test and a fix.

philpagel commented 2 years ago

After some more reading, it seems that non-ASCII characters are in fact allowed in email addresses if the smtp server announces support for the UTF8SMTP extension. Sources: