![]() |
I am running hylafax-5.2.2-2 on CentOS 5.1. I created an entry in /etc/postfix/virtual, modified DNS records and added mail2fax.sh redirecting in /etc/aliases. This system works fine in general.
However, I have some problems and couldn't find an answer in the archive.
1. I think, plain text written in the body of the email (no html) is converted to ps using 8859-1 character code set. Some non-english characters come up corrupted in the fax. How can I change this default encoding?
2. html2ps (perl version) is also limited in terms of encoding. I would like to use html2ps (php version). It supports broad range encodings. However, I don't understand how it can be run from a mime converter script. What is the proper way of calling html2ps (php version) from "html" mime script?
#! /bin/sh /usr/local/bin/html2ps $1 exit
--- hylafax.orig/faxmail/faxmail.c++ 2008-03-12 06:07:18.000000000 -0700 +++ hylafax/faxmail/faxmail.c++ 2008-03-26 04:38:00.111258728 -0700 @@ -434,8 +434,38 @@ if (mime.parse(msg, emsg)) { if (verbose) mime.trace(stderr); - // XXX anything but us-ascii is treated as ISO-8859-1 - setISO8859(mime.getCharset() != CS_USASCII); + /* + * In theory each MIME part could be in a different + * character set, and each text mail header (such as + * the subject header) could also be in multiple + * character sets. Supporting this would probably + * require faxmail to scan the entire mail beforehand + * to add the requisite font definitions early in + * the Postscript output... which isn't how faxmail + * does things right now. + * + * Fortunately, the likelihood of a mail being written + * in more than one character set (not including ASCII) + * would be extremely rare and quite possibly only in + * contrived scenarios. So for now we just apply a single + * character set to the entire mail message. + * + * In the past we did this: + * + * setISO8859(mime.getCharset() != CS_USASCII); + * + * However, this makes it impossible for RFC-2047-encoded + * subject lines to show properly, as well as any + * subsequent non-ASCII mail parts. + * + * Eventually it may be best to have the character set + * be selected by a command-line argument, however, since + * TextFormat.c++ only supports ISO-8859-1 at the moment + * there is no point. And since ASCII is completely + * covered by ISO-8859-1 there is no reason to prefer + * ASCII over ISO-8859-1. + */ + setISO8859(true); /* * Check first for any external script/command to