LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-03-2015, 12:57 PM   #1
Duglas
Member
 
Registered: Mar 2009
Distribution: Debian
Posts: 42

Rep: Reputation: 0
How to configure Mutt to access /var/mail/


My email system is configured as follows:
fetchmail
procmail
mutt
msmtp

My mail is stored in ~/Mail/, and in Maildir format.

I want to configure Mutt to read local mail in /var/mail/<username>, which is in mbox format.

Alternatively redirect local mail to procmail to sort into ~/Mail/<subdirs>.
 
Old 10-03-2015, 08:53 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,513
Blog Entries: 16

Rep: Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212
You will need turn off fetchmail, then delete your present mail store (or at least rename the directory to take it out of circulaton), then edit .muttrc, .fetchmailrc, and .procmailrc to reflect the new configuration. Then turn fetchmail back on and test.

Note that, if you are using the mbox format, the mail does not go into subdirectories of the Mail director in your home directory. It goes into files (called "spoolfiles") in the Mail in your home directory, except for any mail that you choose to leave in the default mail directory of /var/spool/mail/[username].

This web page will provide far better guidance than I can, as it describes setting up an mbox style mailbox. http://docs.huihoo.com/gentoo/resour...e-to-mutt.html It was a primary resource when I set up Mutt for the first time.

I'll give you some sample lines from my .muttrc indicating where you should look to make your edits:

Code:
set mbox_type=Maildir
set spoolfile=~/Maildir/
set folder=~/Maildir/
set record="$HOME/Maildir/sent/"
In addition, any mailboxes configured in .muttrc will need to be edited appropriately.

In .procmailrc, you will need to edit the mailbox type. Again, some sample lines:

Code:
MAILDIR=$HOME/Maildir/
You will also need to change any recipes in .procmailrc to reflect the new configuration so that they point to the spool files, rather than to mail directories, as well as create the spoolfiles for any mailboxes you want in addition to the main one in /var/spool/mail/[username].

I did a podcast for Hacker Public Radio about setting up Mutt. You may find some of the links in the shownotes helpful.

(Two years ago, before I decided to Mutt, I wouldn't have understood a word of this.)

Last edited by frankbell; 10-03-2015 at 09:04 PM.
 
Old 10-04-2015, 01:47 PM   #3
Duglas
Member
 
Registered: Mar 2009
Distribution: Debian
Posts: 42

Original Poster
Rep: Reputation: 0
Are you seriously suggesting that I rebuild my entire mail system to mbox, just to pick up /var/mail/<username>?

I had expected a suggestion on how to inject mail from /var/mail/ into the existing stream, so it would show up alongside mail from my ISP and Gmail etc.
Perhaps a bash script to read /var/mail/<username> and send the output to procmail, then delete /var/mail/<username>. However formating the mbox style mail file would be very difficult for me.

Another option is to just read /var/mail/<username> in vim, but I did want my local mail stored with my external mail.
 
Old 10-04-2015, 03:06 PM   #4
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian, Arch
Posts: 1,163
Blog Entries: 7

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Say what?

No need to delete your current mail store.
If I understand you correctly, you want the local mail to be treated the same as your foreign mail is treated... retrieve, process, put all in the same place. If this is what you want, check out https://wiki.debian.org/MaildirConfiguration

Do you just want to set up mutt easily to read the local mail from /var/spool/...? It will require a separate rc file, and you'll have to quit mutt to change between local and the delivered mail.

You can have either way, but not at the same time.
 
Old 10-04-2015, 08:41 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,513
Blog Entries: 16

Rep: Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212Reputation: 3212
Quote:
Are you seriously suggesting that I rebuild my entire mail system to mbox, just to pick up /var/mail/<username>?
If you want to switch your mailbox format, you must make the requisite changes. If you want to use /var/spool/mail, you use a spool file. That's how it works.

mbox and maildir are completely different formats. You can use one or the other with a single instance of Mutt, but you can't use both and you can't use a hybrid.

I've used both. I've switched from mbox to maildir and I've switched from maildir to mbox in the course of learning Mutt. Whichever format you choose, you must speak to it in a language it can understand.

Last edited by frankbell; 10-04-2015 at 08:57 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
configure mail server to allow users access company mail from any place with internet chicoahmad Linux - Newbie 3 09-25-2011 11:26 PM
how to configure mutt mail client for mail server other that gmail golden_boy615 Linux - General 16 02-28-2011 08:48 AM
Configure /var/www/html for user write access? SlowCoder Linux - Server 9 07-26-2009 05:37 PM
do I need to configure postfix to use mutt for my isp's pop3 e-mail? dkaplowitz Linux - Networking 1 10-15-2003 02:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration