README.sylprint 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. NAME
  2. sylprint.pl - process a Sylpheed mail and print it using
  3. enscript if available (or lpr if not)
  4. SYNTAX
  5. sylprint.pl '%s' [-r] [options]
  6. DESCRIPTION
  7. Sylprint is a perl script for printing mails from Sylpheed
  8. mailer. Syntax given is appropiate (and designed) for usage
  9. in the "Printing" box of Sylpheed that appears when going
  10. Configuration->Common Preferences menu, Other tab.
  11. Sylprint translates the english header names given by
  12. Sylpheed into the local language if available. Also wraps
  13. long lines without breaking words, and indents headers, all
  14. in order to make a nicer and easier to read hardcopy.
  15. There are other programs that produce a nicer hardcopy,
  16. for example muttprint, but you pay the price of requiring
  17. LaTeX installed for the job. Sylprint tries to do it nice,
  18. but no so nice and also lowering resources required.
  19. It also has a GTK interface (in development) if you don't
  20. want to remember all those flags. The interface is only that,
  21. an interface, thus isn't required at all for running
  22. sylprint script, but while an experienced user may prefer
  23. to use the script straightforward, a beginner may feel more
  24. comfortable with a "printing panel"-like window.
  25. OPTIONS
  26. Options may be specfied in any order, but separated (i.e.: a
  27. valid specification is "-e -h" while "-eh" is not).
  28. All the options except -p and -v have the purpose of changing
  29. or disabling something that is done by default, so if you like
  30. the default output all may be totally useless. But not always.
  31. Options are:
  32. -e Do not use enscript at all (even if available).
  33. -f font
  34. Use font for printing mail. Font specification style
  35. is name[@{size|width/height}] (examples: 'Times',
  36. 'Times@12', 'Times@8/10').
  37. Font syntax correctness is checked, but availability
  38. of the font on the system is not checked.
  39. Default font is 'Courier@9/13'.
  40. -h Do not print page header. Page header includes date
  41. and page numbering and is generated by enscript.
  42. -p printer
  43. Use printer for printing (default is 'lp'). Printer
  44. is not checked at all, so must be a valid printer
  45. name within your system.
  46. -r Do not parse user configuration file (sylprint.rc).
  47. This must be the first option after filename if used.
  48. -s [char]
  49. Do not print separator line between headers and body
  50. unless char is specified, then set char as separator
  51. character in place of default one (underscore).
  52. -t Do not translate mail headers.
  53. -v Preview mail before printing. Preview is done using
  54. gv for enscript processed mails and gless for non
  55. processed ones.
  56. You can specify this option twice to avoid printing
  57. at all, in case you only want a preview.
  58. -w [number]
  59. If no number is given, disables line wrapping in
  60. mail text, else sets the column for wrapping to
  61. number instead of 79, which is the default value.
  62. -H Do not print mail headers (From, To, etc.). This also
  63. disables separator line printing.
  64. -Q [quote chars]
  65. Do not print quoted text (usually introduced by '>').
  66. You may supply the character or characters that lead
  67. the quoted text. These character(s) must be the first
  68. on a line to be interpreted as quoted.
  69. Remember to escape them from shell enclosed in single
  70. quotes ('|' for example) if required.
  71. -S Do not print mail signature (mail signatures started
  72. with -- and carriage return).
  73. -- Finish option parsing. All the options specified after
  74. this are passed unmodified to enscript or lpr.
  75. DIAGNOSTICS
  76. "required filename missing"
  77. No arguments were provided to the script, at least
  78. one, the filename with the mail to be printed, is
  79. required. See SYNTAX.
  80. "invalid font"
  81. The parameter of -f option does not match a valid
  82. font specification. See OPTIONS or enscript manpage.
  83. "invalid number"
  84. The parameter of -w option must be a decimal number
  85. without sign. See SYNTAX.
  86. "/usr/bin/lpr not found"
  87. The line printer command couldn't be stated. Be sure
  88. you have it installed where you configured, and if
  89. file permissions allow you to execute it.
  90. In some systems access to printer(s) is restricted.
  91. "trying lpr: error message"
  92. The lpr command failed by some reason, luckily by the
  93. stated in error message.
  94. "/usr/bin/enscript not found, using lpr"
  95. Enscript can't be found there, be sure it's installed
  96. and you set the right path in the config.
  97. As fallback, mail is printed using (ugly) lpr.
  98. "charset not supported by enscript: using lpr"
  99. Enscript doesn't (actually) support:
  100. * euc-jp (Japanese)
  101. * euc-kr (Korean)
  102. * iso-8859-9 (Turkish)
  103. * gb2312, big5 (Chinese)
  104. charset encodings, so only lpr can be used with them.
  105. ENVIRONMENT
  106. LANG If defined is used to guess the language that should
  107. be tried for translating and the charset encoding.
  108. HOME For getting Sylpheed user's config directory.
  109. USER For building temp files.
  110. FILES
  111. sylprint.pl
  112. The script itself.
  113. sylprint.rc
  114. Stores user default preferred configuration for the
  115. script. Settings in this file may be overriden by
  116. command line options. Must be stored in the same
  117. directory of the script and/or in the ~/.sylpheed-claws
  118. one (Sylpheed user's configuration directory).
  119. /tmp/sylprint.username.number
  120. Temporary files created to store a processed mail.
  121. Username is the login name of the user invoking the
  122. sylprint script and number is the PID of the script
  123. process itself.
  124. These files are actually deleted unless something went
  125. really wrong.
  126. /tmp/sylprint.username.number.ps
  127. Same as the former, used to store PostScript preview
  128. of mail if preview is enabled.
  129. SEE ALSO
  130. Sylpheed: http://sylpheed.good-day.net
  131. Sylpheed Claws: http://sylpheed-claws.sourceforge.net
  132. Enscript: http://www.iki.fi/~mtr/genscript/
  133. Muttprint: http://bwalle.exit.mytoday.de/muttprint/
  134. Sylprint: http://www.aic.uniovi.es/mones/sylprint/
  135. enscript(1), lpr(1), gv(1)
  136. LIMITATIONS
  137. Supported languages are only those supported by Sylpheed.
  138. Supported encodings are only those supported by enscript.
  139. Charset encodings not supported by enscript are printed via
  140. lpr.
  141. There are languages partially translated, mainly because
  142. the strings lack of translation in the po files or I was
  143. unable to guess a correct one from them.
  144. Currently Greek is the only language in this category.
  145. BUGS
  146. There is no enough command line options to set all config
  147. variables. This is not really a bug, because is intentional,
  148. only most common/useful features have an option. The rest
  149. can be set on the rc file.
  150. Diagnostic messages should be nicer and more informative.
  151. If you use a proportional font for printing mail with
  152. enscript, all the header's alignment and long line wrapping
  153. may be (and almost surely be) lost.
  154. AUTHOR
  155. The original author is Ricardo Mones Lastra, but much more
  156. people have, indirectly, contributed to this by providing
  157. Sylpheed translations, here used again:
  158. Alfons Hoogervorst; Andreas Hinz; Ante Karamatiæ;
  159. Danilo Bodei; Dmitry S. Sivachenko; Fabio Junior
  160. Beneditto; Frank J. J. Weng; Görkem Çetin; Gustavo
  161. Noronha Silva; Hiroyuki Yamamoto; Jens Oberender;
  162. Joakim Andreasson; Martin Schaaf; Melvin Hadasht;
  163. Michalis Kabrianis; Paul Rolland; Peeter Vois;
  164. Przemyslaw Sulek; Sergey Vlasov; Székely Krisztián;
  165. Vincent van Adrighem; Vladimír Marek; Xiangxin Luo.
  166. (Obtained from "Last-Translator" field on current po files)
  167. LICENSE
  168. Sylprint script, config files and documentation.
  169. (c) 2001 by Ricardo Mones Lastra <mones@aic.uniovi.es>.
  170. This program is free software; you can redistribute it and/or
  171. modify it under the terms of the GNU General Public License
  172. as published by the Free Software Foundation; either version 2
  173. of the License, or (at your option) any later version.
  174. This program is distributed in the hope that it will be useful,
  175. but WITHOUT ANY WARRANTY; without even the implied warranty of
  176. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  177. GNU General Public License for more details.
  178. You should have received a copy of the GNU General Public
  179. License along with this program; if not, write to the Free
  180. Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  181. MA 02111-1307, USA.