Hello list,
Today, my users have noticed, that delivery to folders with non-english names is broken. For example, if I create russian directory, it correct encoded and display into mail-client program and my webmail: Encoded: Normal view .INBOX.&BEIENQRBBEI- русс
This is part of sieve script, which routing delivery to russian folder. .... elsif allof (header :contains "Subject" "qwe") { fileinto "INBOX/&BEIENQRBBEI-"; }
But, when actualy delivery take place, in logs I have
Jul 30 17:13:49 deliver(koshikov.n@domain.com): Info: sieve: msgid=<4A71A9E6.5040301@domain.com>: stored mail into mailbox 'INBOX/&-BEIENQRBBEI-
And folder .INBOX.&-BEIENQRBBEI- appears in users maildir. This folder can't be unencoded by mail-client program and user see exactly "&-BEIENQRBBEI-" under INBOX directory(also normaly encoded directory "&BEIENQRBBEI-" --> "русс" displays correct). Something breaks encoding and adds sing "-" to all words in utf encoded directory names.
I can't tell exactly when this problem appear, but I remember that I have tested delivery to russian directories by sieve scripts and all worked fine.
My current dovecot installation is 1.2.2, dovecot-sieve-0.1.9 and managesieve-0.11.7
Nikita Koshikov schreef:
Hello list,
Today, my users have noticed, that delivery to folders with non-english names is broken. For example, if I create russian directory, it correct encoded and display into mail-client program and my webmail: Encoded: Normal view .INBOX.&BEIENQRBBEI- русс
This is part of sieve script, which routing delivery to russian folder. .... elsif allof (header :contains "Subject" "qwe") { fileinto "INBOX/&BEIENQRBBEI-"; }
But, when actualy delivery take place, in logs I have
Jul 30 17:13:49 deliver(koshikov.n@domain.com): Info: sieve: msgid=<4A71A9E6.5040301@domain.com>: stored mail into mailbox 'INBOX/&-BEIENQRBBEI-
And folder .INBOX.&-BEIENQRBBEI- appears in users maildir. This folder can't be unencoded by mail-client program and user see exactly "&-BEIENQRBBEI-" under INBOX directory(also normaly encoded directory "&BEIENQRBBEI-" --> "русс" displays correct). Something breaks encoding and adds sing "-" to all words in utf encoded directory names.
I can't tell exactly when this problem appear, but I remember that I have tested delivery to russian directories by sieve scripts and all worked fine.
My current dovecot installation is 1.2.2, dovecot-sieve-0.1.9 and managesieve-0.11.7 You are using mUTF-7 in folder names. According to the Sieve specification, you must use the UTF-8 version. The fileinto command internally translates this to the mUTF-7 equivalent, so that the IMAP server sees it as expected. This is a change of about half a year ago:
http://hg.rename-it.nl/dovecot-1.2-sieve/rev/fc0395d50d04
Regards,
-- Stephan Bosch stephan@rename-it.nl
On Thu, 30 Jul 2009 17:06:35 +0200 Stephan Bosch <stephan@rename-it.nl> wrote:
You are using mUTF-7 in folder names. According to the Sieve specification, you must use the UTF-8 version. The fileinto command internally translates this to the mUTF-7 equivalent, so that the IMAP server sees it as expected. This is a change of about half a year ago:
How can I set utf-8 as folder names ? my $LANG is ru_RU.UTF-8 now. I might misunderstand something, but why client created folder name in mUTF-7 and sieve fileinto internally converted mUTF-7 name are not the same ?
/usr/libexec/dovecot/imap-utf7 -r "тест" &BEIENQRBBEI- // this is like clients create mail
/usr/libexec/dovecot/imap-utf7 "&BEIENQRBBEI-" тест //this decoding fine
/usr/libexec/dovecot/imap-utf7 "&-BEIENQRBBEI-" &BEIENQRBBEI- //this is like sieve created folder looks in the mail-client programs.
Nikita Koshikov schreef:
On Thu, 30 Jul 2009 17:06:35 +0200 Stephan Bosch <stephan@rename-it.nl> wrote:
You are using mUTF-7 in folder names. According to the Sieve specification, you must use the UTF-8 version. The fileinto command internally translates this to the mUTF-7 equivalent, so that the IMAP server sees it as expected. This is a change of about half a year ago:
How can I set utf-8 as folder names ? my $LANG is ru_RU.UTF-8 now. I might misunderstand something, but why client created folder name in mUTF-7 and sieve fileinto internally converted mUTF-7 name are not the same ?
/usr/libexec/dovecot/imap-utf7 -r "тест" &BEIENQRBBEI- // this is like clients create mail
/usr/libexec/dovecot/imap-utf7 "&BEIENQRBBEI-" тест //this decoding fine
/usr/libexec/dovecot/imap-utf7 "&-BEIENQRBBEI-" &BEIENQRBBEI- //this is like sieve created folder looks in the mail-client programs. Well, I guess the final situation is caused by the fact that the folder name is encoded in mUTF7 two times.
At my end the following Sieve script works as expected:
require "fileinto";
fileinto "тест";
Result:
Jul 31 09:01:02 xi dovecot: deliver(stephan): sieve: msgid=<20090729182144.4c9baf96@jimbo>: stored mail into mailbox '&BEIENQRBBEI-'
I guess you are doing:
require "fileinto";
fileinto "&BEIENQRBBEI-";
Result:
Jul 31 09:04:53 xi dovecot: deliver(stephan): sieve: msgid=<20090729182144.4c9baf96@jimbo>: stored mail into mailbox '&-BEIENQRBBEI-'
So, use the "тест" UTF-8 string in your scripts directly.
Regards,
-- Stephan Bosch stephan@rename-it.nl
On Jul 31, 2009, at 3:06 AM, Stephan Bosch wrote:
Jul 31 09:01:02 xi dovecot: deliver(stephan): sieve:
msgid=<20090729182144.4c9baf96@jimbo>: stored mail into mailbox
'&BEIENQRBBEI-'
BTW. I've in my TODO:
- deliver: log mailbox name using utf8, not mutf7
Maybe we should both change it sometimes soon? :)
On Fri, 31 Jul 2009 09:06:04 +0200 Stephan Bosch <stephan@rename-it.nl> wrote:
Well, I guess the final situation is caused by the fact that the folder name is encoded in mUTF7 two times.
At my end the following Sieve script works as expected:
require "fileinto";
fileinto "тест";
Result:
Jul 31 09:01:02 xi dovecot: deliver(stephan): sieve: msgid=<20090729182144.4c9baf96@jimbo>: stored mail into mailbox '&BEIENQRBBEI-'
I guess you are doing:
require "fileinto";
fileinto "&BEIENQRBBEI-";
Result:
Jul 31 09:04:53 xi dovecot: deliver(stephan): sieve: msgid=<20090729182144.4c9baf96@jimbo>: stored mail into mailbox '&-BEIENQRBBEI-'
So, use the "тест" UTF-8 string in your scripts directly.
Thank you, Stephan. The problem was with managesieve plugin to rouncube webmail, which construct "fileinto" rules with non-decoding utf-7 values. I should fix this in php.
Thanks again.
Regards,
-- Stephan Bosch stephan@rename-it.nl
participants (4)
-
Charles Marcus
-
Nikita Koshikov
-
Stephan Bosch
-
Timo Sirainen