Difference between revisions of "Actions"

From Claws Mail FAQ
Jump to: navigation, search
m (Reverted edit of Cheaptara, changed back to last version by Claws)
Line 1: Line 1:
=== Introduction ===
+
Do you require a brand-new [http://www.youtube.com/watch?v=rmqQAHRd0D0 paper cutter and trimmer] paper cutter for your school or place of work? If so, you are going to need to understand how to select the best trimmer for your demands. Here is just what you have to do:
  
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.
+
Check into the cutting capacity. The trimmer's cutting capacity is absolutely something you need to be aware of. The cutting capacity will definitely depend on the sort of cutter. For instance, a rotating trimmer can usually just trim a couple of sheets at a time while a stack cutter can easily process hundreds of sheets immediately. You ought to pick a cutter that can cut a great amount of sheets at once.
  
=== Usage ===
+
Do you need to cut cardstock? If you're planning on using cardstock or additional thicker kinds of paper, you will definitely want to make certain that your cutter can handle it. A guillotine cutter is a terrific choice if you desire to be able to deal with different stocks.
  
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.
+
Consider just how the machine is constructed. Because you're most likely going to be utilizing your new cutter a whole lot, you need to pick one that is durably built. If a trimmer features wooden and steel parts, you can easily depend on it being durable enough for regular usage. While cutters with a great deal of plastic parts can easily be more economical, they're just not as long lasting. You might end up needing to replace it quicker than you would like.
  
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 :
+
Make sure the cutter is safe to use. Whether you pick a rotary trimmer, guillotine cutter, or stack cutter, there's no doubt about it: these tools can easily be harmful, especially if they're made use of inappropriately. Hence, you'll need to make certain the cutter has really good safety . Some attributes to seek include a finger guard and blade latch (for guillotine cutters). Numerous rotating trimmers have blades that are framed in housing to keep your fingers safe. And a ton of pile cutters need two-handed operation. Several of the more sophisticated trimmers have optical eyes that can easily locate when your hands are too close to the blade. If this occurs, the cutter will not work. Also, no matter what safety features your cutter has, you need to exercise caution when using it. Children should additionally be carefully monitored if you want your students to make use of the cutter. Whatever you do, be careful!
  
* '''%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;
+
Think about brand. A whole lot of business produce paper cutters and you may even recognize some of the names such as GBC, Swingline, and Fellowes. Lesser known names consist of Dahle, Premier, and Foster Keencut. All of these business make fantastic cutters that are worth looking into and many of the trimmers have great guarantees.
  
* '''%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.);
+
Stick to your budget. Finally, there are really good paper cutters accessible at every rate point. Stick to your finances so you can easily get the cutter you require without breaking the bank.
  
