[Dovecot] [SOLVED] Errors in log file

Christian Rößner cr at sys4.de
Sat Dec 21 18:43:30 EET 2013


>>>> This is why it's not a good idea to use home as the Maildir root directory. You can work around this by setting maildir_stat_dirs=yes (minor performance hit). A bigger problem comes if a user creates a "dovecot/sieve" folder.
>>> I fully agree. The mailboxes are historical from an old Courier-IMAP server. Maybe more than 5 years ago. I switched to Dovecot in the past.
>>> Probably I will write a little script and rearrange the directory structure.
>> Solved! 15.000 lines bash script and now I have a perfect clean directory structure and all problems are gone
> Care to share the script? I collect cool little things like this in case I ever need something like it...

Of course. This script is a python script that generates the bash script. It assumes that the maildir is directly und a users home and that also the sieve folder lives inside the maildir. But the script is very simple, so you can adopt it to your needs:

Second, it looks for a sieve script called default.sieve, which I told roundcube to use as a name. So maybe you need to adjust this as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-mboxes.py
Type: text/x-python-script
Size: 2366 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20131221/5f60f811/attachment.bin>
-------------- next part --------------

The result looks something like:



umask 077


mv ${P}/deltaweb.de/cr ${P}/deltaweb.de/__maildir__cr__
mkdir ${P}/deltaweb.de/cr
chown vmail:mail ${P}/deltaweb.de/cr
mv ${P}/deltaweb.de/__maildir__cr__ ${P}/deltaweb.de/cr/maildir
mkdir ${P}/deltaweb.de/cr/sieve
chown vmail:mail ${P}/deltaweb.de/cr/sieve
if [[ -f ${P}/deltaweb.de/cr/maildir/sieve/default.sieve ]]; then
        mv ${P}/deltaweb.de/cr/maildir/sieve/default.sieve ${P}/deltaweb.de/cr/sieve/
        test -f ${P}/deltaweb.de/cr/maildir/.dovecot.svbin && \
                mv ${P}/deltaweb.de/cr/maildir/.dovecot.svbin ${P}/deltaweb.de/cr/
        test -f ${P}/deltaweb.de/cr/maildir/.dovecot.lda-dupes && \
                mv ${P}/deltaweb.de/cr/maildir/.dovecot.lda-dupes ${P}/deltaweb.de/cr/
        test -f ${P}/deltaweb.de/cr/maildir/.dovecot.sieve.log && \
                mv ${P}/deltaweb.de/cr/maildir/.dovecot.sieve.log ${P}/deltaweb.de/cr/
        ( cd ${P}/deltaweb.de/cr; ln -s sieve/default.sieve .dovecot.sieve )
        rm -f ${P}/deltaweb.de/cr/maildir/.dovecot.sieve
rm -rf ${P}/deltaweb.de/cr/maildir/sieve


exit 0

It is not perfect, but for our server it did the trick ;-) So enjoy? 

-Christian Rößner

[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://dovecot.org/pipermail/dovecot/attachments/20131221/5f60f811/attachment-0001.bin>

More information about the dovecot mailing list