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