* '''%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
+
Choosing the ideal paper cutter doesn't need to be challenging. Given there are an amount of things you need to take into consideration and you require to inspect your potential gadget to ensure it's ideal for you, but it's very easy. Begin looking for your paper shredder today.
 
+
* 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.
+
 
+
{| border="1" cellpadding="2"
+
|-
+
!Purpose
+
!Menu Name: Command Line
+
!Details
+
|-
+
|'''rot13 cyphering'''
+
|'''Rot13:''' <nowiki>|</nowiki>tr a-zA-Z n-za-mN-ZA-M<nowiki>|</nowiki>
+
|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.
+
|-
+
|'''Display uuencoded image'''
+
|'''Display uuencoded:''' [[Actions#uudec|uudec]] %f&
+
| Displays uuencoded files. The uudec script can be found [http://www.claws-mail.org/tools/claws-mail-uudec.tar.gz here].
+
|-
+
|'''Opening uuencoded document with OpenOffice'''
+
|'''Open uuencoded with OpenOffice:''' [[Actions#uuooffice|uuooffice]] %f&
+
| Opens uuencoded file with OpenOffice. The uuooffice script can be found [http://www.claws-mail.org/tools/claws-mail-uuooffice.tar.gz 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.
+
|-
+
|'''Save MS TNEF parts'''
+
|'''Save TNEF part:''' xterm -e [[Actions#tnef-claws|tnef-claws]] %p
+
| Select the TNEF message part then use this action to extract the attachment.
+
|-
+
|'''Alter messages'''
+
|'''Edit message:''' gvim -f "%F"
+
|Allows to edit any received message. Can be used to remove unneeded message parts etc.
+
|-
+
|'''Pretty format'''
+
|'''Format/Par:''' <nowiki>|</nowiki>par 72Tbgjqw74bEe B=._A_a 72bgi<nowiki>|</nowiki>
+
'''Format/Fmt:''' <nowiki>|</nowiki>fmt -s -w 75<nowiki>|</nowiki>
+
|'''Par:''' http://www.nicemice.net/par/ is an utility that can pretty format any text. It does a very good job in indenting quoted messages, and justify text. Used when reading or composing a message.
+
 
+
'''Fmt:''' part of the the GNU core utilities
+
|-
+
|'''Browse'''
+
|'''Part/Dillo:''' dillo %p&
+
|Browse the selected message part in Dillo.
+
|-
+
|'''Receive key from server via PGP/MIME signature'''
+
|'''GnuPG/Receive Key from PGP/MIME sig:''' <nowiki>ID=`gpg --verify %p /dev/null 2>&1|grep "key ID"|</nowiki>tr -d "[:space:]"<nowiki>|</nowiki>tail -c8`;echo "==== Fetching $ID ===="; gpg --no-tty --keyserver wwwkeys.nl.pgp.net --recv-keys $ID
+
|Select the signature part of a message then call this action to fetch the key from wwwkeys.nl.pgp.net
+
|-
+
|'''Receive key from server via signed unencrypted inline message'''
+
|'''GnuPG/Receive Key from Signed Inline Message:''' <nowiki>ID=`gpg --verify %p 3>&1 1>&2 2>&3 |grep "key ID"|</nowiki>tr -d "[:space:]"<nowiki>|</nowiki>tail -c8`;echo "==== Fetching $ID ===="; gpg --no-tty --keyserver wwwkeys.nl.pgp.net --recv-keys $ID
+
|No need to mouse-select the message, just use the action.
+
|-
+
|'''Receive key from ID in message'''
+
|'''GnuPG/Receive Key From ID in Message'''<nowiki> | </nowiki>gpg --recv-keys
+
|Useful when only the desired key ID is in the message.  Just select the ID and call the action.
+
|-
+
|'''Receive key from URL in message'''
+
|'''GnuPG/Receive Key from URL in message'''<nowiki> | </nowiki>wget -i - -O - <nowiki>|</nowiki> gpg --import
+
|Select the URL where the public key is then import it with this action.
+
|-
+
|'''Display encryption keys of a message'''
+
|'''GnuPG/Display encryptions keys of message'''<nowiki> | </nowiki> cat %p <nowiki>|</nowiki> gpg --batch --decrypt --list-only --status-fd 1 2>/dev/null <nowiki>|</nowiki> awk '/^\[GNUPG:\] ENC_TO / { print $3 }' <nowiki>|</nowiki> while read keyid; do echo "$keyid"; gpg --list-keys "$keyid"; echo; done
+
|Shows the key ids, that were used for encrypting the message. Additionally the corresponding keys from the keyring are displayed.
+
|-
+
|'''Import key from mail'''
+
|'''GnuPG/Import Key From Mail:''' gpg --import %p
+
|Select the message part where the public key is then import it with this action.
+
|-
+
|'''Insert public key in message'''
+
|'''GnuPG/Insert My Public Key:''' gpg --export -a MYKEYID>
+
|Insert your public key in the message your are composing. Replace MYKEYID with your key id. '''Needs 0.8.6claws66 or newer'''
+
|-
+
|'''Reporting SPAM'''
+
|'''Report as SPAM:''' spamassassin -r < %f
+
|Use [http://spamassassin.apache.org/ spamassassin] to report mail as spam. Redirection (<) is possible only with version 0.7.7.
+
|-
+
|'''Check spelling'''
+
|'''Check spelling:''' <nowiki>|</nowiki>T=`mktemp $HOME/.sXXXXXX`; cat - > $T;xterm -e ispell $T;cat $T;rm $T<nowiki>|</nowiki>
+
|Open a terminal and check the spelling with ispell
+
|-
+
|'''Search Google for selected text'''
+
|'''Search Google:''' <nowiki>|</nowiki>google_search.pl
+
|Search google for the selected text. Needs the [http://www.claws-mail.org/tools/claws-mail-google_search.tar.gz google_search.pl] script.
+
|-
+
|'''Search any searchable website for the selected text'''
+
|'''Search:''' <nowiki>|</nowiki>multiwebsearch.pl --where="%u" --what="%s"
+
|Search any searchable website for the selected text. Needs the [http://www.claws-mail.org/tools/claws-mail-multiwebsearch.tar.gz multiwebsearch.pl] script.
+
|-
+
|'''Google for message id'''
+
|'''Google Msg ID:''' <nowiki>|</nowiki>google_msgid.pl
+
|Search google for the selected message ID. Needs the [http://www.claws-mail.org/tools/claws-mail-google_msgid.tar.gz 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 <nowiki>|</nowiki> cut -d\  -f 2-<nowiki>|</nowiki> 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 [http://www.claws-mail.org/tools/claws-mail-fix_date.tar.gz 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.
+
|-
+
|
+
'''Change subject line'''
+
|
+
'''Remove [something]:''' echo %F | xargs -n 1 remove-deprecated-list.sh
+
|
+
I needed to remove '''[something]''' from some mailing list posts:
+
<pre>
+
#!/bin/bash
+
# $1 - file name
+
# preserve mtime
+
mtime=`stat -t -c "%y" "$1" | sed -e "s/[- ]//g" -e "s/://" -e "s/:/./" | cut -b 1-15`
+
echo Filtering file: "$1"
+
# filter with sed
+
sed -ie "s/^Subject: \(.*\)\[something\] /Subject: \1/" "$1"
+
# restore mtime
+
touch -m -t "$mtime" "$1"
+
</pre>
+
|}
+
 
+
<div id="uudec">The '''uudec''' script can be found [http://www.claws-mail.org/tools/claws-mail-uudec.tar.gz 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.</div>
+
 
+
<div id="uuooffice">The '''uuooffice''' script can be found [http://www.claws-mail.org/tools/claws-mail-uuooffice.tar.gz 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.</div>
+
 
+
<div id="tnef-claws">The '''tnef-claws''' bash script was written by Shawn Lamson and is to be found [http://melvin.hadasht.free.fr/home/sylpheed/actions/tnef-claws here]. The script is well commented. You need to have the [http://sourceforge.net/projects/tnef/ tnef] package already installed.</div>
+

Revision as of 15:33, 1 October 2012

Do you require a brand-new paper cutter and trimmer paper cutter for your school or place of work? If so, you are going to need to understand how to select the best trimmer for your demands. Here is just what you have to do:

Check into the cutting capacity. The trimmer's cutting capacity is absolutely something you need to be aware of. The cutting capacity will definitely depend on the sort of cutter. For instance, a rotating trimmer can usually just trim a couple of sheets at a time while a stack cutter can easily process hundreds of sheets immediately. You ought to pick a cutter that can cut a great amount of sheets at once.

Do you need to cut cardstock? If you're planning on using cardstock or additional thicker kinds of paper, you will definitely want to make certain that your cutter can handle it. A guillotine cutter is a terrific choice if you desire to be able to deal with different stocks.

Consider just how the machine is constructed. Because you're most likely going to be utilizing your new cutter a whole lot, you need to pick one that is durably built. If a trimmer features wooden and steel parts, you can easily depend on it being durable enough for regular usage. While cutters with a great deal of plastic parts can easily be more economical, they're just not as long lasting. You might end up needing to replace it quicker than you would like.

Make sure the cutter is safe to use. Whether you pick a rotary trimmer, guillotine cutter, or stack cutter, there's no doubt about it: these tools can easily be harmful, especially if they're made use of inappropriately. Hence, you'll need to make certain the cutter has really good safety . Some attributes to seek include a finger guard and blade latch (for guillotine cutters). Numerous rotating trimmers have blades that are framed in housing to keep your fingers safe. And a ton of pile cutters need two-handed operation. Several of the more sophisticated trimmers have optical eyes that can easily locate when your hands are too close to the blade. If this occurs, the cutter will not work. Also, no matter what safety features your cutter has, you need to exercise caution when using it. Children should additionally be carefully monitored if you want your students to make use of the cutter. Whatever you do, be careful!

Think about brand. A whole lot of business produce paper cutters and you may even recognize some of the names such as GBC, Swingline, and Fellowes. Lesser known names consist of Dahle, Premier, and Foster Keencut. All of these business make fantastic cutters that are worth looking into and many of the trimmers have great guarantees.

Stick to your budget. Finally, there are really good paper cutters accessible at every rate point. Stick to your finances so you can easily get the cutter you require without breaking the bank.

Choosing the ideal paper cutter doesn't need to be challenging. Given there are an amount of things you need to take into consideration and you require to inspect your potential gadget to ensure it's ideal for you, but it's very easy. Begin looking for your paper shredder today.