[Dovecot] Dovecot 1.0.3: mbox problems for newly created users

Bernd Kuhls bernd.kuhls at informatik.uni-oldenburg.de
Mon Sep 10 00:52:02 EEST 2007


Hi,

Timo Sirainen wrote:
> On Tue, 2007-08-07 at 12:21 +0200, Bernd Kuhls wrote:
>> Now I create a new message in Thunderbird and save it as draft. A zero
>> byte file "Drafts" is created in /home/$user/.imap_mail/ but the message
>> I wanted to save got _lost_, /home/$user/.imap_mail/Drafts stays at zero
>> bytes. The next message I try to save as draft finds its way to the Drafts
>> mbox however.
> 
> Did you check what commands Thunderbird sends? Use e.g. rawlog
> (http://dovecot.org/bugreport.html). I don't think snarf plugin should
> cause this, and in general I can't think of a bug in Dovecot that would
> cause this.

I reproduced the bug with Dovecot 1.0.5 without snarf plugin and it
happened again.

The user I used is "kuhls2", its home is /home/kuhls2, the mail folder
(mbox format) is "/home/kuhls2/.imap_mail". This directory does not
exist when I started my tests with a fresh install of Thunderbird
2.0.0.6 on Windows XP. I need this scenario working because I am about
to switch from a working UW-IMAP install using /var/mail/$USER to
Dovecot using "$HOME/.imap_mail/". Saved mails should not get lost with
the new setup.

After setting up Thunderbird with IMAP/SSL access I connected to the
Dovecot server and logged in, .imap_mail looks like this after login:

> bach:/home/kuhls2/dovecot.rawlog# ls -la ../.imap_mail/
> total 12
> -rw------- 1 kuhls2 worker    0 2007-09-09 22:49 inbox
> -rw------- 1 kuhls2 worker    6 2007-09-09 22:49 .subscriptions
> -rw------- 1 kuhls2 worker    0 2007-09-09 22:49 Trash

These files were created during the first login with Thunderbird, note
that neither a mbox "Drafts" is created nor is it visible in
Thunderbirds folder list, which is ok.

Here is the rawlog of this transaction:

> # cat 20070909-234323-10517.in
> 3 namespace
> 4 lsub "" "*"
> 5 list "" "INBOX"
> 6 list "" "Trash"
> 7 create "Trash"
> 8 subscribe "Trash"
> 9 list "" "Trash"
> 10 select "INBOX"
> 11 getquotaroot "INBOX"
> 12 IDLE
> 
> # cat 20070909-234323-10517.out
> * OK [RAWLOG TIMESTAMP] 2007-09-09 23:43:23
> * NAMESPACE (("" "/")) NIL NIL
> 3 OK Namespace completed.
> 4 OK Lsub completed.
> * LIST (\NoInferiors \UnMarked) "/" "INBOX"
> 5 OK List completed.
> 6 OK List completed.
> 7 OK Create completed.
> 8 OK Subscribe completed.
> * LIST (\NoInferiors \UnMarked) "/" "Trash"
> 9 OK List completed.
> * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
> * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
> * 0 EXISTS
> * 0 RECENT
> * OK [UIDVALIDITY 1189369511] UIDs valid
> * OK [UIDNEXT 1] Predicted next UID
> 10 OK [READ-WRITE] Select completed.
> * QUOTAROOT "INBOX" ""
> * QUOTA "" (STORAGE 84 0)
> 11 OK Getquotaroot completed.
> + idling

Then I started to write a new mail and saved it as Draft, mbox Drafts
gets created with 0 byte length, no error message in Dovecot logfile nor
in Thunderbird, the mail content was not saved at all:

> bach:/home/kuhls2/dovecot.rawlog# ls -la ../.imap_mail/
> total 12
> -rw------- 1 kuhls2 worker    0 2007-09-09 22:51 Drafts
> -rw------- 1 kuhls2 worker    0 2007-09-09 22:49 inbox
> -rw------- 1 kuhls2 worker   13 2007-09-09 22:51 .subscriptions
> -rw------- 1 kuhls2 worker    0 2007-09-09 22:49 Trash
> bach:/home/kuhls2/dovecot.rawlog# cat ../.imap_mail/.subscriptions
> Trash
> Drafts

Here is the rawlog when saving the mail into drafts folder.
The first two log files had some lines added:

> # cat 20070909-234323-10517.in
> ...
> DONE
> 13 list "" "Drafts"
> 14 create "Drafts"
> 15 subscribe "Drafts"
> 16 list "" "Drafts"
> 17 IDLE
> 
> 
> # cat 20070909-234323-10517.out
> ...
> 12 OK Idle completed.
> 13 OK List completed.
> 14 OK Create completed.
> 15 OK Subscribe completed.
> * LIST (\NoInferiors \UnMarked) "/" "Drafts"
> 16 OK List completed.
> + idling

And two new logfiles were created:

> # cat 20070909-234439-10531.in
> 3 select "Drafts"
> 4 IDLE
> 
> 
> # cat 20070909-234439-10531.out
> * OK [RAWLOG TIMESTAMP] 2007-09-09 23:44:39
> * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
> * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
> * 0 EXISTS
> * 0 RECENT
> * OK [UIDVALIDITY 1189370254] UIDs valid
> * OK [UIDNEXT 1] Predicted next UID
> 3 OK [READ-WRITE] Select completed.
> + idling

Please note that I start Dovecot using inetd:

> imap    stream  tcp     nowait  root    /usr/sbin/tcpd /usr/lib/dovecot/imap-login
> imaps   stream  tcp     nowait  root    /usr/sbin/tcpd /usr/lib/dovecot/imap-login --ssl
> pop3    stream  tcp     nowait  root    /usr/sbin/tcpd /usr/lib/dovecot/pop3-login
> pop3s   stream  tcp     nowait  root    /usr/sbin/tcpd /usr/lib/dovecot/pop3-login --ssl


> Doesn't Dovecot use /var/mail/$user then as the INBOX if
> the .imap_mail/inbox doesn't exist?

Yes, it seems so but its not a problem for me because the mails get
snarfed later on.

Here is the config:

> # dovecot -n
> # 1.0.5: /etc/dovecot/dovecot.conf
> log_path: /var/log/dovecot/dovecot.main
> log_timestamp: %Y-%m-%d %H:%M:%S
> protocols: imap imaps pop3 pop3s
> login_dir: /var/run/dovecot/login
> login_executable(default): /usr/lib/dovecot/imap-login
> login_executable(imap): /usr/lib/dovecot/imap-login
> login_executable(pop3): /usr/lib/dovecot/pop3-login
> mail_extra_groups: mail
> mail_location: mbox:~/.imap_mail:INDEX=/var/mail/indexes/%u
> mail_executable(default): /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap
> mail_executable(imap): /usr/lib/dovecot/rawlog /usr/lib/dovecot/imap
> mail_executable(pop3): /usr/lib/dovecot/pop3
> mail_plugins(default): quota imap_quota
> mail_plugins(imap): quota imap_quota
> mail_plugins(pop3):
> mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
> mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
> mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
> imap_client_workarounds(default): outlook-idle netscape-eoh tb-extra-mailbox-sep delay-newmail
> imap_client_workarounds(imap): outlook-idle netscape-eoh tb-extra-mailbox-sep delay-newmail
> imap_client_workarounds(pop3): outlook-idle
> pop3_uidl_format(default):
> pop3_uidl_format(imap):
> pop3_uidl_format(pop3): %08Xv%08Xu
> auth default:
>   passdb:
>     driver: pam
>   userdb:
>     driver: passwd
> plugin:
>   quota: fs

Greetings, Bernd Kuhls



More information about the dovecot mailing list