postal icon indicating copy to clipboard operation
postal copied to clipboard

list-unsubscribe-post header missing from DKIM signature for one-click email unsubscribe

Open chrisdeeming opened this issue 1 year ago • 0 comments

Describe the bug

As per RFC 8058 and the recent changes by Google and Yahoo anyone wishing to support "one-click" unsubscribe should now include both a List-Unsubscribe header and a List-Unsubscribe-Post header and both headers should form part of the DKIM signature.

Postal includes list-unsubscribe in its DKIM signature, but not list-unsubscribe-post.

To Reproduce

Check headers of an outgoing email with a list-unsubscribe and list-unsubscribe-post header:

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=postal-PZR2qI; t=1707269935; bh=uiGorXRig2ZcL9qFsYnBlUJ+fkHeEqIjJ2x1/RCZKsE=; h=message-id:date:subject:from:reply-to:to:mime-version:content-type:list-unsubscribe; b=wQK581xseoZPxCqV3homE7u5/PsEhlrWCrPZh71UQjVKuftN6uBpiqTDRlMLCnt1YNd8HNFU hARN0ZJXU1x0DEpzwYFtDkgzL8yf1YZh3fGqIV841LqNyutvd3/vWTvfu5Uo0+humFFl0xvD aNJ6If2LSEFeMyUWylVgAHaPp1A=
List-Unsubscribe-Post: List-Unsubscribe=One-Click
List-Unsubscribe: <https://example.com/unsubscribe?key=123>

Note that the list-unsubscribe header is mentioned in the DKIM signature but not list-unsubscribe-post.

Expected behaviour

list-unsubscribe-post should be a listed header in the DKIM signature

Additional information/context

Should be a simple fix, looks like we just need to add list-unsubscribe-post to this regex: https://github.com/postalserver/postal/blob/19e3bc20c6f8614f86de5a6ca41635878036767b/lib/postal/dkim_header.rb#L35

chrisdeeming avatar Feb 07 '24 01:02 chrisdeeming