18

I use Mutt (1.5.21 on a headless Debian 7.2 Wheezy VPS) only occasionally, to see and delete messages from cron and the likes.

However, it keeps pestering me with this non-existent ~/Mail folder.

Mutt pestering

No need to say that it works perfectly with the folder not being created; I'm kind of miss the whole point of asking this every time.

Can I disable the message? (Or if that fails, change the path to something invisible?)

Alois Mahdal
  • 4,330
  • 11
  • 40
  • 62
  • 2
    I think you can change the mutt settings to look at a different mail directory. You could change it to whatever you are actually using instead. – Faheem Mitha Jan 06 '14 at 18:21
  • 1
    @FaheemMitha Since I can read all the (cron etc.) messages, I guess it already *knows* where my mail is (i guess it's /var/spool or something default on Debian). I don't get why it wants to create another location. – Alois Mahdal Jan 06 '14 at 18:26
  • 2
    That's just where your mail spool (usually the same as your inbox) lives. Mail folders are often in ~/Mail. – Faheem Mitha Jan 06 '14 at 18:39

5 Answers5

7

As Faheem points out in a comment, you can change the location of the default mail folder in your muttrc file (usually located at /etc/Muttrc for system-wide configurations or ~/.muttrc for local configurations). For example:

set folder = "~/.mail"

but you still have to create the folder, otherwise mutt will keep bugging you.

Mike
  • 459
  • 1
  • 5
  • 14
Ernest A
  • 1,833
  • 4
  • 20
  • 28
  • This could be complicated because procmail's default MAILDIR is $HOME/Mail. –  Jan 06 '14 at 20:48
  • 2
    @user55518 I see no problem with that. I don't use procmail but if I did, I could change *its* settings as well. – Alois Mahdal Nov 05 '14 at 22:44
4

The directory that Mutt is prompting about is the default directory containing mailboxes. (It is not itself a mailbox.) It's the directory that''s abbreviated as + at the beginning of a mailbox path in Mutt. You can't completely disable the feature (Mutt wants + to mean something), but you can change the location to something that exists like / or your home directory by setting the folder option.

set folder=~
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
2

set folder=/dev/null works if you want to suppress the prompt without having an actual directory.

1

The Mutt variable $folder determines the path to your mailbox directory. Out of the box, its value is ~/Mail. When this variable is set, but the directory is missing, Mutt offers to create it.

The answers claiming this directory or this variable must exist are mistaken. You can simply unset the variable. This can be done in .muttrc with the command: unset folder.

MetaEd
  • 1,412
  • 10
  • 8
  • couldn't it potentially lead to bad path if some other code, config or extension uses the variable? (For example, how in Bash unsetting var would expand to empty string..) – Alois Mahdal May 27 '23 at 20:19
  • there are a million mistakes a extension developer might make, but I think those are out of the scope of this question. – MetaEd May 28 '23 at 00:06
0

The message is dumped at Line 806 (main.c) and it seems you don't have the option to disable it.

To have a ~/Mail dir per default, you could for example add a line to your skel's:

# /etc/skel/.profile 
mkdir -p ~/Mail

So when you create a new user, the skel folder is copied to ~ and after the first login you'll have your ~/Mail dir. Prehaps a better way could be to modify adduser if it has some hooks for this kind of probs.

  • 2
    Well, I think simply creating the `/etc/skel/Mail` folder would be better than modifying .profile or adduser. OTOH, I'd be happier if the folder did not need to exist. – Alois Mahdal Nov 05 '14 at 22:43