![Sieve ルールでメッセージの件名を変更するにはどうすればいいですか?](https://rvso.com/image/1609675/Sieve%20%E3%83%AB%E3%83%BC%E3%83%AB%E3%81%A7%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%E3%81%AE%E4%BB%B6%E5%90%8D%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%81%84%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F.png)
私はメーリング リストに登録していますが、そのメーリング リスト経由で送信されるメールの件名にはメーリング リストの名前は表示されません。
メーリング リストのメールをメインの受信トレイに配信したいのですが、それでも一目でそのメーリング リストのメールだとわかるようにしたいです。
私の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).
}