I run a modified version of the Listcommands plugin which does this already. Also it changes my sender identity to match the one that received the email from the list. This is useful because I use a different address for mailinglists than I do for personal email and RC cannot detect it and switch identities automatically because its part of the mailing list headers rather written like a normal email address. I'm happy to share the code if anyone one is interested.
Im also happy to add your changes to the plugin if you think it's useful for others.
Cor
List info: http://lists.roundcube.net/dev/ BT/aba52c80