Re: Mail header wrapping breaks DKIM signatures on incoming mail

Sam Varshavchik <[email protected]>
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
Hanno Böck writes:

> The mails also had some relatively long header lines without line
> breaks. It appears Courier applies some header line wrapping. I
> replicated this with a subject line like this:
> Subject: =?UTF-8?Q? 
> =C3=A4=20This=20is=20a=20very=20long=20Subject=20=C3=A4=20=C3=B6?=
>
> Courier turned this into:
> Subject:
>  =?UTF-8?Q?=C3=A4=20This=20is=20a=20very=20long=20Subject=20=C3=A4=20=C3=B6?=

I tried this experiment:

$ echo "Subject: mary had a little lamb, its fleece was white as snow. And everywhere Mary went the lamb was sure to go:" | sendmail mrsam

The resulting mail's Subject: header is untouched:

Delivered-To: [email protected]
Return-Path: <[email protected]>
Received: from localhost (localhost [127.0.0.1])
  (uid 1000)
  by ripper.email-scan.com with local
  id 00000000054A1532.000000006A770795.000D2E14; Sat, 08 Aug 2026 06:40:21  
-0400
Subject: mary had a little lamb, its fleece was white as snow. And everywhere Mary went the lamb was sure to go:
From: Sam Varshavchik <[email protected]>
Message-ID: <[email protected]>
Date: Sat, 08 Aug 2026 06:40:21 -0400
To: undisclosed-recipients: ;

> Does Courier have a way to disable any modification or wrapping of
> existing headers of incoming mail? I already had previous issues with
> Courier modifying MIME structures, but those can all be resolved by
> setting "MIME=none" both in the esmtpd and bofh config files (as is
> documented on the zdkimfilter web page). However, that does not seem to
> address header wrapping.

There's also the NOADDRREWRITE setting in the esmtpd(-ssl) configuration  
files, but it affects address headers, not other headers.

> Generally, I understand that Courier comes from a time where mail
> servers were far more commonly modifying mails in all kinds of ways.
> However, given DKIM and related DMARC enforcement is becomming more
> common and such modifications regularly break signatures, I think
> Courier should move to a place where it does not modify mail structures
> unless absolutely necessary. Ideally, this should also be the default.

Yes, and in that time mail servers commonly rewrote mail headers for many  
reasons. This directly originated from the fact that mail servers at the  
time often connected other non-Internet mail systems, with their own formats  
and peculiarities.

So, with that being the existing status quo, what would make sense for newer  
mail related standards to do?

1) Make them work in the way that's compatible with the existing mail  
standards.

2) Mandate that everyone comply with them, and avoid touching mail headers.

_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRupkKLJP96aW75pIOKYPgoojZS4gUCancJAQAKCRCKYPgoojZS
4iZJAQCCIRFj4C0hjR+xd5+6hUDsKiPijFlWDqwQq19nSnvFkgEA7AvBez/ND86H
GKdU7+gpukzcSJAU7vUBMFfOgTiGnAU=
=60z5
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.