Sergey Grigorian
2009-Sep-11 21:59 UTC
[Dovecot] Sieve, vacation, variables and russian language
Folks, I'm using a Sieve script for vacation messages and there's something strange with it in certain cases. The script uses the "variables" extension to produce the "Re: [original subject] (autoreply)" subject line for the vacation message. All is well except for cases when that [original subject] is written in Russian. In those cases the subject string is garbled, and the Amavis content filter says "X-Amavis-Alert: BAD HEADER SECTION, Non-encoded 8-bit data (char D0 hex):Subject: RE: \320\277\321?\320\276\320\261\320\260 (Auto[...]" It doesn't complain about English subject strings, though. I've seen the thread about "Sieve vacation with russian subject" at http://www.dovecot.org/list/dovecot/2009-July/041031.html , but that wasn't quite a solution. I can't figure out how to work around that, could anyone help out please? Mandatory info: FreeBSD 7.2 i386, dovecot 1.2.3, dovecot-sieve-1.2+0.1.11 And here's the script itself: require ["fileinto", "vacation", "variables"]; set "subject" ""; if header :matches "subject" "*" { set "subject" "${1}"; } vacation :days 1 :subject "RE: ${subject}" "[vacation message text]"; P.S. Stephan Bosch, thank you very much for what you've done with sieve.
Timo Sirainen
2009-Sep-11 22:05 UTC
[Dovecot] Sieve, vacation, variables and russian language
On Sat, 2009-09-12 at 01:59 +0400, Sergey Grigorian wrote:> The script uses the "variables" extension to produce the "Re: [original > subject] (autoreply)" subject line for the vacation message. > > All is well except for cases when that [original subject] is written in > Russian.This is a TODO item: - Vacation: the ":subject" parameter specifies a subject line to attach to any vacation response that is generated. UTF-8 characters can be used in the string argument; implementations MUST convert the string to [RFC2047] encoded words if and only if non-ASCII characters are present. I think the main reason this hasn't been implemented yet is that this conversion isn't required anywhere else in Dovecot. So the first step would be to create RFC 2047 encoder for Dovecot. Feel free to implement one. :) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090911/e608e1f8/attachment-0002.bin>
sg at theconcept.ru
2009-Sep-11 22:11 UTC
[Dovecot] Sieve, vacation, variables and russian language
On Fri, 11 Sep 2009 18:05:34 -0400, Timo Sirainen <tss at iki.fi> wrote:> On Sat, 2009-09-12 at 01:59 +0400, Sergey Grigorian wrote: >> The script uses the "variables" extension to produce the "Re: [original >> subject] (autoreply)" subject line for the vacation message. >> >> All is well except for cases when that [original subject] is written in >> Russian. > > This is a TODO item: > > > - Vacation: the ":subject" parameter specifies a subject line to attach > to > any vacation response that is generated. UTF-8 characters can be used > in > the string argument; implementations MUST convert the string to > [RFC2047] > encoded words if and only if non-ASCII characters are present. > > I think the main reason this hasn't been implemented yet is that this > conversion isn't required anywhere else in Dovecot. So the first step > would be to create RFC 2047 encoder for Dovecot. Feel free to implement > one. :)Oh well. Should've read the TODO with more attention. Thanks a lot, it all is clear now. Honestly, I suck at implementing, but might give it a try (if nobody more able will do that, that is). :)