The &quot;actions&quot; feature is a convenient way for the user to launch external commands to process a complete message file including headers and body or just one of its parts. It allows also the use of an external command to filter the whole text or just a selected part in the message window or in the compose window. This is a generic tool that allows to do any uncommon actions on the messages, and thus extends the possibilities of Claws Mail.

+

The "actions" feature is a convenient way for the user to launch external commands to process a complete message file including headers and body or just one of its parts. It allows also the use of an external command to filter the whole text or just a selected part in the message window or in the compose window. This is a generic tool that allows to do any uncommon actions on the messages, and thus extends the possibilities of Claws Mail.

=[http://unafivoteb.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=

+

−

----

+

−

=[http://unafivoteb.co.cc CLICK HERE]=

+

−

----

+

−

</div>

+

=== Usage ===

=== Usage ===

Revision as of 13:42, 2 October 2012

Introduction

The "actions" feature is a convenient way for the user to launch external commands to process a complete message file including headers and body or just one of its parts. It allows also the use of an external command to filter the whole text or just a selected part in the message window or in the compose window. This is a generic tool that allows to do any uncommon actions on the messages, and thus extends the possibilities of Claws Mail.

Usage

To create a new action, go to Configuration -> Actions.... The "Actions setting" dialog offers to enter the Menu name that will trigger the command. The created menu will be found in the Tools -> Actions submenu. By inserting a slash / in the menu name, you create a submenu.

The command is entered in the Command line entry. Note that Claws Mail stores every single email in a separate file. This allows to use the following syntax for the command :

%f denotes the file name of the selected message. If you selected more than one, then the command will be launched for each message with the appropriate file name;

%F denotes the list of the file names of the selected message. If only one message is selected, this amounts to %f, but if more messages are selected, then the command will be launched only once with the list of the file names. (You can use both %f and %F in one command: then the command will be launched for each selected message with the name of this message and with the list of all selected messages. I did not find a practical example for this.);

%p denotes the current selected message part of a multipart message. The part is decoded accordingly. If the message is not a multipart message, it denotes the message body

Prepending >: this will allow you to send to the command's standard input a text that you will enter in a dialog window

Prepending *: this will allow you to send to the command's standard input a text that you will enter in a dialog window. But in contrast to prepending >, the entered text is hidden (useful when entering passwords)

Appending an ampersand &: this will run the command asynchronously. That means "fire and forget". Claws Mail won't wait for the command to finish, nor will it catch its output or its error messages

Prepending the vertical bar | (pipe-in): this will send the current displayed text or the current selected text from the message view or the compose window to the command standard input. The command will silently fail if more than one message is selected

Appending the vertical bar | (pipe-out): this will replace the current displayed text or the current selected text from the message window or the compose window with the command standard output. The command will silently fail if more than one message is selected

Appending the "greater than" sign > will insert the command output in the message. The difference between the trailing | is that no text will be deleted or replaced. Most used when composing mails to insert text. Only available since 0.8.6claws66*

Note: It is not possible to use actions containing %f, %F or %p from the compose window.

When a command is run, and unless it is run asynchronously, Claws Mail will be insensitive to any interaction and it will wait for the command to finish. If the command takes too long (5 seconds), it will popup a dialog window allowing to stop it. This dialog will also be displayed as soon as the command has some output: error messages or even its standard output when the command is not a "pipe-out" command. When multiple commands are being run, they are run in parallel and each command output is separated from the outputs of the others.

Examples

Here are some examples that are listed in the same syntax as used for storing the actions list. You can copy and paste the definition in your ~/.claws-mail/actionsrc file (exit Claws Mail before). The syntax is very simple: one line per action, each action contains the menu name and the command line separated by a colon and a space ": ". Alternatively, you can use Configuration -> Actions... and for each example enter a menu name and copy&paste the text after the colon and space ": " in the command definition.

Purpose

Menu Name: Command Line

Details

rot13 cyphering

Rot13: |tr a-zA-Z n-za-mN-ZA-M|

This will apply the rot13 cyphering algorithm to the (selected) text in the message/compose view

Decoding uuencoded messages

UUdeview: xdeview %F&

xdeview comes with uudeview. If an encoded file is split in multiple messages, just select them all and run the command.

Opens uuencoded file with OpenOffice. The uuooffice script can be found here.

Save attachments

Save attachments: munpack -C ~ -- %F

Select one or several mails then use the action. The attachments will be saved to your home folder, you can replace ~ by another directory provided you create it first. munpack is provided by the mpack package in debian.

Search any searchable website for the selected text. Needs the multiwebsearch.pl script.

Google for message id

Google Msg ID: |google_msgid.pl

Search google for the selected message ID. Needs the google_msgid.pl script. Edit the script to change the browser (default is mozilla).

Pipe a header value to a script

Get Subject: grep "^Subject:\ " %f | cut -d\ -f 2-| script.sh

Pipe the Subject: header value of selected message to script.sh

Fix missing date

Fix date: fix_date %F

Add a 'Date:' header in the selected email(s) when such header is missing. Needs the fix_date.sh script.

The correct date is guessed from other headers that contain timestamp information or from the file or system date as a fallback. The order or preference for the date value replacement can be changed by editing the script. This script can be used to fix messages that show non RFC-compliant Date headers as well. X-Original-Date is always added too, to keep track of the original value if any. Date: and X-Original-Date: headers are not overwritten unless you use the --force switch.

The uudec script can be found here (uudec). It needs uudecode and Image Magick's display. The latter can be replaced by any image viewer that can get input from standard input. The script could also be modified to use temporary files instead of standard input.

The uuooffice script can be found here (uuooffice). It needs uudecode and OpenOffice. The latter can be replaced by any document viewer/editor. The script creates a temporary file (/tmp/uuooffice-<docname>) and deletes it after you close OpenOffice.

The tnef-claws bash script was written by Shawn Lamson and is to be found here. The script is well commented. You need to have the tnef package already installed.