[Home]MuttGuide/Basics

MuttWiki | MuttGuide | RecentChanges | Preferences

What you need set up before Mutt.

I use fetchmail (http://catb.org/~esr/fetchmail/) to retrieve my POP3 email. I have it running periodically, and I also have a program that simply reads my mbox file (e.g. /var/spool/mail/someuser) and notifies me when I have new mail. When I start up my mail reader, the mail is automatically retrieved from the mbox and filed away somewhere under my home directory. I am very happy with this setup, and it makes monitoring new email very easy and compatible.

- Sean

--

Really, I don't know. :-) I read somewhere that Mutt can't fetch pop mail. Apearantly you need to install some pop client first, which will drop your mail into a mailbox, from which Mutt will read.

I know that's not what you're looking for, but I'm a Mutt noob, and I didn't know that till a few days ago.

Feel free to delete this if you know something substantial. :-)

M.M.

Mutt can fetch POP3/APOP mail if configured with --enable-pop, POP3S with --with-ssl (run mutt -v to see +USE_POP and +USE_SSL).
So you need only MTA or LightWeightSmtpClients before beginning to use Mutt (without libesmtp patch).
Well, and editor (though mutt has its own builtin editor). --Tamo


Come on, dudes, you can do better than this, particulary more. ;-)
Just remember how you started out and proceeded. I can't, because I'm a too "old fart" to remember anymore. --RadoS


Getting Mail

I just started using mutt. The first thing I wanted to do was read mail that I get from ISP. They have a pop mailbox set up for me. The easiest way to get started reading mail is to:

  1. Make sure mutt is compiled with support for the pop protocol. (See previous post)
  2. Type mutt at the command prompt.
  3. You should now be in mutt (probably without any messages). Type 'c' (for change mailbox), followed by:
pop://userid@pop.yourisp.com (where userid = your user name, and the pop.yourisp.com is the pop address given to you by your isp or whomever).
Note: You should use pops if it is supported by your isp - mine does not support it :(

At this point, you should have the mail that is sitting on your isp's pop server sitting on your screen :) I've read that this is not the preferred way to get mail, but I found it to be the easiest. For more advanced usage, you should consider using fetchmail. NOTE: Once your mail is shown, you can simply press <enter> to see the message. Type '?' for more commands that are right at your fingertips.

Sending Mail

Now, the next thing you need to do is send mail. I found sendmail/procmail/you name it to be over my head. Instead, I think esmtp (found at esmtp.sourceforge.net) is MUCH easier. It doesn't have all the bells and whistles as the bigger programs, but it's not supposed to - it's just there to help you send your mail. If you use esmtp, install it based on the directions given in the website. Then, in your ~/.muttrc, you can change/create the following lines:

set from="youremail@yourisp.com"
set sendmail="/usr/local/bin/esmtp -v -X /tmp/esmtp.log"
set envelope_from=yes

You'll also have to change your ~/.fetchmailrc. Simply add the following two lines:

defaults
mda "/usr/local/bin/esmtp -f %F -%T"
This lets fetchmail (assuming that's what you use to get your mail - i.e., as opposed to my earlier suggestion of using the pop://address of your server. It gets the mail to stay on your system, and is fairly easy to use once you try it. Read the man page for more information) get your mail for you.

Next, follow the directions on the esmtp website to create your ~/.esmtprc. It's pretty easy:

hostname = smtp.yourisp.com:25 (where again, this will be unique to your mail provider)
username = "yourusername"
password = "yourpassword"
Once you have this set up, you should now be able to send and receive mail :) To run fetchmail, I simply use:

fetchmail --protocol POP3 --username myusername pop.myisp.com [--keep]

Use the --keep if you don't want fetchmail to delete the mail from your isp...this way, you can still get webmail when you're away from home.

It then requests my password from me, and fetches my mail to /var/spool/mail/myusername, which is the default folder that mutt opens to on my system (and probably yours unless you changed something around).

So far, this is about what I've figured out on my system. Even though I had a little trouble getting up to speed, I think the above covers what I found to be most difficult. Don't let the fetchmail or sendmail/procmail/whatever programs get you down. Hopefully I'll figure them out...but that's for some other time :) Good Luck!

Kevin T. Ryan kevryan0701_AT_yah00.com

Notes on fetchmail

Although this is not directly mutt related, some people might wonder what's an easy way to set up fetchmail without doing anything by hand. Feel free to delete it if I'm too far off-topic.

First you can edit .fetchmailrc (there is a program called fetchmailconf that can do this for you) To make it download your pop mail automatically when you call it the only thing you need to do is add a line like: poll "yourpopserver" proto POP3 user "yourusername" pass "yourpass"

Of course you can use other protocols as well. Fetchmail will then download the mail and feed it to your MDA for local delivery. Now I would like to start up sendmail when I log into X (I normally don't work from console). So what you do is add a line like this to your .xsession file: fetchmail -s -t 20 -d60 --invisible 2>>~/.fetchmailerr

This might look a bit daunting at first but by perusing the man files you can easily find out what it does. In short, the '-s' switch causes fetchmail to run in silent mode, while '-t' sets the timeout for the servers fetchmail will be polling (I like to set this lower since usually it's hit or miss with my ISP's servers).

The '-d' switch puts fetchmail in daemon mode, so it runs in the background and the value accompanied with it is the interval in seconds for polling (in my case every minute). You might want to set this value slightly higher since I don't think most isp's would appreciate getting clobbered by their clients like this. If you want to check your mail in between runs, just run fetchmail and it will wake up the daemon process which is running in the background and have it deliver mail.

The --invisible option is not really necessary but I don't really want fetchmail adding headers to my mails and the last part is simple redirection of all errors to a file in my homedir named .fetchmailerr.

With all this put together fetchmail should start delivering mail to you which your mda will normally drop in a folder like /var/mail/"yourusername" which is the default for mutt. For easy mail handling I would advocate exim which is the default in debian, easy to config (there is even a special script to help you do this) and lots of features that are well documented if you want to get further into it.

- Wim (wdesmet_AT_yucom.dot.be)


MuttWiki | MuttGuide | RecentChanges | Preferences
Edit text of this page | View other revisions
Last edited September 19, 2004 2:20 pm by 83-134-76-145.Gent.GoPlus.FastDSL.tiscali.be (diff)
Search: