12 Sep
2009
12 Sep
'09
1:51 a.m.
On Fri, 2009-09-11 at 18:05 -0400, Timo Sirainen wrote:
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. :)
Well, I actually spent some time writing the code anyway. Not tested at all currently. I started writing unit tests but it didn't get very far. I'm not really sure what kind of decisions I should use to figure out where to start/end the encoded words or when to use base64 instead of q-p. Currently it uses:
- if only one word has non-ascii, encode only that word. otherwise encode the whole string.
- if more than 1/3 of string has non-ascii characters, use base64.
Attached a patch for it. Of course you'd still need to change Sieve to use it.