From: Steven M. <nm...@ap...> - 2006-03-05 10:36:29
|
Regarding adding a Content-Type header to submitted data email messages: Jonathan Stowe wrote: >Well, yes but the content is actually still assumed to be encoded as 7, >the rfc you cited earlier doesn't make any provision for this. I think > > The content of an email body MUST to be 7-bit for the old fashioned RFC-821/822 SMTP servers, and for them, yes the content must be encoded "quoted printable" or something, and the Content-Transfer-Encoding and Content-Type headers should be set appropriately. FormMail is currently broken for these servers because it doesn't do that. Servers can indicate that they can accept messages that contain 8-bit bytes in the body. An RFC defining this capability, 8BITMIME, for was published in 1994: http://en.wikipedia.org/wiki/8BITMIME Some mail servers already implement this. For these mail servers, it is sufficient to simply add the correct content-type header describing the body of the email message. If the mail server needs to relay the mail to a server that does not support 8BITMIME, then the RFCs say that it is the servers job to transfer encode the message body: http://www.faqs.org/rfcs/rfc2821.html My opinion is 1/ Adding the header doesn't make things more broken than they are already. 2/ The most common case is that the sending ESMTP server will support 8BITMIME extension. 3/ Adding the header is a valuable clue for receiving mail clients for the common case. 4/ Doing a proper transfer encoding would be a significant change to a dead-end script, so not worth persuing? Regarding older versions of Perl -- I'm not sure how older versions of Perl will change the decoding of the 8-bit characters. The behaviour that they need to handle is this: If my HTML form is in charset 8859-15, then the Euro symbol is encoded as %A4 (by the browser); if the charset is UTF-8 the Euro is %E2%82%AC. CGI.pm decodes these back to bytes when the form is received. As long as Perl 5 supports 8-bit characters, I don't see how it can know to convert them to any other representation, it just needs to package the bytes unchanged in to the email, and with the Content-Type header, I'm happy :-) I hope that's interesting and helpful to you! Steven |