[Users] How to process and change subject of e-mails

wwp subscript at free.fr
Thu Nov 24 00:44:22 CET 2011

Hello Piotr,

On Wed, 23 Nov 2011 23:31:24 +0000 Piotr Drozdek <pioruns at o2.pl> wrote:

> On Tue, 22 Nov 2011 07:33:55 +0100
> wwp <subscript at free.fr> wrote:
> > If modifying the subject is folder-dependent and is about stripping
> > some part, then you can use the folder properties, using the "simplify
> > subject regexp" thing. You set a regexp there and the matching part of
> > the subject will be removed (in fact: hidden) from the subjects shown
> > in folder message list. Source file kept untouched (this has been
> > thought preferable).
> Thanks a lot, very nice solution.
> But can you tell me, how to trigger a processing of messages, and
> modify subject or other field in source message, for example? Or how
> to modify body of message, using external linux commands like sed or
> awk? This may be very useful, but I didn't find any examples of it on
> Google yet.

For this, you can set up an action based upon a shell command (see
Configuration/Actions..), action that would call an external script or
program. For instance: "editmymessage.sh %F".

Make sure your .sh has exec permissions (or call it using sh).

It would be up to the shell script to edit the message source file, you
can do that with sed or whatever you need. CM is not meant to edit the
message source directly (except usings few plug-ins maybe, like for
instance, for attachment removal). Actions can be fired upon a message
or a list of selected messages, with an external script and actions you
can either modify the source file or what's shown in message window (see
Information dialog in Actions.., I'm referring to actions likes "|
filter.sh |" there).



More information about the Users mailing list