Personally, I use GnuPG in order to store my passwords.
The passwords are stored in encrypted files. Whenever I start mutt, it tries to decrypt the passwords and GnuPG automatically asks me for the password to my private key. The passwords are then remembered by mutt for the current session and forgotten afterwards.
Mutt configuration looks like this:
set my_pw1=`gpg --batch -q --decrypt ~/.mutt/acc1pw`
set my_pw2=`gpg --batch -q --decrypt ~/.mutt/acc2pw`
set imap_pass=$my_pw1
set smtp_pass=$my_pw2
The first two lines will load the encrypted passwords, and the last two lines will set them as the IMAP and SMTP passwords respectively. You can also just use one password instead of two, the reason I use different passwords is because I have multiple accounts that are not on the same server.
In order to store your passwords in encrypted files, you have to make sure you store only your passwords, without any additional characters (that includes newlines). You can do it from the command line like this:
$ gpg --encrypt -r RECIPIENT > ~/.mutt/acc1pw
my_password<Ctrl+D>
Or alternatively, you can use echo:
$ echo -n "my_password" | gpg --encrypt -r RECIPIENT > ~/.mutt/acc1pw
That should work the way you except it to. You'll need a GnuPG public/private keypair for this to work the way I posted it above. As far as I know GnuPG can also do symmetric encryption but I never tried that, so your mileage may vary. The manpage should be able to help you with the that though.
imap_passunset, as mentioned in the accepted answer to the question you link? This matches both your security requirements and your user experience requirements. – Gilles Dec 16 '10 at 22:18