Thursday, August 6, 2009

Claws Mail got bitten by a Snake!

I've been successfully using the Perl plugin for Claws Mail for a long time now. It hasn't seen many updates lately, but that's because I am mostly happy with it for my personal needs.

However, filters for Claws Mail is one of the few remaining areas where I'm still a Perl user. I have the feeling that my mental capabilities are insufficient for memorizing the dozens (hundreds?) of operators, magic variables etc., especially after a while of absense from the language. "There is more than one way to do it" is fine, but with age, I tend to prefer "There is a single (obvious) way to do it" as a motto. So, for all of my scripting purposes, I found a new home at the Python people. Please, no discussion which one is "better", for whatever definition of "better". Both are nice languages, and I guess people just have to figure out which one suits their individual work flow better.

So, lately, I had to embed a Python interpreter in some C code, and, as often when learning about new technologies, I though this might be a fun add-on to Claws Mail. Don't worry, I am not trying to bloat Claws Mail with every single interpreter out there -- although that might actually be a fun experience.

So I cooked up a small Python plugin for Claws Mail, which adds an interactive Python console to Claws Mail (stolen and adapted from gtkparasite - which is a great project). It's also possible to execute scripts from the menu, for further automation. The interface to Claws Mail is still limited, and only includes calling menu items for now.

(Planet readers: A short demo screencast is here).

Code is on GitHub.

PS: Yes, I know that the name Python actually refers to a commedy group, not to the animal. But I don't care.

Update: The plugin source moved to Claws Mail CVS. It also gained on a new trick on the way -- automated composing of mail messages. See the README file for an example.