custom headers in claws mail

My last post described how to add a custom X-header to outgoing email in postfix. But of course this approach is rather a blunt instrument because it necessarily adds the header to all outbound mail which originates from my server. In my particular case that does not matter overmuch, because any and all mail accounts on that server are either mine, an administrative account, or a family member’s. But this approach would be no good for say, a corporate server (unless that Corporation had specifically agreed that approach).

Better by far if individual users could decide whether they wish to add the custom header to their local account(s). So the best place to add a header will be in the MUA, not the MTA as I had done. My MUA of choice is claws (for some reasons see “All email clients suck“). Like Steve Litt, the author of that post, I find claws the least sucky of all the mail clients I have tried (and I particularly abhor that bastardisation of standards which is inherent in HTML email in a bloody browser). Claws is fast, lightweight, standards based, handles my IMAPS mail connections to dovecot on my mail server admirably easily, allows me to keep all my email plain text based and does not down load any in-line images unless I tell it to.

Adding headers at the MUA level is a much better approach because the user does not need access to the mail server at all – and the majority of users will never have that option anyway. Any custom headers added at the user end should not be stripped by the intermediate MTA(s), particularly if the user limits him or herself to X-headers (and not any of the standard headers specified in the relevant RFCs).

When I looked at adding the header I wanted in claws I initially drew a blank because the only place I could find to do so was in the “Send” option of the “Account Preferences” section in Claws’ configuration options (see below).

custom header image

If you check the “Add user-defined header” box and click on the “Edit” field, you are presented with a drop down box which includes (by default) only four options. These are “User-Agent”, “Face”, “X-Face” and “X-Operating-System”. In each of those four cases. the “Value” field is empty (again by default). My big, stupid, mistake was to assume that you could only edit the values of those four custom headers. Of course this is not true. You can add any new header you want if you simply delete (or overwrite) any one of the headers shown and then add your own value – again see below.

new custom header in claws

So I added a new header called “X-Clacks-Overhead” with the requisite value “GNU Terry Pratchett” and clicked the “add” button below and then clicked “Apply”.

Job done.

(Note however, that you do not need to add the colon after the name of the new header, claws does that for you.)

Permanent link to this article: https://baldric.net/2023/03/23/custom-headers-in-claws-mail/