Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jan 2008 05:07:26 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Gary Kline <kline@magnesium.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Using mutt to access imap folders (was: mail questions: mutt and KDE)
Message-ID:  <20080124030725.GA10855@kobe.laptop>
In-Reply-To: <20080124022441.GA29323@thought.org>
References:  <20080124022441.GA29323@thought.org>

next in thread | previous in thread | raw e-mail | index | archive | help
freebsd-kde stripped from the recipient list.

Gary it's probably better to post *two* messages if you have two
unrelated questions.  This way the traffic in freebsd-kde will not get
'polluted' with all the replies about mutt, which isn't really related
to KDE on FreeBSD.

On 2008-01-23 18:24, Gary Kline <kline@magnesium.net> wrote:
> Here's hopping that I'm still subscribed to the kde list, and that
> somebody can answer these general mail-type questions.

You don't have to be subscribed to freebsd-kde to post.

> Also, I would like some clues of how to if IF I can use mutt *with*
> IMAP.

You can set ${MAIL} in your environment to an imap folder.  Then firing
up mutt will select the imap folder by default, and you will be prompted
for a password.

Try for example the following:

	$ MAIL='imap://username@imapserver/INBOX'

You can store the IMAP username and password in ~/.muttrc too, but then
you should pay careful attention to the permissions of the file (even in
an internal network, it never hurts to be a bit cautious).  The
following in your ~/.muttrc should do the trick:

	set imap_user='gkeramidas'
	set imap_pass='achmed!the!terrorist'

Then fire up mutt, and enjoy your new IMAP session.

One word of caution though.  Setting $MAIL to an IMAP folder path in
your default environment may upset programs which don't really speak
IMAP the way mutt does, i.e. the command-line mail(1) utility.

The manual of mutt, which is accessible by hitting <F1> while inside
mutt, is also a valuable resource for this sort of questions.
Specifically, the following section includes a very good example of how
you can handle multiple IMAP accounts in a single mutt session:

| 13. Managing multiple IMAP/POP accounts (OPTIONAL)
|
| If you happen to have accounts on multiple IMAP and/or POP
| servers, you may find managing all the authentication settings
| inconvenient and error-prone. The account-hook command may
| help. This hook works like folder-hook but is invoked whenever
| you access a remote mailbox (including inside the folder
| browser), not just when you open the mailbox.
|
| Some examples:
|
|     account-hook . 'unset imap_user; unset imap_pass; unset tunnel'
|     account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo'
|     account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'

There are *many* other details in the manual about using mutt to access
IMAP folders.  You should definitely skim through the text at least
once in case you find some interesting option.

A text version of the full manual is available in /usr/local too:

    /usr/local/share/doc/mutt/manual.txt

This is, actually, the file that you get to read when you hit <F1>
inside mutt.

- Giorgos




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080124030725.GA10855>