Weblog entry #13 for lee
The first rule in my user-level mail filter is to split mail into mailing-list traffic and non-mailing-list traffic. This is done very simply by checking for the existence of a populated "List-Id:" header. It's now been five years since the introduction of RFC 2919, and it appears to have been taken on by the majority of list admins.
However, there are a few admins who haven't adopted the header - possibly because they hates the internetses. So, rather than adding complexity to my user filters (and also to my user agent, which also makes use of the List-Id field), I add the header myself using an Exim system filter.
If you don't already use a system filter - you set it up by adding something like the following to the main section of the exim config (e.g. /etc/exim4/conf.d/main/00_local_config in a split config):
system_filter = /etc/exim4/system_filter
Then you edit the filter file and add something like the following:
if $h_List-Id: is "" then
## 20060212
if $h_Sender: contains "owner-balrog@example.org" then
headers add "List-Id: BALROG <balrog.example.org>"
endif
## 20060213
if $h_List-Post: contains "simianz@whiplash.example.com" then
headers add "List-Id: Simianz <simianz.whiplash.example.com>"
endif
endif
Obviously it's in the nature of system filters that they affect the delivery for every recipient, but in the case of adding list-id headers that should really be considered a benefit. And, since the checks only apply to mail without List-Id: headers, should the header be adopted upstream the filter will no longer apply.