account-hook

80 views
Skip to first unread message

Marco Herrn

unread,
Jan 13, 2005, 1:07:45 PM1/13/05
to
Hi,

I want to use IMAP with mutt. But I do not want to enter my password
each time. So I defined an account-hook as mentioned in the manual.

account-hook imap://sout.de/ 'set imap_user=us...@server.de imap_pass=geheim'

But I always have to enter my password. Even if I split the above in
two account-hooks. Am I doing something wrong? BTW: I am using mutt
1.5.6.

Regards
Marco
--
Marco Herrn he...@gmx.net
(GnuPG/PGP-signed and crypted mail preferred)
Key ID: 0x94620736

Alan Connor

unread,
Jan 13, 2005, 2:25:18 PM1/13/05
to

Use fetchmail to retrieve your mail.

Not Mutt's internal fetch mail.


AC

Marco Herrn

unread,
Jan 13, 2005, 4:52:44 PM1/13/05
to
On 2005-01-13, Alan Connor <zzz...@xxx.yyy> wrote:
> Use fetchmail to retrieve your mail.
>
> Not Mutt's internal fetch mail.

Well, I do *not* want to fetch my mail, but rather store it on the
server side and connect via IMAP.

Brendan Cully

unread,
Jan 13, 2005, 10:46:39 PM1/13/05
to
Alan Connor <zzz...@xxx.yyy> writes:

> On 13 Jan 2005 18:07:45 GMT, Marco Herrn <he...@gmx.net> wrote:
>
> > Hi,
> >
> > I want to use IMAP with mutt. But I do not want to enter my
> > password each time. So I defined an account-hook as mentioned
> > in the manual.
> >
> > account-hook imap://sout.de/ 'set imap_user=us...@server.de
> > imap_pass=geheim'
> >
> > But I always have to enter my password. Even if I split the
> > above in two account-hooks. Am I doing something wrong? BTW: I
> > am using mutt 1.5.6.

It doesn't look like it. I use a similar set-up myself. The hook has
to match the folder you're entering fairly exactly though. Try

cimap://sout.de/<enter>

in mutt, if you're using something else. Also, you might want to clear
out any other hooks that could be overriding that one, just for
testing. Finally, it may be obvious, but account-hooks are designed
for users that have multiple accounts. If you only have one, just set
the variables directly.

You can also test by putting other nonsense into the hook just to see
if it causes an error when you connect. If not, the hook must not be
firing. If so, some other hook is likely overriding your settings
afterwards.

>
> Use fetchmail to retrieve your mail.
>
> Not Mutt's internal fetch mail.

This bad advice gets posted frequently. IMAP is designed for interactive
use by MUAs. Using fetchmail for IMAP is more broken than using mutt
for POP.

Alan Connor

unread,
Jan 14, 2005, 12:48:41 AM1/14/05
to

Thanks for setting me and the record straight, Brendan

My apologies. Never used IMAP and didn't realize it was that
different from POP.

But Marco is still fetching his mail, isn't he? What else?


AC


Jochen Schulz

unread,
Jan 14, 2005, 8:43:42 AM1/14/05
to
* Marco Herrn:

>
> I want to use IMAP with mutt. But I do not want to enter my password
> each time. So I defined an account-hook as mentioned in the manual.
>
> account-hook imap://sout.de/ 'set imap_user=us...@server.de imap_pass=geheim'

'set imap_pass=geheim' should do it. But make sure the permissions of
this configuration file are restrictive enough.

J.
--
I use a Playstation to block out the existence of my partner.
[Agree] [Disagree]
<http://www.slowlydownward.com/NODATA/data_enter2.html>

Brendan Cully

unread,
Jan 14, 2005, 8:03:48 PM1/14/05
to
Alan Connor <zzz...@xxx.yyy> writes:

Think of IMAP as the network version of maildir. You can set flags,
selectively read mail, move it between folders, etc. The protocol
also supports things like server-side threading, sorting and
searching, but mutt hasn't picked up on that yet.

The big advantage is you can manipulate your mail from lots of
different places.

Alan Connor

