This may have been addressed in past discussions, but I am having a problem with the $folder variable not getting set correctly by a "set" command inside a "folder-hook". The details are as follows.
I have two Gmail accounts, and want to be able to switch back and forth between them using the folder browser menu. Unfortunately not everything gets switched over to the other account when I switch over. Specifically, the $folder variable seems to not be getting reset, despite my having an appropriate "set" command inside the "folder-hook" command. The relevant part of my "muttrc" is appended below. What happens is this. Initially, the "user1" account comes up, and the $folder variable is correctly set for that account. Unfortunately however, when I switch to the "user2" account (using the "browse-mailboxes" command), the $folder variable remains set to the "user1" folder. I've played around with the configuration in various ways, changing some of the "folder-hook"s to "account-hook"s, and trying re-ordering the commands in various ways, but cannot get mutt to correctly set the $folder variable for the "user2" account. How can I get this to work? -- Todd Hesla Minneapolis MN - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Here's the muttrc file: set imap_authenticators=oauthbearer set smtp_authenticators=oauthbearer # Set initial folder. # set spoolfile=imaps://us...@imap.gmail.com:993/INBOX # GMail #1. # mailboxes imaps://us...@imap.gmail.com:993 folder-hook imaps://us...@imap.gmail.com:993 'set smtp_url=smtp://us...@smtp.gmail.com:587' folder-hook imaps://us...@imap.gmail.com:993 'set imap_oauth_refresh_command="~/bin/mutt_oauth2.user1.py ~/.mutt/user1.tokens"' folder-hook imaps://us...@imap.gmail.com:993 'set smtp_oauth_refresh_command="~/bin/mutt_oauth2.user1.py ~/.mutt/user1.tokens"' folder-hook imaps://us...@imap.gmail.com:993 'set folder=imaps://us...@imap.gmail.com:993' folder-hook imaps://us...@imap.gmail.com:993 'set spoolfile=imaps://us...@imap.gmail.com:993/INBOX' folder-hook imaps://us...@imap.gmail.com:993 'set record="imaps://us...@imap.gmail.com:993/[Gmail]/Sent Mail"' folder-hook imaps://us...@imap.gmail.com:993 'set postponed=imaps://us...@imap.gmail.com:993/[Gmail]/Drafts' folder-hook imaps://us...@imap.gmail.com:993 'set hostname=gmail.com' folder-hook imaps://us...@imap.gmail.com:993 'set from=us...@gmail.com' # GMail #2. # mailboxes imaps://us...@imap.gmail.com:993 folder-hook imaps://us...@imap.gmail.com:993 'set smtp_url=smtp://us...@smtp.gmail.com:587' folder-hook imaps://us...@imap.gmail.com:993 'set imap_oauth_refresh_command="~/bin/mutt_oauth2.user2.py ~/.mutt/user2.tokens"' folder-hook imaps://us...@imap.gmail.com:993 'set smtp_oauth_refresh_command="~/bin/mutt_oauth2.user2.py ~/.mutt/user2.tokens"' folder-hook imaps://us...@imap.gmail.com:993 'set folder=imaps://us...@imap.gmail.com:993' folder-hook imaps://us...@imap.gmail.com:993 'set spoolfile=imaps://us...@imap.gmail.com:993/INBOX' folder-hook imaps://us...@imap.gmail.com:993 'set record="imaps://us...@imap.gmail.com:993/[Gmail]/Sent Mail"' folder-hook imaps://us...@imap.gmail.com:993 'set postponed=imaps://us...@imap.gmail.com:993/[Gmail]/Drafts' folder-hook imaps://us...@imap.gmail.com:993 'set hostname=gmail.com' folder-hook imaps://us...@imap.gmail.com:993 'set from=us...@gmail.com'