banner
 

Path: content/Tips/Linux/ClawsMail.md

Claws Mail

Clawsmail is a lightweight mail client for Linux and other operating systems. It is highly configurable, though it is missing some features by default - eg you cannot compose HTML emails and you need plugins to view HTML emails. However, its folder management and connectivity options are very good, and most of the quirks can be worked around.

Getting datastamps on printed emails

For html mails, if you have one of the html rendering plugins, you will find that you can't get it to print the header information, eg date, from, to, subject etc. This fix I found in a mailing list from 2016, and reproduce here with the kind permission of the original author Wolfgang Rosner (yes, he still has the same email address!)

Original link: https://claws-mail.org/pipermail/users/2016-October/017644.html

Attached you will find what I have done.


It's still a crude hack in early pre-alpha state.

Nevertheless, I just made some quick tests with differnt mail formats
and it works surprisingly well. It even loads missing images from the
web. No clue how to configure it not to do so.

There is still some code page issue for correct display of German
"Umlaut" (and maybe other special characters, I'd expect).

You need "wkhtmltopdf" as html-to-pdf-converter and "okular" as pdf
viewer. Config does not yet work here, change pipe command in line 112
to switch to a differnt viewer, instead.

You need perl including  Email::MIME and Data::Dumper modules. 

I've installed everything from the current debian jessie repo's. No idea
about version dependencies.



The script reads a message from STDIN in the format claws mail produces
in its "Action" interface. 

Therefore, an action command has to be created in claws mail
something like this: 
     cat %p | /home/user/path/htmailread.pl

(fit the path of the executable to your environment)


To change the appearence of the header, try to tweak the
HTML-generation of the header lines in code lines 72 ... 83.

To change visible header items or their sequence, change line 21.

Perl plugin here:

https://gromatic.uk/content/Tips/Linux/htmailread.pl

In the configuration / actions interface , simply add a new action containing the command above. This will then appear as a menu item in the message view screen under tools / actions . I installed it on kubuntu 24.04 with standard repos - I had to install a couple of perl modules and other tools via APT - eg wkhtmltopdf , libemail-mime-perl , libhtml-escape-perl .

For it to work, you need to select the non-html view and then click tools/actions , otherwise for some reason it can't pull out the required headers. It still renders the html version (regardless of whether you have the fancy plugin installed)


Links in this section

ClawsMail
Desktop
Filesystems
SSH
Systemd
VI
htmailread

Last updated : 22 July 2025