unread,
Jan 15, 2005, 1:29:29 AM1/15/05
to
On Sat, 15 Jan 2005 01:03:48 GMT, Brendan Cully
<bre...@kublai.com> wrote:

> Alan Connor <zzz...@xxx.yyy> writes:
>
>> On Fri, 14 Jan 2005 03:46:39 GMT, Brendan Cully
>> <bre...@kublai.com> wrote: Thanks for setting me and the
>> record straight, Brendan
>>
>> My apologies. Never used IMAP and didn't realize it was that
>> different from POP.
>>
>> But Marco is still fetching his mail, isn't he? What else?
>
> Think of IMAP as the network version of maildir. You can set
> flags, selectively read mail, move it between folders, etc. The
> protocol also supports things like server-side threading,
> sorting and searching, but mutt hasn't picked up on that yet.
>
> The big advantage is you can manipulate your mail from lots of
> different places.

Okay. That's pretty clear. I think it is time for me to sit down
with the relevant RFCs and really learn about IMAP.

Just out of curiosity, I took a look at my local apt-get/dpkg
list. These are some of the imap-clients offered as packages
by Debian:

spruce, mozilla-mailnews, imp, althea, postilion, im, wl

Mutt's there, but not listed as an imap-client.

Thanks again, Brendan.


AC

Larry Alkoff

unread,
Jan 17, 2005, 1:04:51 AM1/17/05
to
On Sat, 15 Jan 2005 01:03:48 GMT, Brendan Cully <bre...@kublai.com>
wrote:


>Think of IMAP as the network version of maildir. You can set flags,
>selectively read mail, move it between folders, etc. The protocol
>also supports things like server-side threading, sorting and
>searching, but mutt hasn't picked up on that yet.
>
>The big advantage is you can manipulate your mail from lots of
>different places.

PMFJI Brendan but I have gotten very interested in IMAP
since I realized that maildir does not work with my system
of nested mail folders on PMMail a Windows client.

I would really prefer to use Mutt with nested mail directories.

Is it possible to set up an IMAP server on my Slackware 10
system and "serve myself"? Any programs you would recommend?

Larry Alkoff

Paul Walker

unread,
Jan 16, 2005, 7:05:55 PM1/16/05
to
On Sat, 15 Jan 2005 06:29:29 GMT, Alan Connor wrote:

> spruce, mozilla-mailnews, imp, althea, postilion, im, wl
> Mutt's there, but not listed as an imap-client.

mutt will work with IMAP, but despite Brendan's excellent work on it still
works much better with local files. At least IMO. :)

--
Paul

Paul Walker

unread,
Jan 18, 2005, 7:25:59 PM1/18/05
to
On Mon, 17 Jan 2005 06:04:51 GMT, Larry Alkoff wrote:

> Is it possible to set up an IMAP server on my Slackware 10
> system and "serve myself"? Any programs you would recommend?

Should be perfectly possible; I use the uwimapd (University of Washington
IMAP daemon) on my Debian box. Works fine.

--
Paul

Don't underestimate the ability of politicians to find alibis.
-- Michael Heseltine MP

Jochen Schulz

unread,
Jan 19, 2005, 3:26:57 AM1/19/05
to
* Larry Alkoff:

>
> Is it possible to set up an IMAP server on my Slackware 10
> system and "serve myself"? Any programs you would recommend?

I'd recommend dovecot. It is very small, easy to configure and it can
serve mails from Maildir and mboxes (AFAIK you have to choose a
system-wide default). You can authenticate via normal system accounts,
LDAP, MySQL or PostgreSQL. If you wanted, you could also use it as a
POP3 server. See http://dovecot.org for details.

J.
--
I want to keep my skin looking good but I believe all computers do the
same job.
[Agree] [Disagree]
<http://www.slowlydownward.com/NODATA/data_enter2.html>

Marco Herrn

unread,
Jan 20, 2005, 1:58:28 AM1/20/05
to

Hi,

On 2005-01-14, Brendan Cully <bre...@kublai.com> wrote:
> Alan Connor <zzz...@xxx.yyy> writes:
>
>> On 13 Jan 2005 18:07:45 GMT, Marco Herrn <he...@gmx.net> wrote:
>>
>> > account-hook imap://sout.de/ 'set imap_user=us...@server.de
>> > imap_pass=geheim'
>> >
>> > But I always have to enter my password. Even if I split the
>> > above in two account-hooks. Am I doing something wrong? BTW: I
>> > am using mutt 1.5.6.
>
> It doesn't look like it. I use a similar set-up myself. The hook has
> to match the folder you're entering fairly exactly though. Try
>
> cimap://sout.de/<enter>

I enter it exactly as I defined it in the config file.

> in mutt, if you're using something else. Also, you might want to clear
> out any other hooks that could be overriding that one, just for
> testing.

I tested it, the hook is firing. The variable imap_user is also
correctly set, I do not have to enter it again. But I still have to
enter the imap_pass. I also changed the account-hook to:

account-hook imap://sout.de/ 'set imap_user=us...@server.de; set imap_pass=geheim'

but that doesn't help. But mutt also doesn't complain about it. If i
enter nonsene in the account-hook mutt complains about it.

> Finally, it may be obvious, but account-hooks are designed
> for users that have multiple accounts. If you only have one, just set
> the variables directly.

Yes that is the case. I have several accounts I want to use. But for
testing now I want to start with only once. The only problem I see is
that my multiple accounts all reside on the same server and
differentiate only in the user credentials. That would lead to the
problem that I can't use account-hooks correctly, I think. Any ideas
if this is still possible?

Brendan Cully

unread,
Jan 21, 2005, 10:32:52 PM1/21/05
to
Marco Herrn <he...@gmx.net> writes:

> Yes that is the case. I have several accounts I want to use. But for
> testing now I want to start with only once. The only problem I see is
> that my multiple accounts all reside on the same server and
> differentiate only in the user credentials. That would lead to the
> problem that I can't use account-hooks correctly, I think. Any ideas
> if this is still possible?

Instead of setting imap_user in your account hook, you might try
something like:

account-hook 'imap://imap_user@host/' 'set imap_pass=foo'

and then using that same format when you change folders.

Marco Herrn

unread,
Jan 22, 2005, 8:52:32 AM1/22/05
to

I have tried with it with this, but the imap_pass is still ignored and
I have to enter it again.

BTW: Is there a way to define something like aliases for accounts? So
that I can enter a shorter name insstead of imap://imap...@host.tld
to connect to imap mailboxes?

Marco Herrn

unread,
Jan 22, 2005, 8:57:02 AM1/22/05
to
On 2005-01-22, Marco Herrn <he...@gmx.net> wrote:
> I have tried with it with this, but the imap_pass is still ignored and
> I have to enter it again.

I found out what the error was. The password I use seems to use
unusual characters. After enclosing the password with double quotes,
it works.

> BTW: Is there a way to define something like aliases for accounts? So
> that I can enter a shorter name insstead of imap://imap...@host.tld
> to connect to imap mailboxes?

This is still what I would like to use. A shorter name for accessing
such mailboxes. Is there a way to do it? I didn't find anything in the
mutt manual.

Brendan Cully

unread,
Jan 22, 2005, 12:38:42 PM1/22/05
to
Marco Herrn <he...@gmx.net> writes:

> > BTW: Is there a way to define something like aliases for accounts? So
> > that I can enter a shorter name insstead of imap://imap...@host.tld
> > to connect to imap mailboxes?
>
> This is still what I would like to use. A shorter name for accessing
> such mailboxes. Is there a way to do it? I didn't find anything in the
> mutt manual.

Macros are the usual solution.

R Wood

unread,
Feb 5, 2005, 10:17:31 AM2/5/05
to

Just to follow up more specifically, this is what I use in my .muttrc to do
what you seem to be interested in doing:

macro index <f2> "c imap://user...@your.first.imap.server\n"
macro index <f3> "c imap://user...@your.other.imap.server\n"

to bind the two accounts to f2 and f3 keys respectively. Repeat those two
lines using "macro pager" instead of "macro index" to make the keystrokes
available to you from within the message pager as well, if you need.

RW
--
Randall S. Wood
http://www.therandymon.com

Reply all
Reply to author
Forward
0 new messages