Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211968 - mail-client/mutt-1.5.16: creates broken ~/.maildir/
Summary: mail-client/mutt-1.5.16: creates broken ~/.maildir/
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-01 13:44 UTC by Martin Mokrejš
Modified: 2009-07-23 13:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2008-03-01 13:44:33 UTC
$ rm -rf ~/.maildir/
$ mutt
/home/mmokrejs/.maildir does not exist. Create it? ([yes]/no): yes

...

---Mutt: (no mailbox) [Msgs:0]---(date/date)-----------------------------------------------------------------------------------------------------(all)---
/home/mmokrejs/.maildir/ is not a mailbox.


I see why:
$ ls -la .maildir
total 8
drwx------  2 mmokrejs mmokrejs 4096 Mar  1 14:42 .
drwx--x--x 74 mmokrejs mmokrejs 4096 Mar  1 14:42 ..
$

The cur/, tmp/ and new/ subdirs are missing.
Comment 1 Fernando J. Pereda (RETIRED) gentoo-dev 2008-06-07 16:04:40 UTC
What are your USE flags for mutt?

Sorry it took so long. Please reopen with your flags, I'm fixing it with NEEDINFO so I can focus on the bugs I have info for. (Not because I don't consider this a bug).

- ferdy
Comment 2 Martin Mokrejš 2008-06-08 19:55:06 UTC
$ rm -rf ~/.maildir/
$ mutt
$ ls -la .maildir/
total 8
drwx------  2 mmokrejs mmokrejs 4096 Jun  8 21:52 .
drwx--x--x 96 mmokrejs users    4096 Jun  8 21:52 ..
$ emerge -pv mutt
[ebuild   R   ] mail-client/mutt-1.5.16  USE="berkdb crypt gdbm gnutls gpgme nls nntp sasl smime ssl -debug -idn -imap -mbox -pop -qdbm -sidebar -smtp -vanilla" 0 kB 
$

So, I can reproduce it still on ~x86 host.
Comment 3 Fernando J. Pereda (RETIRED) gentoo-dev 2008-06-09 07:54:56 UTC
Ok.. so mutt-1.5.18 is doing the same. I wonder whether that's the desired functionality by upstream. I'll dig in the sources.

- ferdy
Comment 4 Fabian Groffen gentoo-dev 2009-06-28 12:41:01 UTC
can you please try 1.5.20?
Comment 5 Martin Mokrejš 2009-07-17 12:12:32 UTC
Yes, same problem with 1.5.20.
Comment 6 Eray Aslan gentoo-dev 2009-07-19 17:01:00 UTC
mutt-1.5.20 main.c:
[...]
    if (stat (fpath, &sb) == -1 && errno == ENOENT)
    {
      snprintf (msg, sizeof (msg), _("%s does not exist. Create it?"), Maildir);
      if (mutt_yesorno (msg, M_YES) == M_YES)
      {
        if (mkdir (fpath, 0700) == -1 && errno != EEXIST)
          mutt_error ( _("Can't create %s: %s."), Maildir, strerror (errno));
      }
    }
[...]

Mutt just creates the $folder directory as seen above.  It does not create {cur,new,temp} because we do not know whether the mailbox is maildir, mbox or something else at this point.

Arguably, it is not mutt's job to create {cur,new,temp} directory structure when there are no messages.  They should be created by LDA when a message arrives.

Moreover, some of the errors OP gets are due to missing spool directory.  "rm -rf .maildir" removes spool directory as well (assuming default /etc/mutt/Muttrc settings).  Point spoolfile to a existing directory in Muttrc to get rid of them.

While we are at it, it is perhaps time to make use of Sent and Drafts folders the default in Mutt.  They are supported by Courier, Dovecot, Kmail, Thunderbird and probably other MUA and IMAP servers as well:

--- /etc/mutt/Muttrc.orig	2009-07-19 16:22:43.000000000 +0300
+++ /etc/mutt/Muttrc	2009-07-19 19:52:28.000000000 +0300
@@ -8,9 +8,10 @@
 # other than the index.
 
 set mbox_type=Maildir
-set folder=~/.maildir
-set spoolfile=~/.maildir/
-set record=~/.maildir-sent/
+set folder="~/.maildir"
+set spoolfile="~/.maildir/"
+set record="+.Sent"
+set postponed="+.Drafts"
 set move=no
 
 # Maybe we shouldn't set index_format here, but this is a recommended
Comment 7 Fabian Groffen gentoo-dev 2009-07-21 17:29:12 UTC
(In reply to comment #6)
> While we are at it, it is perhaps time to make use of Sent and Drafts folders
> the default in Mutt.  They are supported by Courier, Dovecot, Kmail,
> Thunderbird and probably other MUA and IMAP servers as well:
> 
> --- /etc/mutt/Muttrc.orig       2009-07-19 16:22:43.000000000 +0300
> +++ /etc/mutt/Muttrc    2009-07-19 19:52:28.000000000 +0300
> @@ -8,9 +8,10 @@
>  # other than the index.
> 
>  set mbox_type=Maildir
> -set folder=~/.maildir
> -set spoolfile=~/.maildir/
> -set record=~/.maildir-sent/
> +set folder="~/.maildir"
> +set spoolfile="~/.maildir/"
> +set record="+.Sent"
> +set postponed="+.Drafts"
>  set move=no
> 
>  # Maybe we shouldn't set index_format here, but this is a recommended

Shouldn't that be =Sent and =Drafts instead then?  That's at least what they are called for me.  Feels like a hairy issue with no real good default.
Comment 8 Fabian Groffen gentoo-dev 2009-07-23 13:47:57 UTC
If you believe this to be a true Mutt error, please report it upstream:
http://dev.mutt.org/trac/
With the analysis from comment #6, there is not much that we can do here.