Sieve ルールでメッセージの件名を変更するにはどうすればいいですか?

Sieve ルールでメッセージの件名を変更するにはどうすればいいですか?

私はメーリング リストに登録していますが、そのメーリング リスト経由で送信されるメールの件名にはメーリング リストの名前は表示されません。
メーリング リストのメールをメインの受信トレイに配信したいのですが、それでも一目でそのメーリング リストのメールだとわかるようにしたいです。

私のMTA(Dovecot)は、ほとんどのSieveフィルターをサポートしています。通常の拡張子

このリストからのメールの先頭に「[Foo-List]」タグを追加するにはどうすればいいですか?

答え1

メッセージの件名ヘッダーに文字列を直接追加または追加する標準化された方法はないようです。ただし、editheadersおよびvariables拡張機能を使用した回避策があります。

require "editheader";
require "variables";

# Match/select your message as you see fit
if header :contains "List-Id" ["<foo.lists.example.net>"]
{
    # Match the entire subject ...
    if header :matches "Subject" "*" {
        # ... to get it in a match group that can then be stored in a variable:
        set "subject" "${1}";
    }

    # We can't "replace" a header, but we can delete (all instances of) it and
    # re-add (a single instance of) it:
    deleteheader "Subject";
    # Append/prepend as you see fit
    addheader :last "Subject" "[Foo-List] ${subject}";
    # Note that the header is added ":last" (so it won't appear before possible
    # "Received" headers).
}

関連情報