Bug 447742

Summary: Make URL-containg List headers available to grantlee for header themeing
Product: [Applications] kdepim Reporter: Erik Quaeghebeur <bugs.kde.org>
Component: messageviewerAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: wishlist CC: kdepim-bugs
Priority: NOR    
Version: GIT (master)   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In:

Description Erik Quaeghebeur 2021-12-31 13:56:19 UTC
AFAICT, all variables available to grantlee header theme editors are listed in

https://invent.kde.org/pim/messagelib/-/blob/master/messageviewer/src/header/grantleeheaderformatter.cpp

There, it seems some standard (although less common) headers are missing. Some of these likely require some extra parsing before they can be made available. Namely, the URL-containg List-* headers (https://datatracker.ietf.org/doc/html/rfc2369) are not exposed to grantlee. Would it be possible to make List-Help, List-Unsubscribe, List-Subscribe, List-Owner, and List-Archive available to grantlee for header themeing?

As per the RFC, the information in the headers is a list of URLs (between angle brackets <…>, other content can be ignored), possibly both http and mailto ones. The preference is from left to right. List-Post has a special value ‘NO’ for lists that can't be posted to.

For header theme designers, it would be useful to have, e.g., header.listUnsubscribe be a list of items that can be iterated over using grantlee. Each item would then contain a URL header.listUnsubscribe.k.url and type information header.listUnsubscribe.k.protocol (http or mailto), where k is the current list index (normal usage: {% for item in header.listUnsubscribe %}do something with {{ item }} to create output{% endfor %}).