Vacation and non-ASCII characters
Hi, as the reason string of a vacation command in SIEVE is considered to be in UTF-8 in absence of the :mime Parameter (see the Internet Draft) wouldn't it be correct, to set the MIME-Version and Content-Type Headers accordingly, when sending then vacation response? The attached diff was made against cyrus-imapd 2.1.9 and does exactly this. Please consinder including it into your cvs. -- regards, Ralf Haferkamp SuSE Linux AG- The Linux Experts - Deutschherrnstrasse 15-19 http://www.suse.com D-90429 Nuernberg, GermanyTel: +49-911-74053-0 --- imap/lmtpd.c2003/02/26 08:39:34 1.1 +++ imap/lmtpd.c2003/02/26 10:21:08 @@ -914,6 +914,9 @@ fprintf(sm, \r\nThis is a MIME-encapsulated message\r\n\r\n); fprintf(sm, --%d/%s\r\n, (int) p, config_servername); } else { + fprintf(sm, MIME-Version: 1.0\r\n); + fprintf(sm, Content-Type: text/plain; charset=utf-8\r\n); + fprintf(sm, Content-Transfer-Encoding: 8bit\r\n); fprintf(sm, \r\n); }
Re: Vacation and non-ASCII characters
Ralf Haferkamp wrote: Hi, as the reason string of a vacation command in SIEVE is considered to be in UTF-8 in absence of the :mime Parameter (see the Internet Draft) wouldn't it be correct, to set the MIME-Version and Content-Type Headers accordingly, when sending then vacation response? Its been a while since I looked at or worked on this part of the code, but IIRC, the MIME headers are expected to be included as part of the :mime response in the Sieve script. In theory (and I've actually tested it), the response doesn't have to be text, it could be a JPEG or something, so hardcoding the content as text/plain is not a good idea. -- Kenneth Murchison Oceana Matrix Ltd. Software Engineer 21 Princeton Place 716-662-8973 x26 Orchard Park, NY 14127 --PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
Re: Vacation and non-ASCII characters
On Thu, Feb 27, 2003 at 11:51:13AM -0500, Ken Murchison wrote: Ralf Haferkamp wrote: Hi, as the reason string of a vacation command in SIEVE is considered to be in UTF-8 in absence of the :mime Parameter (see the Internet Draft) wouldn't it be correct, to set the MIME-Version and Content-Type Headers accordingly, when sending then vacation response? Its been a while since I looked at or worked on this part of the code, but IIRC, the MIME headers are expected to be included as part of the :mime response in the Sieve script. In theory (and I've actually tested it), the response doesn't have to be text, it could be a JPEG or something, so hardcoding the content as text/plain is not a good idea. That's why the patch only adds the headers in cases where there is no :mime parameter in the vacation statement. This is what the ID states: 3.4. MIME Parameter The :mime parameter, if supplied, specifies that the reason string is, in fact, a MIME part, including MIME headers (see section 2.4.2.4 of [SIEVE]). If the optional :mime parameter is not supplied, the reason string is considered to be a UTF-8 string. -- regards, Ralf
Re: Vacation and non-ASCII characters
Ralf Haferkamp wrote: On Thu, Feb 27, 2003 at 11:51:13AM -0500, Ken Murchison wrote: Ralf Haferkamp wrote: Hi, as the reason string of a vacation command in SIEVE is considered to be in UTF-8 in absence of the :mime Parameter (see the Internet Draft) wouldn't it be correct, to set the MIME-Version and Content-Type Headers accordingly, when sending then vacation response? Its been a while since I looked at or worked on this part of the code, but IIRC, the MIME headers are expected to be included as part of the :mime response in the Sieve script. In theory (and I've actually tested it), the response doesn't have to be text, it could be a JPEG or something, so hardcoding the content as text/plain is not a good idea. That's why the patch only adds the headers in cases where there is no :mime parameter in the vacation statement. This is what the ID states: Sorry, I didn't look at your patch close enough (I missed the 'else') -- Kenneth Murchison Oceana Matrix Ltd. Software Engineer 21 Princeton Place 716-662-8973 x26 Orchard Park, NY 14127 --PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
Re: Vacation and non-ASCII characters
Hi, I have posted an almost identical patch as part of a suggested fix for [Bug 1723] Sieve notifications containing UTF-8 are not MIME encoded though no one seems to be doing anything with it. I added a check to see if the reason contained 8bit and added the headers in only that case. I saw no need to label something with only ASCII as UTF-8. Fixing notifications with out also fixing vacation as well seemed to be silly; though, I probably should have filed it as a separate bug. There are several other internationalization issues with sieve scripts as well as the sieve/lmtpd generated notification and vacation messages. They are documented in Bugzilla: #1710, #1721 - #1725. These probably aren't exhaustive; but, reflect only the problems that have been reported to me. Regards, Mark Keasling [EMAIL PROTECTED]