如何使用 GnuPG 和 TOFU 在 mutt 中使 PGP 的输出不那么冗长?

Ted*_*Ted 8 mutt gpg pgp gnupg

我最近添加trust-model tofu+pgp了我的.gnupg/gpg.confto use TOFU并自动信任(边缘)我第一次看到的电子邮件中的密钥。它具有使 PGP 的输出极其冗长的不良后果:

gpg: Verified 1 message signed by "Foo <foo@foo.org>" (key: F00 BA8 …, policy: auto) in the past 32 minutes, 19 seconds.
gpg: Warning: we've only seen a single message signed by this key!
gpg: Warning: if you think you've seen more than 1 message signed by this key, then this key might be a forgery!  Carefully examine the email address for small variations (e.g., additional white space).  If the key is suspect, then use 'gpg --tofu-policy bad "name_of_key"' to mark it as being bad.
Run Code Online (Sandbox Code Playgroud)

PGP 的输出出现消息正文之前,更糟糕的是,对于与密钥关联的每个电子邮件地址,此文本块出现一次。在我的小屏幕上,我必须滚动很多才能阅读实际的电子邮件。我正在寻找解决此问题的方法:

  • mutt 中是否有一个选项可以只显示 PGP 输出的摘要(95% 的情况下,我关心的是“验证工作是否成功,与密钥关联的信任级别是多少”)?
  • 如果没有,是否有显示PGP的输出选项的消息,而不是之前的身体吗?
  • 否则,有没有办法让 GnuPG 的输出不那么冗长?

提前致谢!我在 Debian Sid(4.3.3-5;内核 4.3.0-1-amd64)上使用 GnuPG 2.1.11 和 mutt 1.5.24。

Ech*_*tor 0

查看 http://www.gsp.com/cgi-bin/man.cgi?topic=t-prot

这实际上是为了过滤掉邮件下面引用的线程(TOFU 缩写冲突),但也有一些 pgp 选项。可以通过将类似内容放入 set display_filter="t-prot -M mutt --pgp-move --pgp-short" .muttrc 来激活它(不要忘记首先安装 t-prot)

不幸的是,它并没有消除你提到的可怕的警告块,但这是我能找到的最好的现成的。

当然,您也可以通过自己的脚本进行过滤。

编辑: 因为我遇到了同样的问题,并且让 gawk 或类似的人来完成这项工作是......我编写了自己的脚本。请随意使用它作为显示过滤器: https://github.com/Echsecutor/mutt_gpg_display_filter/blob/master/filter.py