Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] ~/.maildir is not a mailbox?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Wed Mar 22, 2017 7:09 pm    Post subject: [SOLVED] ~/.maildir is not a mailbox? Reply with quote

I had recently installed mutt, but an issue had arisen. When I open mutt, a message at the bottom said /home/myusername/.maildir is not a mailbox.

So I changed some stuff in /etc/mutt/Muttrc; converting the directory from /home/myusername/.maildir to /var/spool/mail.
But, it did not have permissions, so I typed

# chown root:mail /var/spool/mail/
# chmod root:mail /var/spool/mail/

Once again, mutt complained that /var/spool/mail was not a mailbox.

What do I do then?

Any answer will help.
Thank you.

EDIT:

/etc/mutt/Muttrc with /home/myusername/.maildir

# Some minimal Mutt settings, Gentoo-style. These reflect the Gentoo
# predilection for maildir folders.
#
# Please don't add settings to this file to change other user
# preferences (such as colors), since those can be hard for a user to
# undo if their preference doesn't match yours! For example, it is
# *impossible* currently in mutt to remove color settings from objects
# other than the index.

set mbox_type=Maildir
set folder=~/.maildir
set spoolfile=~/.maildir/
set record=~/.maildir-sent/
set move=no

# Maybe we shouldn't set index_format here, but this is a recommended
# one for maildir-style folders.

set index_format="%4C %Z %{%b %d} %-16.16L %s"


/etc/mutt/Muttrc with /var/spool/mail with permissions

#Some minimal Mutt settings, Gentoo-style. These reflect the Gentoo
# predilection for maildir folders.
#
# Please don't add settings to this file to change other user
# preferences (such as colors), since those can be hard for a user to
# undo if their preference doesn't match yours! For example, it is
# *impossible* currently in mutt to remove color settings from objects
# other than the index.

set mbox_type=Maildir
set folder=/var/spool/mail
set spoolfile=/var/spool/mail/
set record=/var/spool/mail/
set move=no

# Maybe we shouldn't set index_format here, but this is a recommended
# one for maildir-style folders.

set index_format="%4C %Z %{%b %d} %-16.16L %s"
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep


Last edited by roboto on Thu Mar 23, 2017 2:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Wed Mar 22, 2017 7:32 pm    Post subject: Reply with quote

Try /var/spool/mail/username

Edit to add, that one file will essentially be your (usual or default) INBOX. Any additional folders for mail will most likely be installed somewhere off /home/username.
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Wed Mar 22, 2017 7:54 pm    Post subject: Reply with quote

cboldt wrote:
Edit to add, that one file will essentially be your (usual or default) INBOX.

I don't quite understand what you're aiming at.

I created the /var/spool/mail/myusername directory but I'm not quite sure what to do next.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Wed Mar 22, 2017 8:22 pm    Post subject: Reply with quote

Delete the directory you just created.

Tell mutt your mail will be at /var/spool/username <- oops, should be /var/spool/mail/username

Something, not you directly, will create the file. On my system, this file was created by postfix.

Edit "oops". Same principle though, don't create that file, just tell mutt that's where your Mail Transfer Agent (MTA) is going to put your email.
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Wed Mar 22, 2017 8:34 pm    Post subject: Reply with quote

cboldt wrote:


Edit "oops". Same principle though, don't create that file, just tell mutt that's where your Mail Transfer Agent (MTA) is going to put your email.


And how do I do it?
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Wed Mar 22, 2017 9:27 pm    Post subject: Reply with quote

What were you using for a mail reader before you decided to use mutt? Use that mail reader's configuration to guide configuration of mutt.

If you want your machine to host e-mail (which I perhaps incorrectly assumed you were already doing, because your question was, in other terms "how do I get mutt to interact with the e-mail that is already on my system?"), that is totally separate from setting up mutt, and as you might imagine, there are many way to get your machine to host email.

sendmail
postfix
qmail
exim
nullmailer
courier
opensmtpd
... and more!

And even THAT doesn't fully describe the options, because it is possible to have other programs transfer mail from outside mail sources to your system (e.g., fetchmail), and yet others do some sorting (e.g., procmail)., and yet others to "serve" email (e.g., dovecot).

I wish I knew of a good howto. I searched for a gentoo-centric howto, and none of them are what I consider "basic."
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Wed Mar 22, 2017 9:40 pm    Post subject: Reply with quote

*I have Thunderbird to read my e-mail, but I prefer doing things through the console.

