Fix encoding issues with 'name' part of address headers #6

merged 4 commits into from Nov 28, 2011


None yet

2 participants


This fixes the problem in #5, as well as a similar issue with characters like '@' being used in the name part of an address header.

There are some API design decisions in here, like what kind of arguments simpleMail takes. I've chosen an Address, since a String would mean you can't pass a name anymore. I've also created a convenience constructor emptyMail, since Mail has so many fields now. Feel free to change any of these decisions if you want.

hesselink added some commits Nov 3, 2011
@hesselink hesselink Add explicit fields in Mail for from, to, cc and bcc.
These fields have type Address, which is a combination of a name (optional) and an email. This is needed because encoding the email part is not allowed by RFC 2047.
@hesselink hesselink Add emptyMail function to more easily create Mail.
This is convenient now that Mail has more fields.
@hesselink hesselink Encode all special characters from RFC 2822.
Many (but not all) of these went wrong with some mail servers when used as 'name' part of an address header (from, to, cc, bcc).
@hesselink hesselink Bump version number after changes to Mail and simpleMail. e2e6de1
snoyberg commented Nov 4, 2011

This looks good to me. Can you send an email to the haskell-cafe mentioning these changes and see if anyone is opposed? If not, I'll pull and release.


Sorry for leaving this so long. I've just sent an email to -cafe.

@snoyberg snoyberg merged commit b1fb831 into snoyberg:master Nov 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment