knowledge-database (beta)

Current group: comp.mail.mutt

multiple IMAP accounts - folders

multiple IMAP accounts - folders  
R Wood
 Re: multiple IMAP accounts - folders  
Brendan Cully
 Re: multiple IMAP accounts - folders  
Brendan Cully
 Re: multiple IMAP accounts - folders  
R Wood
 Re: multiple IMAP accounts - folders  
Alain Bench
 Re: multiple IMAP accounts - folders  
R Wood
From:R Wood
Subject:multiple IMAP accounts - folders
Date:Sun, 19 Dec 2004 20:48:03 -0000
Greetings:

I've been using mutt for years now, gradually getting the hang of new
commands as I've needed them. But I just entered the beautiful world of
IMAP and for the first time, I'm stumped. I've gotten close to the goal
with the mutt manual and Google groups, plus a couple of helpful "Mutt with
IMAP" webpages, but I'm not quite there yet.

Using the following setup I have trouble with the "set folder" command. No
matter which account I log into first, when I hit 'c' and then '?' to get a
list of available mailboxes, mutt always presents me with the folders of
jhem.jhu.edu.

Is the problem that you can't associate the "set folder=" command with an
account-hook? Is there any other way around this? I can select folders
manually by typing, e.g. "c=imap://pop3.toast.net/Sent" . Thanks, RW


mailboxes imap://pop3.toast.net imap://jhem.jhu.edu

account-hook imap://pop3.toast.net 'set imap_user="username";set
imap_pass="password" '
account-hook imap://pop3.toast.net 'set spoolfile=imap://pop3.toast.net/INBOX'
account-hook imap://pop3.toast.net 'set record="=Sent" '
account-hook imap://pop3.toast.net 'set folder="imap://pop3.toast.net/" '
account-hook imap://pop3.toast.net 'my_hdr From: Randall Wood
'

account-hook imap://jhem.jhu.edu 'set imap_user="username"; set
imap_pass="password" '
account-hook imap://jhem.jhu.edu 'set folder="imap://jhem.jhu.edu/" '
account-hook imap://jhem.jhu.edu 'set spoolfile="imap://jhem.jhu.edu/INBOX" '
account-hook imap://jhem.jhu.edu 'set record="=Sent" '
account-hook imap://jhem.jhu.edu 'my_hdr From: Randall Wood
'



--
Randall S. Wood
http://www.therandymon.com
From:Brendan Cully
Subject:Re: multiple IMAP accounts - folders
Date:Sun, 19 Dec 2004 21:00:13 GMT
R Wood writes:

> Using the following setup I have trouble with the "set folder" command. No
> matter which account I log into first, when I hit 'c' and then '?' to get a
> list of available mailboxes, mutt always presents me with the folders of
> jhem.jhu.edu.
>
> Is the problem that you can't associate the "set folder=" command with an
> account-hook? Is there any other way around this? I can select folders
> manually by typing, e.g. "c=imap://pop3.toast.net/Sent" . Thanks, RW

You can. You may be getting into trouble because account-hook is only
called when a connection is established (that is, no more than
once). You probably want a combination of folder-hooks and
account-hooks. folder-hook is called whenever you change folders, so
it's a good place to set things like $from and $record.

By the way, you need to be careful about the order of your hooks. If
you set record="=Sent" _before_ you set $folder, you're probably not
getting the results you want.

I'd probably rewrite your hooks something like this:

mailboxes imap://pop3.toast.net imap://jhem.jhu.edu

account-hook imap://pop3.toast.net 'set imap_user="username" \
imap_pass="password"'

folder-hook imap://pop3.toast.net 'set spoolfile=imap://pop3.toast.net/INBOX \
folder="imap://pop3.toast.net/" \
set record="=Sent" \
from="Randall Wood "'

And similarly for your other accounts.
From:Brendan Cully
Subject:Re: multiple IMAP accounts - folders
Date:Tue, 21 Dec 2004 01:11:59 GMT
R Wood writes:

