El dimecres, 30 de juliol del 2008 a les 14:21, Kyle Wheeler va escriure:

> On Wednesday, July 30 at 08:55 PM, quoth [EMAIL PROTECTED]:
> >This code in muttrc successfully loads the imap account definition (I 
> >have tryed with both accounts):
> >
> ># Default mailbox
> >source ~/.mutt/Comptes/joanet
> >
> >If I issue the command c (change-folder) ?, I get the desired list of 
> >the imap folders of the defined account.
> >
> >I was expecting I could source the other imap account definition, and 
> >mutt would be in the other account. If I enter mutt with one account 
> >and I source the other account:
> >:source ~/.mutt/Comptes/uab
> >
> >when issuing command c (change-folder) ?, mutt is waiting to get the 
> >list of folders or shows the folders of the account it was first 
> >sourced. It seems that sourcing the other account does not change the 
> >default imap folder.
> 
> More accurately, "sourcing the other account" does not affect/change 
> the CURRENT imap connection. Issuing <change-folder> is done (by 
> default) within the current connection.
> 
> Or, put another way, simply changing the value of $folder DOES NOT 
> cause mutt to open a new connection. NOR does issuing <change-folder>.

Thanks very much for the explanation. It clarifies very much the issue
for me. The key question is then, changing the imap connection.  

> >Is there another option I should set to be able to change imap 
> >accounts when inside mutt?
> 
> In order to finish the change, you have to tell mutt to change the 
> current connection. For example, you could add the following to the 
> end of the account file you're sourcing:
> 
>      push <change-folder>=<enter>
> 
> That would tell mutt to actually connect to the other server (or, if 
> already connected, to make that connection the current connection).

Somehow, I am unable to change the current imap connection. I have tried the 
push command at the end of my 'source' file without success.

I had previosly adapted what was suggested in the mutt wiki 
(http://wiki.mutt.org/?MuttGuide/UseIMAPadapted):

account-hook . 'unset preconnect imap_user imap_pass imap_authenticators'
account-hook    imap://localhost        'source ~/.mutt/Comptes/joanet_account' 
account-hook    imap://[EMAIL PROTECTED] 'source ~/.mutt/Comptes/uab_account'
folder-hook imap://localhost            'source ~/.mutt/Comptes/joanet_folder'
folder-hook imap://[EMAIL PROTECTED]    'source ~/.mutt/Comptes/uab_folder'

In ~/.mutt/Comptes/uab_account I have:
set spoolfile=imap://[EMAIL PROTECTED]
set imap_user=user
set imap_pass=password
set imap_authenticators=login

In ~/.mutt/Comptes/uab_folder I have:
set folder=imap://[EMAIL PROTECTED]:143

When I change folder with 'c' (change folder) '?' (list of folders) '<tab>' 
(list of accounts) and selecte the imap://[EMAIL PROTECTED], mutt shows it is 
connecting to this imap acount and shows it in the status bar (it shows the 
folder imap://[EMAIL PROTECTED]).

If I issue the command: :set ?folder, I get:
folder="imap://localhost/"

Neither repeating manually the <change-folder> nor setting the variable with 
:set folder=imap://[EMAIL PROTECTED] allows to see the list of folders of the 
new imap connection (I am unable to change my current imap connection).

After your explanation, it is clear to me that I was unable to change
the imap connection. Is there any other form of changing between two imap 
connection when
inside of mutt?

After playing for a while, I believe I will stay with what Cristobal and Dale 
have suggested in this thread:

1.- To create a muttrc definition for each account that sources the
rest of the general muttrc.
2.- To start mutt with mutt -F 'muttrc account definition'

After trying, I believe this may be the easiest approach while, at the same
time, offering a common configuration for all the accounts. 

Thanks everybody for your help!!

-- 
Location: 41:24:51N (41.41417) 2:11:25E (2.1903)
Linux User: #463211

Reply via email to