現在のフォルダに基づいてMuttのデフォルトの保存フォルダを設定する

現在のフォルダに基づいてMuttのデフォルトの保存フォルダを設定する

現在のフォルダに基づいてデフォルトの保存フォルダを変更するようにMuttを設定したいと思います。

  • フォルダ=account1/Unsortedまたは=account1/Importantその下の別のサブフォルダにあるメッセージを読み取るときに、デフォルトの保存フォルダ(メッセージでインデックスを作成するときに提案されたフォルダ)をに設定したいと思います=account1/s=account1/INBOX

  • 同様に、サブフォルダの場合は、デフォルトの保存フォルダを次のように=account2/設定したいと思います。=account2/INBOX

これを行うには、Muttをどのように設定する必要がありますか?

  • save-hookフォルダ名を一致させる方法があると便利です(ないようです)。
  • 保存フォルダを設定する方法があると便利ですが、folder-hookフックに設定できる保存フォルダ設定はありません。 (あるのrecordに送るメッセージ用です。)

ベストアンサー1

修正する:次の2行が使用されることが報告されています。

folder-hook +account1 unhook save-hook
folder-hook +account1 save-hook . +account1/INBOX

各アカウントについて繰り返します。


ご存知のように、Muttは.muttrcファイルを介して設定されます。ご覧のとおりman muttrc、他のすべての人のパターンがそこにあります。そこにもフォルダモードは見えませんでしたが、検索してみるとsave他の場所で見つけました。

 Note that these expandos are supported in "save-hook", "fcc-hook" and "fcc-save-hook", too.

以上

              %b     filename of the original message folder (think mailbox)
              %B     the list to which the letter was sent, or else the folder name (%b).
              %O     original  save  folder where mutt would formerly have stashed the message: list name or
                     recipient name if not sent to a list

patternsこれらのうちのいくつかを使用することができますが、メッセージの代わりに何らかの方法で固定文字列を一致させる方法がわかりません。


カスタムヘッダー行を追加してテストするには、make procmail(または受信したメールに問題があるもの)を使用してください。-h


私はあなたの解決策が次のものを使用していると思います。

     folder-hook [!]regexp command
              When  mutt enters a folder which matches regexp (or, when regexp is preceded by an exclamation
              mark, does not match regexp), the given command is executed.

              When several folder-hooks match a given mail folder, they are executed in the order  given  in
              the configuration file.

これもできます

folder-hook account1 unhook *
folder-hook account1 save-hook ~A   =account1/INBOX
or
folder-hook account1      save-hook  ".*"  =account1/INBOX
folder-hook ^=account1.*  save-hook  ........... ???


UPDATE: Reportedly, the following two lines were used as solution (and seem to work)
folder-hook +account1 unhook save-hook
folder-hook +account1 save-hook . +account1/INBOX
# repeated for each separate account
# Note: We know the documentation for folder-hook says "regexp", but using +account (for some given account) seems to work too for whatever reason

最も近いものがsave-hook優先する可能性がないので、unhookを追加しました(unhook save-hookテストしたものに変更したり、動作するものに変更)。

    unhook [ *  | hook-type ]
              This  command will remove all hooks of a given type, or all hooks when "*" is used as an argu-
              ment.  hook-type can be any of the -hook commands documented above.


次の情報は、より単純な要件を持ち、このページにアクセスしている他のユーザーに役立ちます。

     save_address
              Type: boolean
              Default: no

              If set, mutt will take the sender's full address when choosing a default folder for  saving  a
              mail. If $save_name or $force_name is set too, the selection of the Fcc folder will be changed
              as well.

      save_name
              Type: boolean
              Default: no

              This  variable  controls how copies of outgoing messages are saved.  When set, a check is made
              to see if a mailbox specified by the recipient address exists (this is done by searching for a
              mailbox  in  the  $folder  directory with the username part of the recipient address).  If the
              mailbox exists, the outgoing message will be saved to that mailbox, otherwise the  message  is
              saved to the $record mailbox.

              Also see the $force_name variable.

An example:
set save_address=yes


この問題をどのように解決したかを私と他の人に教えてください。

おすすめ記事