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