[racket-dev] Email encoding in net/sendmail

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Dec 20 16:22:53 EST 2011

I've revised `net/sendmail', with one noticeable change where it now
encodes the sender/subject/recipient strings if they contain non-ascii
characters.  (This is fine for existing uses that already do that
before calling sendmail, since the quoted string will not have such

But this raises two related questions:

1. The quoting (which is done by `net/unihead') uses a
   quoted-printable latin-1 encoding unless there are characters
   higher than 255, and in that case it switches to a base64 encoding
   with utf-8.

   It seems to me that always using utf-8 is better, with
   quoted-printable to make it possible to decipher some of the text
   when viewed in raw form.  Any objections to doing that?

   (IIUC, this change would affect only sirmail.)

2. There is still an issue with non-ascii content in the body.
   Digging around, it seems to me that the easiest way to make it work
   is to always add a "Content-Transfer-Encoding: 8bit" header.

   Does anyone know if this is a correct way to do this?  (I'm not
   clear about the differences between the different "content"

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.