Multiple IMAP accounts - folder-hooks - account-hooks

Multiple IMAP accounts - folder-hooks - account-hooks

Post by John J. Fo » Thu, 20 Jan 2005 01:42:10


Good afternoon all,
I've been working for a few days to combine 2 muttrc files
into 1 so I don't have to exit mutt and restart with a different
-F option in order to read a different IMAP server. The account
and folder hooks work so far thanks to the archives of this group
and google, except one minor problem. When I hit "c" to change
folders, I get a listing of

INBOX.
INBOX

Entering INBOX. shows me a directory listing of my IMAP-2 system.
Entering INBOX takes me to the INBOX of my IMAP-2 system. What I
want is to be able to see a directory listing of whichever IMAP
server I last entered from the Mailboxes screen.

Is this possible?

Thanks,
John

##### Where is my mail
set spoolfile="imaps://IMAP-2/INBOX"
set folder="imaps://IMAP-2/"
set mbox="INBOX.Read"

set certificate_file=~/.certificates

##### Which mailboxes should be watched for new mail
mailboxes \
imaps://IMAP-1/INBOX \
imaps://IMAP-2/INBOX

##### Set account options
account-hook . 'unset imap_user; unset imap_pass; unset tunnel; unset folder;'

account-hook imaps://IMAP-1/ \
'set imap_force_ssl=yes; \
set imap_user=username; \
set imap_pass=userpass'

account-hook imaps://IMAP-2/ \
'set imap_force_ssl=yes; \
set imap_user=username; \
set imap_pass=userpass'

##### Set folder options
set folder_format="%2C %t %2N %7d %f"

folder-hook imaps://IMAP-1/ \
'set spoolfile=imaps://IMAP-1/INBOX; \
set folder="imaps://IMAP-1/"; \
set record="=Sent Items"; \
set from="John J. Foster <email@IMAP-1>"'

folder-hook imaps://IMAP-2/ \
'set spoolfile=imaps://IMAP-2/INBOX; \
set folder="imaps://IMAP-2/"; \
set record="=Sent Items"; \
set from="John J. Foster <email@IMAP-2>"'


--
It is not unusual for those at the wrong end of the club to have a
clearer picture of reality than those who wield it.
Noam Chomsky
 
 
 

1. hooks and regexp (was: SOLVED: folder-hooks on Courier IMAP e: folder-hooks don't work)

2. SOLVED: folder-hooks on Courier IMAP e: folder-hooks don't work


The reason why this doesn't work is that all my folders are stored on
local Courier IMAP server, where all folders are subfolders of >.
Therefore, when > expands to imap://localhost/INBOX it matches not only
INBOX, but ALL folders (for example
imap://localhost/INBOX.pratele.cstex). Only workaround for this bug
(IMHO) is to use != for > (because = expands to imap://localhost/INBOX.
-- notice the dot in the end). However, this is really hack and decent
solution should be found, IMHO.

Matej

--
Matej Cepl,
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488

3. reply-hooks overrun by folder-hooks

4. Multiple IMAP account and imap folder browsing.

5. folder-hook vs fcc-hook

6. folder-hook ignored with IMAP

7. Why is there multiple folders for Sent, Deleted, etc, for IMAP accounts?

8. multiple IMAP accounts - folders

9. folder list with multiple imap accounts

10. Multiple IMAP accounts and folder browser

11. Entourage 2008 with IMAP mail account - Imap folders won't retain messages

12. Windows Hooks: Is hook dll required only for WH_MOUSE and WH_KEYBOARD?

13. account-hook does not

14. Filing mail, mailing lists, sub-directories -> save-hook fcc-hook

15. mbox-hook, save-hook question