msgviewer: parse and display authentication results

Parse the Authentication-Results header and display it in the message
viewer (not enabled by default). DKIM, SPF and DMARC authentication
methods are supported. Implement recommendation from RFC 7601 Sec 7.1 to
have an explicit list of trustworthy hostnames before displaying the
authentication results. Be aware that the authentication headers can be
forged.

To display the results for a specific authentication method, add the
corresponding name to the layout of headers in the viewer section of
aerc.conf, e.g. to display all three, use:

header-layout = From|To,Cc|Bcc,Date,Subject,DKIM|SPF|DMARC

More information will be displayed when "+" is appended to the
authentication method name, e.g. DKIM+ or SPF+ or DMARC+.

Also, add the trustworthy hosts per account with the trusted-authres
parameter, e.g.

trusted-authres = *

to trust every host or use regular expressions for a finer control.
Multiple hosts can be entered as a comma-separated list. Authentication
results will only be displayed when the host is listed in the
trusted-authres list.

Link: https://datatracker.ietf.org/doc/html/rfc7601
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Koni Marti 2022-05-30 00:20:41 +02:00 committed by Robin Jarry
parent 115447e57f
commit 83e0e2638d
7 changed files with 295 additions and 6 deletions

View file

@ -383,6 +383,11 @@ These options are configured in the *[viewer]* section of aerc.conf.
Rows will be hidden if none of their specified headers are present in the
message.
Authentication information from the Authentication-Results header can be
displayed by adding DKIM, SPF or DMARC. To show more information
than just the authentication result, append a plus sign (+) to the header name
(e.g. DKIM+).
Default: From|To,Cc|Bcc,Date,Subject
*show-headers*
@ -649,6 +654,12 @@ Note that many of these configuration options are written for you, such as
signature to be added to emails sent from this account. If the command
fails then *signature-file* is used instead.
*trusted-authres*
Comma-separated list of trustworthy hostnames from which the
Authentication Results header will be displayed. Entries can be regular
expressions. If you want to trust any host (e.g. for debugging),
use the wildcard \*.
# BINDS.CONF
This file is used for configuring keybindings used in the aerc interactive