Issues sourcing a file in muttrc
Dear devs,
I had two gmail accounts configured in mutt. I managed to configure them in muttrc and mutt worked normally with them. Then I added a third account, the only difference was the account name. I basically copy pasted muttrc commands and changed the name and obviously the password. But something that doesn't make any sense is happening. This is what I have in my muttrc :
folder-hook 'imaps://account@imap.gmail.com/' "source '~/.mutt/.account.gmail'"
folder-hook 'imaps://secondaccount@imap.gmail.com/' "source '~/.mutt/.secondaccount.gmail'"
folder-hook 'imaps://account3@imap.gmail.com/' 'source ~/.mutt/.account3.gmail'
source ~/.mutt/.account.gmail
source ~/.mutt/.secondaccount.gmail
source ~/.mutt/.account3.gmail
The above does not work. More precisely, it sources the first two accounts without any error. But fails to source the third account, even though it is exactly identical to the other two with the only difference being the account name.
The exactly identical commands below work. The .account3.gmail file that I'm sourcing above contains exactly the same lines I'm inserting manually in muttrc below. So, technically there is no difference between the code above and the code below. But only the code below works.
folder-hook 'imaps://account@imap.gmail.com/' "source '~/.mutt/.account.gmail'"
folder-hook 'imaps://secondaccount@imap.gmail.com/' "source '~/.mutt/.secondaccount.gmail'"
#folder-hook 'imaps://account3@imap.gmail.com/' 'source ~/.mutt/.account3.gmail'
folder-hook 'imaps://account3@imap.gmail.com/' " \
set folder = 'imaps://account3@imap.gmail.com/' \
spoolfile = +INBOX \
postponed = +[Gmail]/Drafts \
trash = "imaps://account3@imap.gmail.com/[Gmail]/Trash" \
norecord \
realname = 'account3' \
from = 'account3 <account3@gmail.com>'"
source ~/.mutt/.account.gmail
source ~/.mutt/.secondaccount.gmail
source ~/.mutt/.account3.gmail
As I said above, all three files are identical, the only difference is the account name. Only the last account file gives an error when sourced. Also, the account works fine in other email clients.
Is this a bug in how mutt reads his muttrc and handles sourced files? Or am I doing something wrong.