[Dovecot] migration and conversion from courier

Giuliano Gavazzi dev+lists at humph.com
Mon May 18 01:57:43 EEST 2009


On S 17 May, 2009, at 20:45 , Timo Sirainen wrote:

> On Fri, 2009-05-15 at 10:55 +0200, Giuliano Gavazzi wrote:
>> Perhaps the only solution is to have a new script that deletes the
>> garbage lines and renumbers the following ones, so that the above
>> example would become:
>>
>> 0 JunkRecorded
>> 1 $NotJunk
>> 2 $Junk
>> 3 Redirected
>> 4 $Forwarded
>>
>> and then renames all *g files to *e.
>
> You don't have to do any renaming, the keywords don't need to be
> sequential. Just delete those lines with broken keywords. When adding
> new keywords Dovecot will then use the missing spots.

that's great, thanks!

I suppose something like this should work, repeated over all maildirs:

/usr/local/etc/rc.d/dovecot stop
find . -name "dovecot-keywords2" -exec sed -E -i .bu -e '/ 
^[0-9]\ .*[^[:print:]].*$/d' \{\} \;
/usr/local/etc/rc.d/dovecot start

(adapt to your system way to stop and start service)

There's only one point that escapes me, why perform the conversion  
when migrating (using the --convert option) given that on the system  
where I did not perform it the flags have been preserved (the files  
got their name change consistently). Does dovecot detect the presence  
of the courierimapkeywords/:list file and use its content? Seems  
unlikely as a grep on the source does not reveal any match. Maybe it's  
the MUA (Mail.app in the instance I checked) that did synchronise the  
flags?


Giuliano


More information about the dovecot mailing list