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

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

我最近添加了trust-model tofu+pgp我的.gnupg/gpg.conf使用豆腐并自动(稍微)信任我第一次看到的电子邮件中的密钥。它的不良后果是使 PGP 的输出变得极其冗长:

gpg: Verified 1 message signed by "Foo <[email protected]>" (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.

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。

答案1

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

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

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

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

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

相关内容