Compliance with RFC8058 for List-Unsubscribe email headers.

143 views
Skip to first unread message

David Manns

unread,
Feb 13, 2024, 10:01:52 AM2/13/24
to py4web

At some point soon email providers like Google, Yahoo and others will require bulk mail senders to include one-click list unsubscribe headers.

This requires the inclusion in bulk email messages of two headers: List-Unsubscribe AND List-Unsubscribe-Post.

The latter is not currently supported by py4web. Per the RFC the former includes one OR MORE uri's, comma separated and each enclosed in <....> brackets. One may be a mailto: link, the other https:. This is not consistent with the current list_unsubscribe implementation in mailer.py, which assumes a single mailto: URI and adds both the brackets and the mailto:. I think the user should supply the entire text of the header.

I've experimented with a modified mailer.py, as attached. The resulting messages (example atteched) appear correct, and pass SPF, DKIM and DMARC validation, but Google still does not display its 'unsubscribe' button. Per Google's docs there can be many reasons for this.

So, I'm not sure if, in particular, I'm meeting the DKIM constraint mentioned in the first para of 3.1 in the RFC. Do I need to do something special, like using the mailer's dkim parameter? If so, I have no idea how to do this?

David
mailer.py
email with one-click unsubscribe.rtf

David Manns

unread,
Feb 15, 2024, 12:29:14 PM2/15/24
to py4web
Two fixes are needed in mailer.py, as in the attached mailer.py

1. In list_unsubscribe allow for any compliant values in this header. Either have the supplied value always be the entire string for the header (as in the attached), or for backward compatability check whether the supplied string startswith '<'; if so use it as the entire header, if not encapsulate it in "<mailto:value>" as at present.

2. support the List-Unsubscribe-Post header with a list_unsubscribe_post parameter (as in the attached).

Massimo

unread,
Feb 18, 2024, 11:25:17 PM2/18/24
to py4web
Thank you. Will include this.

Villas

unread,
Apr 25, 2024, 8:56:25 PM4/25/24
to py4web
Further to David's posts,  it seems that we still need to improve the mail headers:

List-Unsubscribe  Rfc 2369
It seems that the List-Unsubscribe header should also allow the possibility of including URIs separated by commas.
The list is used left to right with the first functional URI being used.  
Normally a mailto: is included for those clients only able to handle mail-based protocols.
Example:
List-Unsubscribe: <https://example.com/unsubscribe.html?opaque=123456789>,<mailto:listr...@example.com?subject=unsubscribe>

List-Unsubscribe-Post  Rfc 8058
Optionally, included to indicate the sender approves 'One Click' unsubscriptions.  
Mail providers are driving towards one-click unsubscriptions and wish to automatically show one-click buttons to the user.
It is intended to provoke a POST request to the first valid HTTPS in the List-Unsubscribe
It takes only one fixed format:
List-Unsubscribe-Post: List-Unsubscribe=One-Click
Reply all
Reply to author
Forward
0 new messages