> Brendan Cully wrote:
> > I'd probably rewrite your hooks something like this:
> >
> > mailboxes imap://pop3.toast.net imap://jhem.jhu.edu
> >
> > account-hook imap://pop3.toast.net 'set imap_user="username" \
> > imap_pass="password"'
> >
> > folder-hook imap://pop3.toast.net 'set
> > spoolfile=imap://pop3.toast.net/INBOX \
> > folder="imap://pop3.toast.net/" \
> > set record="=Sent" \
> > from="Randall Wood "'
> >
> > And similarly for your other accounts.
>
> Thanks, Brendan. I've reorganized those headers. I'm still not able to set
> which account's folder tree to use, but I've worked around it by
> duplicating my .muttrc as .muttrc-TOAST and .muttrc-JHU and simply evoking
> mutt using the -F flag. It's not the most elegant solution, but it gets me
> where I want to go, and allows me to set a different my_hdr From: for each
> account.

All I can say is, I use this technique myself. It does work, there's
probably just a bug or something else in your muttrc that's
interfering. Or I don't understand exactly what you're trying to do,
I guess.
From:R Wood
Subject:Re: multiple IMAP accounts - folders
Date:Mon, 20 Dec 2004 13:52:24 -0500
Brendan Cully wrote:

> R Wood writes:
>
>> Using the following setup I have trouble with the "set folder" command.
>> No matter which account I log into first, when I hit 'c' and then '?' to
>> get a list of available mailboxes, mutt always presents me with the
>> folders of jhem.jhu.edu.
>>
>> Is the problem that you can't associate the "set folder=" command with an
>> account-hook? Is there any other way around this? I can select folders
>> manually by typing, e.g. "c=imap://pop3.toast.net/Sent" . Thanks, RW
>
> You can. You may be getting into trouble because account-hook is only
> called when a connection is established (that is, no more than
> once). You probably want a combination of folder-hooks and
> account-hooks. folder-hook is called whenever you change folders, so
> it's a good place to set things like $from and $record.
>
> By the way, you need to be careful about the order of your hooks. If
> you set record="=Sent" _before_ you set $folder, you're probably not
> getting the results you want.
>
> I'd probably rewrite your hooks something like this:
>
> mailboxes imap://pop3.toast.net imap://jhem.jhu.edu
>
> account-hook imap://pop3.toast.net 'set imap_user="username" \
> imap_pass="password"'
>
> folder-hook imap://pop3.toast.net 'set
> spoolfile=imap://pop3.toast.net/INBOX \
> folder="imap://pop3.toast.net/" \
> set record="=Sent" \
> from="Randall Wood "'
>
> And similarly for your other accounts.


Thanks, Brendan. I've reorganized those headers. I'm still not able to set
which account's folder tree to use, but I've worked around it by
duplicating my .muttrc as .muttrc-TOAST and .muttrc-JHU and simply evoking
mutt using the -F flag. It's not the most elegant solution, but it gets me
where I want to go, and allows me to set a different my_hdr From: for each
account.

If anyone else has experienced this conundrum, I'd appreciate the input.
And thanks again Brendan.

RW
From:Alain Bench
Subject:Re: multiple IMAP accounts - folders
Date:Tue, 21 Dec 2004 12:05:55 +0100 (CET)
Hello Randall,

On Monday, December 20, 2004 at 1:52:24 PM -0500, Randall S. Wood wrote:

> to set a different my_hdr From: for each account.

BTW you can and should drop "my_hdr From:" and use the normal $from
and $realname with $use_from: It's better. Use "my_hdr From:"
exclusively in send-hooks.


Bye! Alain.
--
When you want to reply to a mailing list, please avoid doing so from a
digest. This often builds incorrect references and breaks threads.
From:R Wood
Subject:Re: multiple IMAP accounts - folders
Date:Sat, 01 Jan 2005 20:18:40 -0500


Alain Bench wrote:

> Hello Randall,
>
> On Monday, December 20, 2004 at 1:52:24 PM -0500, Randall S. Wood wrote:
>
>> to set a different my_hdr From: for each account.
>
> BTW you can and should drop "my_hdr From:" and use the normal $from
> and $realname with $use_from: It's better. Use "my_hdr From:"
> exclusively in send-hooks.
>
>
> Bye! Alain.


Thanks for the tip Alain. So that would be:

set realname="Randall Wood"
set use_from

And thanks as well to Brendan. You were right - I had a conflict later down
in my crufty old .muttrc and things are working great. Just to gush for a
second, I'm quite the email junkie and I've probably tried every MUA out
there at one time or another, but I keep coming back to mutt. RW
   

Copyright © 2006 knowledge-database   -   All rights reserved