2007-08-02 [paul] 2.10.0cvs84
[claws.git] / tools / README
1
2 --------------------------------------------------------------------------------
3 Contents of the tools directory:
4 --------------------------------------------------------------------------------
5
6 Action scripts:
7   freshmeat_search.pl           Search freshmeat.net for selected text
8   google_msgid.pl               Search groups.google.com for selected message-id
9   google_search.pl              Search google.com for selected text
10   multiwebsearch.pl             Search any search engine for the selected text
11   textviewer.sh                 Attempt to view an attachment as plain text
12   uudec                         Decode and display uuencoded images
13   uuooffice                     Decode uuencoded attachments and open them with
14                                 OpenOffice
15
16 Addressbook conversion:
17   eud2gc.py                     Convert Eudora address book to Gnomecard
18   kmail2claws-mail.pl           Import a Kmail address book (KDE2)
19   kmail2claws-mail_v2.pl        Import a Kmail address book (KDE3)
20   outlook2claws-mail.pl         Import an Outlook generated contact list
21   tb2claws-mail                 Import The Bat! address books
22   vcard2xml.py                  Import an Evolution vCard
23
24 Mailbox conversion:
25   calypso_convert.pl            Import mbox files with attachments from Calypso
26   convert_mbox.pl               Import mbox files
27   kmail-mailbox2claws-mail.pl   Convert a kmail mailbox to a Claws Mail mailbox
28   tbird2claws.py                Integrate a Thunderbird folder tree into Claws
29
30 Other tools:
31   acroread2claws-mail.pl        Send PDFs from Adobe Reader 7
32   claws-mail-compose-insert-files.pl
33                                 Insert files into a new Compose window
34   filter_conv_new.pl            Convert new-style Sylpheed filters to filtering
35   filter_conv.pl                Convert old-style Sylpheed filters to filtering
36   fix-date.sh                   Replace/Add a message's Date field
37   mairix.sh                     A wrapper to mairix, to enable global searches in
38                                                         mail folders
39   nautilus2claws-mail.sh        Send files from Nautilus
40   OOo2claws-mail.pl             Send documents from OpenOffice.org
41   sylprint.pl                   Printing engine, explained in README.sylprint
42   textviewer.pl                 Display various attachments as text
43   thunderbird-filters-convertor.pl
44                                 Convert Thunderbird filtering rules
45
46 Extra tools:
47   gif2xface.pl                  Convert a 48x48 GIF file to an X-Face header
48   update-po                     Update the .po files named on the command line.
49
50 --------------------------------------------------------------------------------
51 Detailed Descriptions:
52 --------------------------------------------------------------------------------
53
54 Action scripts
55 --------------
56
57 * freshmeat_search.pl
58   WORKS ON: selection
59   COMMAND: |freshmeat_search.pl
60   Search freshmeat.net for selected text using the default Claws Mail browser
61
62 * google_msgid.pl
63   WORKS ON: selection
64   COMMAND: |google_msgid.pl
65   Lookup selected message-id in google using mozilla. Edit the script to use
66   different browsers.
67
68 * google_search.pl
69   WORKS ON: selection
70   COMMAND: |google_search.pl
71   Search google.com for selected text using the default Claws Mail browser
72
73 * multiwebsearch.pl
74   WORKS ON: selection
75   see further down for details
76
77 * textviewer.sh
78   WORKS ON: current message part
79   COMMAND: textviewer.sh %p |
80   Attempt to view an attachment as plain text
81
82 * uudec
83   WORKS ON: current message (or part of multipart message)
84   COMMAND: uudec %f&
85   Decode and display uuencoded images using uudecode.
86
87 * uuooffice
88   WORKS ON: current message (or part of multipart message)
89   COMMAND: uuooffice %f&
90   Decode uuencoded attachments and open them with OpenOffice
91
92 * More action examples can be found at the Claws Mail FAQ
93   http://www.claws-mail.org/faq/index.php/Actions
94
95 ** multiwebsearch.pl **
96
97   WHAT IT DOES
98         This is an Actions script that allows you to search
99         websites for the selected text. It uses the default
100         Claws Mail browser as configured through Claws Mail's 
101         GUI and specified in ~/.claws-mail/clawsrc, and a
102         configuration file called multiwebsearch.conf.
103         
104   CONFIGURATION
105         The configuration file takes the following format:
106         
107         ALIAS|URL PART|URL PART
108         
109         ALIAS is a user-defined name; the first URL PART is the
110         url before the search term; the second URL PART is
111         optional and contains the remaining part of the url which
112         comes after the search term. A sample configuration file
113         is included.
114         
115   HOW TO USE IT
116         Copy 'multiwebsearch.conf' to ~/.claws-mail/
117         
118         Configure an Action:
119         a) pre-configured website 
120            Command: multiwebsearch.pl --where="google" --what="%s"
121         b) dynamic
122            Command: multiwebsearch.pl --where="%u" --what="%s"
123            
124         In type a) "google" refers to one of the configured aliases,
125         this Action will always search the website referred to by
126         the alias "google".
127         
128         In type b) you will be presented with a dialog box into
129         which you type one of your configured aliases
130
131   
132   Contact: Paul Mangan <paul@claws-mail.org>
133 --------------------------------------------------------------------------------
134
135 Address book conversion
136 -----------------------
137
138 * eud2gc.py
139
140   WHAT IT DOES
141         This python-script is a quick hack to convert an Eudora (v.3?)
142         addressbook to vCard (GnomeCard) format.
143
144   HOW TO USE IT
145         You may do whatever you want with it! (Also regarding copying)
146         However, the script is intended to use like this:
147
148                 eud2gc.py <Eudora-addressbook-file> <Gnomecard-file>
149
150         Be careful not to overwrite your original GnomeCard.gcrd!
151         (But of course you might want to add the converted stuff to it)
152
153   Contact: Jeroen Versteeg <j.m.versteeg@student.utwente.nl>
154
155 * kmail2claws-mail.pl
156
157   WHAT IT DOES
158         This perl script will convert an exported Kmail addressbook into a
159         Claws Mail addressbook. If your version of Kmail is 1.37 or
160         greater and/or your version of KAddressBook is 3.1beta1 or greater,
161         or this script mixes up your definitions and their related data, use
162         'kmail2claws-mail_v2.pl' instead.
163
164   HOW TO USE IT
165         (You must run claws-mail at least once before running this script.)
166
167         In Kmail's Address book choose '/File/Export List'. This will export
168         your Kmail address book data to a *.csv file.
169
170         If Claws Mail is running, close it.
171
172         From the command line, execute the following:
173  
174                 perl kmail2claws-mail.pl --kmailfile=/path/to/addressbook.csv
175
176         Your Kmail address book data will now be contained in Claws Mail'
177         address book, under the name 'Kmail Address Book'.
178
179   Contact: Paul Mangan <paul@claws-mail.org>
180     
181
182 * kmail2claws-mail_v2.pl
183
184   This script has been tested with Kmail 1.4.7 and KAddressBook 3.1beta1
185
186   WHAT IT DOES
187         This perl script will convert a Kmail address book that has been
188         exported in csv format into a Claws Mail address book.
189
190   HOW TO USE IT
191         (You must run claws-mail at least once before running this script.)
192   
193         Open Kmail's Addressbook, /File/Address Book
194         In Kmail's Addressbook choose '/File/Export/Export List...'. This 
195         will allow you to export your Kmail addressbook data to a *.csv file.
196
197         If Claws Mail is running, close it.
198
199         From the command line, execute the following:
200  
201                 perl kmail2claws-mail_v2.pl --kmailfile=/path/to/addressbook.csv
202         
203         You can also use --help to see usage instructions.
204
205         Your Kmail addressbook data will now be contained in Claws Mail'
206         addressbook, under the name 'Kmail address book'.
207
208   Contact: Paul Mangan <paul@claws-mail.org>
209
210
211 * outlook2claws-mail.pl
212
213   WHAT IT DOES
214         This perl script converts an Outlook generated contact list into a 
215         Claws Mail XML address book.
216
217   HOW TO USE IT
218         For text files:
219         --------------
220         You must export Outlook Express contact list as TXT file, choosing
221         only "Name" and "Address" fields to export.
222
223         You must exit Claws Mail before converting the contact list.
224
225         From the command line, execute the following:
226
227                 outlook2claws-mail.pl fullpathname
228
229         For csv files:
230         -------------
231         You must export Outlook contact list as CSV file, choosing ALL the
232         fields available for exporting.
233
234         You must exit Claws Mail before converting the contact list.
235
236         From the command line, execute the following:
237
238                 outlook2claws-mail.pl --csv fullpathname
239
240   LIMITATIONS
241         For text files only works with fields described above. If you have 
242         more complex examples send them to me, and I'll try to enhance the 
243         script.
244
245         For csv files you must export all fields (but only non empty fields
246         are added to the created Claws Mail address book) and the number
247         of fields expected is harcoded. Look for the $nboffields variable in
248         the script and change its value if you are sure you exported all
249         fields and script gives the 'unknown csv file format' error.
250
251   Contact: Ricardo Mones Lastra <mones@aic.uniovi.es>
252
253
254 * tb2claws-mail
255
256   WHAT IT DOES
257         This perl script will convert an address book exported from The Bat! 
258         into a Claws Mail address book.
259
260   HOW TO USE IT
261         (You must run claws-mail at least once before running this script.)
262
263         If Claws Mail is running, close it.
264
265         Export The Bat! Address Book to CSV file format with all fields 
266         selected to YES and then start:
267
268                 tb2claws-mail --tbfile=/full/path/to/thebat/addressbook.csv
269  
270         The Bat! addressbook data will now be contained in Claws Mail'
271         addressbook, under the name 'The Bat! Address Book'.
272
273   Contact: Urke MMI <urke@gmx.net>  
274
275
276 * vcard2xml.py
277
278   WHAT IT DOES
279         This python script will convert an Evolution vCard into a Claws Mail
280         address book.
281
282   HOW TO USE IT
283         (You must run claws-mail at least once before running this script.)
284
285         If Claws Mail is running, close it.
286         From the command line, execute the following:
287
288                 vcard2xml.py source_file [destination_file]
289  
290         When only <source_file> is specified it will overwrite (and
291         create a backup of) the existing addressbook. 
292         When both arguments are suplied it will create a new additional 
293         addressbook named as <destination_file>.
294         If the script encounters an error it will attempt to roll back
295         the changes and restore the original files.
296
297   Contact: Bogdan Sumanariu <bsumanariu@one5.ro> 
298
299 --------------------------------------------------------------------------------
300
301 Mailbox conversion
302 ------------------
303
304 * calypso_convert.pl
305
306   WHAT IT DOES
307         This perl script imports mbox files that are exported by Calypso.
308         It recreates the folder structure by scanning the "X-CalypsoFolder"
309         header and reincludes the attachments referenced in the
310         "X-CalypsoHtmlBody" "X-CalypsoAccount" "X-Attachment" headers.
311   
312   HOW TO USE IT
313         Export the Calypso mailbox by selecting "Save to archive" and check
314         the "Save attachments" box.
315         
316         Edit the script to set following variables (at the top of the file):
317            $mboxdir  : path to the exported mbox, e.g. 'Archive' or '.'
318            $mboxfile : name of exported mbox, e.g. 'mail.txt'
319            $outdir   : name of the MH folder to create, e.g. 'Calypso'
320            
321          Run the script using
322          
323                 perl calypso_convert.pl
324                 
325         Finally, import that folder by either selecting "New mailbox" or
326         moving it into your existing directory and recreate the folder
327         structure manually (contentmenu from folderview).
328
329   Contact: Thorsten Maerz <torte@netztorte.de>
330
331 * convert_mbox.pl
332
333   WHAT IT DOES
334         This perl script converts an mbox directory's contents into 
335         Claws Mail' MH format.
336   
337   HOW TO USE IT
338   
339         Run the script using:
340          
341                 perl convert_mbox.pl MBOX MH_DIR
342                 
343         Move the outputted MH_DIR and its contents into your Claws Mail
344         Mail folder; in Claws Mail right-click the top-level folder and
345         choose 'Rebuild folder tree' from the popup menu.
346
347   Contact: Fred Marton <Fred.Marton@uni-bayreuth.de>
348
349 * kmail-mailbox2claws-mail.pl
350
351   WHAT IT DOES
352         This perl script converts a kmail mailbox  into Claws Mail' mailbox.
353   
354   HOW TO USE IT
355   
356         Exit Claws Mail if running.
357         
358         Run the script using:
359          
360                 kmail-mailbox2claws-mail.pl --kmaildir=/full/path/to/kmail/mailbox
361                 
362         Start Claws Mail and right-click the toplevel mailbox, i.e
363         "Mailbox (MH)", and select 'Rebuild folder tree'.
364         You may also need to run '/File/Folder/Check for new messages
365         in all folders'
366         
367         Additional options:
368                 --debug         debug mode
369                 --dry-run       test mode, nothing is actually written
370                 --help          brief usage info
371         
372   Contact: Paul Mangan <paul@claws-mail.org>
373
374 * tbird2claws.py
375
376   WHAT IT DOES
377         This python script integrates a Thunderbird folder tree into 
378         Claws Mail.
379   
380   HOW TO USE IT
381   
382         The script receives two parameters from command-line:
383         <Thunderbird folder path> <Claws Mail folder path>
384
385         The best way to use it is to go to inside your Thunderbird
386         root mailfolder directory and invoke it as:
387
388                 <path>\python2.4 <path>\tbird2claws.py . <path to Claws Mail>\Mail
389
390   Contact: Aleksandar Urosevic aka Urke MMI <urke@gmx.net>
391
392 --------------------------------------------------------------------------------
393
394 Other tools
395 -----------
396
397 * acroread2claws-mail.pl
398
399   WHAT IT DOES
400         This perl script enables Adobe Reader 7 to send documents to
401         Claws Mail as attachments.
402
403   HOW TO USE IT
404         Make sure that the script is executable (chmod +x acroread2claws-mail.pl)
405         Start up Adobe Reader 7 (acroread)
406         Go to /Edit/Preferences/SendMail
407         Select any email client except 'System Mail (mail)'
408         Enter the path to this script in the alternate location box  
409
410         You can then use 'File/Email' or the Email toolbar button to launch
411         claws-mail (if not already launched) and open a new compose window
412         with the PDF attached.
413   
414   Contact: Paul Mangan <paul@claws-mail.org>
415
416 * claws-mail-compose-insert-files.pl
417
418   WHAT IT DOES
419         This script enables inserting files into the message body of a new 
420         Claws Mail Compose window from the command line. Additionally To,
421         Cc, Subject and files to attach to the message can be specified. 
422
423   HOW TO USE IT
424         claws-mail-compose-insert-files.pl [options]
425         Options:
426                 --help -h
427                 --to mail@address.net[,mail2@address.net]
428                 --cc mail@address.net[,mail2@address.net]
429                 --subject "My subject"
430                 --attach FILE
431                 --insert FILE
432
433         --attach and --insert can be used multiple times
434   
435   Contact: Paul Mangan <paul@claws-mail.org>
436
437 * filter_conv_new.pl
438
439   WHAT IT DOES
440         This perl script provides easy conversion of your filtering rules from
441         sylpheed's new filter system (>= 0.9.99) to the filtering system used in
442         Claws Mail.
443         It reads '~/.sylpheed-2.0/filter.xml' or '~/.sylpheed/filter.xml' and
444         writes '~/[CLAWS CONFIG DIR]/matcherrc'
445   
446   HOW TO USE IT
447         Issue the following command from the 'tools' directory:
448
449         perl filter_conv_new.pl
450
451         That's it, the claws' filtering system is now implemented with your
452         previous rules applied.
453
454   REQUIREMENTS
455         XML::SimpleObject
456
457   Contact: Paul Mangan <paul@claws-mail.org>
458   
459
460 * filter_conv.pl
461
462   WHAT IT DOES
463         This perl script provides easy conversion of your filtering rules
464         from sylpheed's old filter system (< 0.9.99) to the filtering system
465         used in Claws Mail.
466         It reads '~/.sylpheed/filterrc' and writes '~/.claws-mail/matcherrc'
467   
468   HOW TO USE IT
469         Issue the following command from the 'tools' directory:
470
471         perl filter_conv.pl
472
473         That's it, the new filtering system is now implemented with your
474         previous rules applied.
475
476   Contact: Paul Mangan <paul@claws-mail.org>
477   
478
479 * fix-date.sh
480
481  WHAT IT DOES
482         It will replace the Date: value w/ the one picked up from
483         more recent Received: field if this field resides in one
484         line. Otherwise, it will take the file modification time
485         (using a RFC 2822-compliant form). If no X-Original-Date already
486         exist, the former Date value will be set in such field.
487
488   HOW TO USE IT
489         fix_date.sh <filename> [<filename>..]
490
491   Contact: wwp <wwp@claws-mail.org>
492
493
494 * mairix.sh
495
496  WHAT IT DOES
497         It's a wrapper to mairix, a tool that makes indexed searches
498         and shows search results in a virtual folder. Maildir, MH and
499         mbox formats are supported, see:
500         http://www.rpcurnow.force9.co.uk/mairix/
501
502   HOW TO USE IT
503         mairix.sh
504         mairix.sh <mairix rcfile> [<mairix options>..]
505     
506     For instance:    
507     mairix.sh ~/.mairixrc s:word1,word2
508
509   Contact: wwp <wwp@claws-mail.org>
510
511
512 * nautilus2claws-mail.sh
513
514   WHAT IT DOES
515         This script will recursively attach a number of selected 
516         files/directories from Nautilus to a new blank e-mail.
517
518   HOW TO USE IT
519         Copy the script to $HOME/.gnome2/nautilus-scripts, chmod u+x, 
520         and restart nautilus (killall -9 nautilus). You will now have 
521         a right-click menu item: '/Scripts/nautilus2claws-mail.sh'
522         
523   Contact: Reza Pakdel <hrpakdel@cpsc.ucalgary.ca>
524
525
526 * OOo2claws-mail.pl
527
528   WHAT IT DOES
529         This perl script enables OpenOffice.org to send documents to
530         Claws Mail as attachments.
531
532   HOW TO USE IT
533     OpenOffice.org Version 2.0
534     ----------------------------
535         This script is not needed for OOo version 2, which can work
536         directly with Claws Mail.
537         Go to 'Tools/Options/Internet/E-mail' and enter 'claws-mail'
538         in the box.
539
540     OpenOffice.org Version 1.1.0
541     ----------------------------
542         Start up OpenOffice.org.
543         Go to 'Tools/Options/OpenOffice.org/External Programs'
544         Select either ''Mozilla 1.x (Option 1)', or 
545         'Netscape 6.x - 7.0 (Option 1)' from the 'Program' selection
546         Enter the path to OOo2claws-mail.pl in the 'Path' box
547         or select it by clicking on the '...' button.
548     
549         You can then use 'File/Send/Document as email' to launch
550         claws-mail (if not already launched) and open a new compose
551         window with the document attached.
552
553     OpenOffice.org Version 1.0
554     --------------------------
555         Start up OpenOffice.org.
556         Go to 'Tools/Options/OpenOffice.org/External Programs'
557         Enter the path to OOo2claws-mail.pl in the 'Program' box
558         or select it by clicking on the '...' button.
559
560
561   Contact: Paul Mangan <paul@claws-mail.org>
562
563
564 * textviewer.pl
565
566   WHAT IT DOES
567         This script tries to recognise an attachment by using the 'file'
568         command and/or the file extension and then uses the available Linux
569         utilities to make an effort to display it as text. For example
570                 .doc                    antiword -w 72
571                 .txt, .diff, .c, .h,
572                   .ic. .ec, .cc, .sh,
573                   .sed, .awk            cat
574                 .html                   txt2htm or text2html
575                 .xls, .sxc, .csv        xlscat -L
576                 .rtf                    rtf2text
577                 .pdf                    pdf2text %f -
578                 .odt                    ooo2txt
579                 .pl, .pm                perltidy -st -se or  cat
580                 .bz2                    bzip2 -d < %f | strings
581
582   HOW TO USE IT
583         Go to /Configuration/Message View/External Programs and enter the
584         path to the script in the "Command for 'Display as text'" box.
585         Now when you right-click an attachment and choose 'Display as text'
586         this script will be invoked.
587
588         
589   Contact: H.Merijn Brand <h.m.brand@xs4all.nl>
590
591
592 * thunderbird-filters-convertor.pl
593
594   WHAT IT DOES
595         This perl script converts Thunderbird filtering rules into Claws Mail
596         filtering rules. It can be run several times, once for each filter
597         configuration file in Thunderbird.
598
599   HOW TO USE IT
600         The script takes 3 arguments:
601
602         --tbird-file=PATH TO FILE       The full path to the file to be converted
603         --mailbox-name=NAME             The name of the Claws Mail mailbox
604         --account-name=NAME             The name of the account to be used (optional)   
605
606         --tbird-file must point to the Thunderbird filter file (msgFilterRules.dat)
607         that you want to convert, it must contain the full path to the file.
608         --mailbox-name should be given the name of your mailbox in Claws Mail, e.g.
609         if the top-level folder is 'Mailbox (MH)' then this option should be
610         'Mailbox'.
611         --account-name is optional, only needed if you are creating account-specific
612         rules. This is the name of your account in Claws Mail, which should
613         correspond to an account that you had in Thunderbird, e.g. the acount whose
614         rules you are converting.
615
616         This script presumes that your folder hierarchy in Claws Mail matches the
617         one that you had in Thunderbird. If you used the tbird2claws.py script to
618         convert your Thunderbird mailbox, then the folder hierarchy should match.
619
620         If the Claws Mail filtering configuration file (matcherrc) does not exist,
621         the script will create it; if it does exist, the newly converted rules will
622         be appended to it.
623
624   REQUIREMENTS
625         Getopt::Long
626         URI::Escape
627
628   Contact: Paul Mangan <paul@claws-mail.org>
629
630 --------------------------------------------------------------------------------
631
632 Extra tools
633 -----------
634
635 * gif2xface.pl
636
637   WHAT IT DOES
638         This perl script converts a monochrome (1 bit) 48x48 pixels GIF file
639         into an X-Face graphic suitable for inclusion into custom headers of
640         Claws Mail. An X-Face allows to quickly identify (or be identified
641         as) the sender of a mail message in a xface-capable MUA (like Claws
642         Mail).
643
644   HOW TO USE IT
645         After obtaining the desired image for your X-Face you should:
646           * scale it to 48x48 pixels (Image->Scale image on Gimp)
647           * down color depth to b/w (Image->Mode->Indexed selecting "Use
648             Black/White palette" and the desired dithering options (prior to
649             indexing doing Image->Colors->Threshold allows you to select the
650             b/w level if you don't want a dithered (dotty) image))
651           * save file as non-interlaced GIF
652         Then do:
653
654                 ./gif2xface < filename.gif > filename.xface
655
656         In filename.xface will be the X-Face header ready to use.
657         You can add a custom header in Claws Mail through Configuration->
658         Preferences per account, "Send" tab, check "Add user-defined header"
659         then "Edit..." if you want to add it via the Claws Mail interface, or do
660
661                 echo "0:" `cat filename.xface` > ~/.claws-mail/customheaderrc
662
663         if you want to create the custom headers file yourself (Warning: this
664         method is valid only if you don't have any other custom header set or
665         they will be lost!).
666
667   Contact: Ricardo Mones Lastra <mones@aic.uniovi.es>
668
669
670 * update-po
671
672   WHAT IT DOES
673         This script is a message catalog translator's tool, it updates the .po 
674         files named on the command line.
675
676   HOW TO USE IT
677         This script needs to be copied to and run from the 'po' directory.
678   
679                 ./update-po lang.po lang2.po ...
680
681         to update one or more <yourlang>.po files from the sourcecode files
682          named in POTFILES.in. The old .po file is save in a .po.old file.
683
684         For example, when you want to update fr.po, run ./update-po fr.po, 
685         then edit fr.po to update your translation.
686
687   Contact: Wilbert Berendsen <wilbert@oswf.org> or the Claws Mail Team
688
689 --------------------------------------------------------------------------------