I have no idea what kind of service I have e.g. postfix.

When it comes to hosting e-mail in Linux, I am completely gullible. :? :(

I use an IMAP server for reading e-mail, if it's necessary.

And *where* do I find mutt's configuration, the only one I know is /etc/mutt/Muttrc, but I don't know what else to do with it.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
cboldt
Veteran
Veteran


Joined: 24 Aug 2005
Posts: 1046

PostPosted: Wed Mar 22, 2017 9:50 pm    Post subject: Reply with quote

You can get mutt to read email the same way (close enough) that thunderbird does. I use pine, another console mail reader, dabbled with mutt years ago, and never took a shine to it.

The pertinent settings just to get e-mail will be found in thunderbird's "Edit / Account Settings"

I feel your pain as a person new to setting up e-mail. It is confusing, and the supposedly helpful material floating around in the wild goes in many directions.

Edit to add a couple remarks:

- muttrc is the config file for mutt
- your system does not need to host email, in order you to read email from your system
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Mar 22, 2017 10:46 pm    Post subject: Re: ~/.maildir is not a mailbox? Reply with quote

roboto wrote:
I had recently installed mutt, but an issue had arisen. When I open mutt, a message at the bottom said /home/myusername/.maildir is not a mailbox.

roboto ... as you have 'set mbox_type=Maildir' then mutt expects this "mailbox" to be 'maildir' ... what is a maildir?

Code:
% ls ~/.maildir
cur/  new/  tmp/
% ls -ld ~/.maildir
lrwxrwxrwx 1 khayyam users 23 2012-10-17 11:32 /home/khayyam/.maildir -> mail/aporia-local/INBOX/

A maildir is a special directory containing three directories 'cur', 'new', and 'tmp', when your MTA, or "mail program" delivers, or recieves, mail it should create such a directory (as this is the maildir 'format' ... the 'mbox' format being a flat file) but in your case you don't have an MTA, and the "mail program" (ie, thunderbird) is using some other location for mail storage.

roboto wrote:
So I changed some stuff in /etc/mutt/Muttrc; converting the directory from /home/myusername/.maildir to /var/spool/mail. But, it did not have permissions, so I typed [...]

Don't :) ... /var/spool/mail isn't used (if it was you would know, because you would have setup your MTA to use it), generally an MTA will deliver to the user's home, eg:

Code:
% grep maildir /etc/postfix/main.cf
home_mailbox = .maildir/

... but, again, by the sounds of it you don't have an MTA, and only thunderbird is transfering mail, and to a maildir of it's own design/configuration.

To use mutt you need to decide how you are going to manage mail (both sending, and recieving) and how this is going to work with other clients (ie, thunderbird). Currently thunderbird is probably using 'pop', or 'imap', and acts as its own SMTP (sending outgoing mail via smtp.foo.tld), mutt can also do this (if you set USE="smtp" or USE="smtp imap") but, if you have multiple clients you need to be carefull that whatever method you use isn't going to conflict with other clients. You could point mutt to thunderbirds 'maildir' but this won't allow mutt to send outgoing mail, you're best to use imap on both clients and so 'set folder="imaps://mail.foo.tld/', 'set spoolfile=+INBOX', 'set smtp_url=', etc, etc ... but how you do this (or the kind of configuration required) depends upon your making some decisions about mail handling (ie, if thunderbird is still in the loop or not).

roboto wrote:
And *where* do I find mutt's configuration, the only one I know is /etc/mutt/Muttrc, but I don't know what else to do with it.

Like most cli applications, it will first look in $HOME

print -rl ~/.mutt{rc,/*}:
/home/khayyam/.muttrc
/home/khayyam/.mutt/00-personal
/home/khayyam/.mutt/01-aliases.d
/home/khayyam/.mutt/02-keybindings
/home/khayyam/.mutt/03-hooks
/home/khayyam/.mutt/04-charsets
/home/khayyam/.mutt/05-gpg-autoencrypt
/home/khayyam/.mutt/05-gpg.rc
/home/khayyam/.mutt/05-gpgme.rc-DISABLED
/home/khayyam/.mutt/06-imap-DISABLED
/home/khayyam/.mutt/07-mutt-colors-solarized
/home/khayyam/.mutt/08-lists
/home/khayyam/.mutt/certificates
/home/khayyam/.mutt/display-filters
/home/khayyam/.mutt/mailcap
/home/khayyam/.mutt/mailcap-DISABLED
/home/khayyam/.mutt/scripts

grep '^source' ~/.muttrc:
source ~/.mutt/00-personal
source ~/.mutt/01-aliases.d/aliases
source ~/.mutt/02-keybindings
source ~/.mutt/03-hooks
source ~/.mutt/04-charsets
source ~/.mutt/05-gpg.rc
source ~/.mutt/05-gpg-autoencrypt
source ~/.mutt/07-mutt-colors-solarized/mutt-colors-solarized-dark-16.muttrc

HTH & best ... khay
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Thu Mar 23, 2017 12:00 am    Post subject: Reply with quote

I don't have any mutt file or directory in /home/myusername except for ~/.maildir and ~/.maildir-sent.

khay... you typed:

print -rl ~/.mutt{rc,/*}

I typed:

print -rl ~/.mutt{rc,/*}

Output:

sudo: print: command not found

sudo grep '^source' ~/.muttrc

Output:

grep: /home/myusername/.muttrc: No such file or directory

I created ~/.muttrc, but I don't know what to do with it.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Mar 23, 2017 1:02 am    Post subject: Reply with quote

roboto wrote:
I don't have any mutt file or directory in /home/myusername except for ~/.maildir and ~/.maildir-sent.

roboto ... yes, because the package only installs a system wide muttrc in /etc .. user config files are left to users devices.

roboto wrote:
khay... you typed: print -rl ~/.mutt{rc,/*}

'print' is a zsh builtin, bash doesn't have it. I provided the above so you could see how I configure mutt, and where the files are located ... not so that you might search for these same files.

roboto wrote:
I typed: print -rl ~/.mutt{rc,/*}
sudo: print: command not found
sudo grep '^source' ~/.muttrc
grep: /home/myusername/.muttrc: No such file or directory

Those errors should be fairly self-explanatory, but why on earth are you using 'sudo' for commands targeting '~/'? Bonus question, why do I get the following errors?

Code:
% sudo print -rl ~/.mutt{rc,/*}
zsh: command not found: sudo
% ls nonexistantfile
ls: cannot access 'nonexistantfile': No such file or directory

roboto wrote:
I created ~/.muttrc, but I don't know what to do with it.

I can't answer that without knowing how you plan to use mutt, perhaps this post (and other sections of the thread) will provide you some idea. Or you can search for mutt, using my username as 'author', and get further examples.

best ... khay
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Thu Mar 23, 2017 1:31 am    Post subject: Reply with quote

I did exactly what was mentioned in that thread and also added my e-mail address to it.

Mutt works well now and the "not a mailbox" message was gone, but another issue had arisen. I was sending myself an e-mail for testing reasons, but it did not appear in my inbox.

I tried to send one to someone, and he/she said that he/she did not get any e-mail.

I added imap smtp sasl to the USE flags for mutt.

Still same issue.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Mar 23, 2017 2:01 am    Post subject: Reply with quote

roboto wrote:
I did exactly what was mentioned in that thread and also added my e-mail address to it.

roboto ... well, you should be careful about following random stuff posted on the internet, particularly when the command 'sudo' is involved. That user created all those files as root (due to the use of sudo) and so files like ~/.mutt/certificates are owned by root and u+rw but go-rw ... you can fix all this with the following (substituting 'roboto' for your username):

Code:
$ sudo chown -c -R roboto:users ~/.mutt{,rc}

From now on, only use sudo when operating on files where root privilages are required ... and even then you should probably think about never using it at all (for reasons I could explain).

roboto wrote:
Mutt works well now and the "not a mailbox" message was gone, but another issue had arisen. I was sending myself an e-mail for testing reasons, but it did not appear in my inbox. I tried to send one to someone, and he/she said that he/she did not get any e-mail. I added imap smtp sasl to the USE flags for mutt. Still same issue.

OK, you would need to write to ~/.mutt/certificates to do sasl, because mutt will attempt to save the certificate there ... so, this issue may be due to that, or the syntax you've used in ~/.muttrc for your smtp server (some require 'username@domain.tld:password@mail.domain.tld', and some use 'username:password@mail.domain.tld). It sounds as though you're accessing imap so I suspect it is a tls issue, or some misconfiguration on your part, are you also using gmail? Can we see your configuration (anonymised)?

best ... khay
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Thu Mar 23, 2017 2:16 am    Post subject: Reply with quote

You asked for the configuration I used on ~/.muttrc:

set ssl_starttls="yes"
set ssl_force_tls="yes"
set imap_user="user_name@gmail.com"
set imap_pass="password"
set from="user_name@gmail.com"
set realname="Roboto"
set folder="imaps://imap.gmail.com/"
set spoolfile="imaps://imap.gmail.com/INBOX"
set postponed="imaps://imap.gmail.com/[Gmail]/Drafts"
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file="~/.mutt/certificates"
set smtp_url="smtps://user_name@gmail.com:password@smtp.gmail.com:465/"
set move="no"
set imap_keepalive="900"


I also created the files in ~/.mutt/cache

I did not use sudo for chmod.

I typed the command you suggested with chown and all the permissions were changed to my username, yet mutt's issue with e-mail unavailability still remains.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Mar 23, 2017 3:20 am    Post subject: Reply with quote

roboto ...

that looks ok, but just to be clear, 'user_name' does refer to your ID on gmail, and 'password' is your gmail password. Silly question I know, but I need to make sure the obvious possibilities are covered. Also, can you show me the useflags for mutt?

Code:
% emerge -pvq mail-client/mutt

... you would need 'ssl' enabled (along with smtp, imap, sasl).

When you send in mutt, is any error provided? If there is any issue with tls and passing on the mail then there should be an error.

best ... khay
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Thu Mar 23, 2017 3:24 am    Post subject: Reply with quote

# emerge -pvq mail-client/mutt
[ebuild R ] mail-client/mutt-1.5.24-r2 USE="berkdb crypt gdbm imap nls sasl smtp ssl -debug -doc (-gnutls) -gpg -idn -kerberos (-libressl) -mbox -nntp -pop -qdbm (-selinux) -sidebar -slang -smime -tokyocabinet"


USER_NAME is my ID for gmail. password is my gmail password.

And there is no error showing up whenever I send an e-mail and it still does not appear in any inbox.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Mar 23, 2017 5:21 am    Post subject: Reply with quote

roboto ...

again to clarify, when you start mutt you are connected to imap, and you see your gmail mailbox (with the mail you have there)? Can you try adding the following

~/.muttrc:
set hostname="gmail.com"

... note that mutt will need to be restarted after a config change. I wonder if perhaps this is related to gmail droping support of sslv3, you might also try adding the following:

~/.muttrc:
set ssl_use_sslv2=no
set ssl_use_sslv3=no
set ssl_use_tlsv1=yes

That wouldn't be the issue if imap is working, in fact you would get an error if tls fails, but it doesn't hurt to be explicit.

As you're not seeing an error, it's difficult for me to understand, or explain, what is happening.

best ... khay
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Thu Mar 23, 2017 2:03 pm    Post subject: Reply with quote

The code you suggested works!

When I launched mutt, there were certificate verifications and my inbox showed up. Also, my self e-mails showed up in my inbox.

Many, many thanks!
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Mar 23, 2017 10:54 pm    Post subject: Reply with quote

roboto wrote:
The code you suggested works!

roboto ... ok, good. It must have been an issue with ssl negotiation.

roboto wrote:
When I launched mutt, there were certificate verifications and my inbox showed up. Also, my self e-mails showed up in my inbox.

I see, so previously you weren't getting connected to imap.

roboto wrote:
Many, many thanks!

np ... you're welcome. BTW, here is an updated .muttrc, incorporating the above, with a few small changes, and an addition ('set record=+Sent'), this is so a copy of sent mail is saved on imap (if you want that, otherwise you should set 'set copy=no').

~/.muttrc:
set hostname="google.com"
set ssl_use_sslv2=no
set ssl_use_sslv3=no
set ssl_use_tlsv1=yes
set ssl_starttls="yes"
set ssl_force_tls="yes"
set imap_user="user_name@gmail.com"
set imap_pass="password"
set from="user_name@gmail.com"
set realname="Roboto"
set folder="imaps://imap.gmail.com/"
set spoolfile="+INBOX"
set postponed="+Drafts"
set record="+Sent"
mailboxes="+INBOX"
set header_cache="~/.mutt/cache/headers"
set message_cachedir="~/.mutt/cache/bodies"
set certificate_file="~/.mutt/certificates"
set smtp_url="smtps://user_name@gmail.com:password@smtp.gmail.com:465/"
set move="no"
set imap_keepalive="900"

If you're wondering what the '+' abreviation is, this states the folder is relative to 'folder='.

You might also add the following:

Code:
unset imap_passive
set mail_check="120" # time in seconds

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum