If you happen to have accounts on multiple IMAP and/or POP servers, you may find managing all the authentication settings inconvenient and error-prone. The account-hook command may help. This hook works like folder-hook but is invoked whenever you access a remote mailbox (including inside the folder browser), not just when you open the mailbox.
account-hook . 'unset imap_user; unset imap_pass; unset tunnel' account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo' account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'