このトピックに関する多くの記事がありますが、それらのどれも私には役に立ちませんでした。 .muttrcには複数のアカウントに関連する次のものがあります(もちろんIMAP + SMTPのみを使用)。
source "~/.mutt/account1"
folder-hook $folder 'source ~/.mutt/account1'
source "~/.mutt/account2"
folder-hook $folder 'source ~/.mutt/account2'
macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/account1<enter><change-folder>!<enter>'
macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/account2<enter><change-folder>!<enter>'
# Mailboxes
bind index G imap-fetch-mail
macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"
アカウントファイルは次のとおりです(たとえば、account1の場合、他のものは同じですが、フォルダ名は異なる言語で表示されます)。
set my_drafts = "Drafts"
set my_drafts_noquote = "Drafts"
set my_sent = "Sent<quote-char><space>Items"
set my_sent_noquote = "Sent Items"
set my_trash = "Deleted<quote-char><space>Items"
set my_trash_noquote = "Deleted Items"
set imap_user = "username"
set folder = "imaps://outlook.office365.com:993/"
set imap_authenticators = "login"
set mbox = "+INBOX"
set spoolfile = "+INBOX"
set record = +$my_sent_noquote
set postponed = +$my_drafts_noquote
set trash = +$my_trash_noquote
set smtp_url = "smtp://[email protected]:587"
set smtp_authenticators = "login"
set copy = "yes"
account-hook $folder "set imap_user=username"
それでmuttを始めた後、私は最終的に私の受信トレイに入りましたaccount2
。または を押すと、行きたい場所(送信したフォルダ、ドラフト、またはごみ箱)に移動できますgs
。その後、アカウントに切り替えてINBOXフォルダに正しく入りましたが、もう機能しません(account1とaccount2はごみ箱、ドラフト、転送に異なる名前を使用します)。 (「Sent Item」が存在しませんが、account2の言語に「Sent Item」という単語が書かれていますが、文字形式が間違っていることが示されています。)gd
gt
F2
gs
gt
gd
構成をどのように変更する必要がありますか?
ベストアンサー1
最後に解決策が見つかったので、誰かが同じ問題を抱えている場合は、ソートのためにaccount1とaccount2のファイルマッピングに追加することをお勧めしますmuttrc
。
bind index G imap-fetch-mail
macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"
また、ソースaccount1およびaccount2ファイルの末尾にある必要があります。mutt
変数を保持し、ショートカットが実際の変数値として実行されるたびにショートカットの式を評価するのではなく、構成を最初に読み取ったときに変数値がいっぱいになるようです。