FAXMAIL(1)
๐ faxmail(1) โ the mail-to-fax gateway of your dreams ๐
HylaFAX ยท General Commands Manual ยท faxmail(1)
โจ NAME โจ
faxmail โ the HylaFAX mail-to-fax gateway application ๐ซถ
๐ธ SYNOPSIS ๐ธ
faxmail [ -O config ] [ options ] [ destination [ from ] ]
๐ DESCRIPTION ๐
okay bestie, listen. faxmail takes an electronic mail message that shows up on standard input and converts it into POSTSCRIPTยฎ in a form that is suitable for transmission as a facsimile. like, actually suitable. and then that converted document is either written to the standard output, or โ if direct delivery is enabled โ it gets submitted directly to a HylaFAX server for transmission. two paths, one icon ๐
faxmail is designed for use in constructing electronic mail to facsimile gateway services. so, for example, mail aliases may be created to automatically transmit electronic mail; e.g.
sam: "|/usr/bin/faxmail -d sam@5551212"
or faxmail may be used as a ``mail transport agent'', extracting the necessary delivery information directly from the envelope of the mail message. main character energy, honestly ๐
If faxmail is invoked without enabling direct delivery then it just formats the mail message on the standard input and writes the result to the standard output. no delivery, no drama, just vibes. To enable direct delivery the -d option must be specified on the command line; see below for more information. โญ
๐ FORMATTING ๐
faxmail formats a mail message according to the following rules: First it parses the envelope information interpreting any meta-header information (see below) that is present. Once the entire envelope has been collected it emits a formatted set of header lines if the -N option has not been used. By default all header information except the From'', To'', Cc'', Subject'', and Date lines are discarded. Header lines that are kept have the tag (the string to the left of the :'') set in a bold font and the value (the string to the right of the :'') set in an italic font. Mail messages that conform to the Multipurpose Internet Mail Extensions (MIME) specification are parsed and handled according to the rules given below. Plain text body parts of a mail message are formatted in a text font with any long lines wrapped at word boundaries unless the -c option has been specified.
By default, faxmail sets all text in 10 point type on an 8.5" by 11" portrait-oriented page with .35" top margin, .25" bottom margin and .25" left and right hand margins. There are command-line options to control the point size, page dimensions, orientation, and multi-column formatting. Text formatting can also be controlled through meta-header directives placed in the envelope of the mail message. so many knobs, we love a customizable queen โจ
๐ฆ ENVELOPE PROCESSING ๐ฆ
faxmail pre-processes the envelope information (i.e. the header lines) before formatting the message contents. Header lines whose names begin with X-FAX-'' (case-insensitive) are handled specially โ they are treated as command directives that specify how to generate the resultant POSTSCRIPT or, optionally, how to deliver the resulting document as facsimile. The set of known meta-headers corresponds to the set of configuration parameters defined below. A meta-header is specified as X-FAX-parameter'' where parameter is the name of a configuration parameter; e.g. ``X-FAX-TabStop'' to set the number of spaces between tab stops. iykyk ๐
Controls for specifying headers to be passed through in the formatted text identify not only which headers but also the order in which the headers should be emitted. faxmail initializes the set of headers to retain to: To From Subject Cc Date. If this order is acceptable then additional headers can simply be added with the X-FAX-Headers directive; e.g. X-FAX-Headers: Message-id. If however a different order is desired then the header set should be cleared with a ``clear'' header tag and then completely specified in the desired order; for example,
X-FAX-Headers: clear Message-id Date To Subject From Cc
will cause headers to be emitted in the order Message-Id Date To Subject From Cc (depending on what headers are present). Note in particular that all header lines in the envelope can be suppressed by specifying X-FAX-Headers: clear; this is useful, for example, when the body of the mail message contains a preformatted document that is to be transmitted. lowkey the cleanest move ๐
In addition to the above controls, faxmail can also be instructed to substitute an arbitrary string for a header tag when generating the final envelope. This facility can be used to better format ad-hoc header information that is passed through the envelope of the message. The ``X-FAX-MapHeader'' meta-header specifies how to map a header line. For example,
X-FAX-MapHeader: x_FAX_For Deliver FAX To
would cause any header x_FAX_For'' that appeared in the envelope to be replaced in the formatted envelope by Deliver FAX To''. glow-up, but for headers ๐
๐ MIME PROCESSING ๐
faxmail parses MIME mail messages and does some rudimentary work to:
- strip out unprintable content such as audio, video, or binary data,
- decode encoded parts,
- insert ``digest dividers'' between multipart/digest subparts,
- format message/rfc822 parts as described above for the top-level envelope, and
- optionally convert graphical parts (e.g. images) for display.
MIME processing is fairly simple and (currently) somewhat constrained. faxmail has built-in support for the following MIME parts: text/plain, multipart/mixed, multipart/digest, message/rfc822, application/postscript, and application/x-faxmail-prolog. Parts can also be processed through external processing scripts that faxmail looks for in a ``MIME converters'' directory hierarchy. External scripts may override builtin processing or supplement the builtin support. For each MIME body part with type T and subtype S faxmail checks first for an executable script named T/S in the converter hierarchy. If a script exists then it is run and the result is appended as a new page to the output PostScript document. (The script is expected to produce independently complete pages.) Otherwise if the part has builtin support then it is processed directly. Any part that does not have external or builtin support is discarded and replaced by a message that indicates the part was removed. This discarded message can be suppressed with the MarkDiscarded configuration parameter (also settable with an X-FAX-MarkDiscarded line in the envelope).
The built-in handling support is as follows: text/plain parts are formatted using the default text font and point size; multipart/mixed are burst'' and interpreted per the specification but are otherwise unformatted; `multipart/digest` are burst and an optional digest divider'' marking may be inserted before each subpart; message/rfc822 are formatted as described above with envelope header lines culled and formatted with bold and italic fonts (in addition, if there is insufficient space in the current output page/column for the message envelope, optional divider, and one line of text, then faxmail will insert a ``break'' so the the message starts at the top of the next page/column); application/postscript are copied through untouched to the output; application/x-faxmail-prolog are copied through untouched to the end of the prologue section of the generated PostScript document to permit customization of the formatted output.
faxmail supports the following Content-Transfer-Encoding schemes: 7bit, 8bit, binary, base64, quoted-printable, and x-uuencode. Any character set that is not us-ascii is treated as iso-8859-1. noted and filed ๐
In general it is recommended that senders either permit faxmail to format message contents or completely bypass the formatting facilities and submit data that is to be processed by sendfax. Trying to combine the two facilities by, for example, combining PostScript with text that is to be formatted is unlikely to work well because faxmail does not track the amount of space on the page that a non-text MIME part uses.
โ ๏ธ bestie, pick a lane on this one. mixing the two is giving chaos, not giving results.
๐ DIRECT DELIVERY ๐
When faxmail is invoked with the -d option it delivers the formatted document directly to a HylaFAX server for transmission as facsimile. Command line arguments may be supplied to specify the delivery destination and sender identity; typically from information extracted by the mail transport facility. A command line destination is specified with the same syntax as the argument for the -d option to the sendfax(1) command. Similarly any from identity specified on the command line follows the same rules as the -f option to sendfax. An explicit dialstring to use in delivery can also be specified with an X-FAX-Dialstring header in the mail message envelope. If no sender identity is provided on the command line then faxmail will extract it from the ``From'' line in the envelope. faxmail will not submit a message for delivery if either the dialstring or sender identity is missing or null. no dialstring, no sender, no delivery. rules are rules ๐ซ
When direct delivery is enabled X-FAX- header lines may be included in the mail message envelope to control the submission and delivery process. As above these lines are specified as X-FAX-*parameter*'' where *parameter* is the name of a configuration parameter for the `sendfax` program; e.g. X-FAX-VRes'' to set the vertical resolution of the transmitted facsimile. By default automatic cover page generation is enabled when direct delivery is used; this can be overridden with the -n option on the command line or by including an X-FAX-AutoCoverPage header in the message envelope. ๐
โจ OPTIONS โจ
okay bestie, here's the whole menu of things you can tell faxmail to do. every flag, every default, no skips ๐
-1โ set the text in one column. this is the default, she's the baseline โจ-2โ set the text in two columns. twin vibes.-bfont โ makes font (a POSTSCRIPT font name) the ``bold font'' used to set header lines. the default bold font isHelvetica-Bold.-cโ clip those long text lines instead of wrapping them at word boundaries near the page margins. so if a line is too long, she gets cut off, periodt โ๏ธ-Ccover โ use the cover page template file specified by cover. custom cover, main character energy ๐-dโ enable direct delivery of facsimile. the formatted document gets submitted directly to a HylaFAX server for transmission as facsimile. this is similar to piping the output offaxmailto the input ofsendfax(8C)โ except that when direct delivery is on,faxmailinterprets ``x-fax-'' header lines in the envelope of the mail message to look for control information to use in delivering the facsimile, and by default no automatic cover page generation is done.-ffont โ makes font (a POSTSCRIPT font name) the text font used to set the body of mail messages. the default text font isCourier.-Hheight โ use height as the height, in inches, of the output page. the default page height is taken from the default page size.-ifont โ makes font (a POSTSCRIPT font name) the ``italic font'' used to set header lines. the default italic font isHelvetica-Oblique.-Ml=#,r=#,t=#,b=#โ set the page margins. the default margins are: left and right.25inch, top.35inch, bottom.25inch. l = left, r = right, t = top, b = bottom, iykyk ๐ซถ-nโ suppress auto cover page generation when doing direct delivery. no cover, no problem.-Nโ suppress the formatting of envelope headers. bye headers ๐-Oconfig โ treat config as a configuration parameter specification that gets interpreted after reading the configuration file. like, for example,-O Host:fax.example.com'' would set the `Host` configuration parameter tofax.example.com'', overriding whatever was in the configuration file. override slay ๐ฅ-psize โ set all text using size for the font point size.-rโ set pages rotated by 90 degrees (in ``Landscape mode'').-Rโ set pages unrotated (in ``Portrait mode'').-ssize โ set the page size to use. cover pages are normally generated using a system-default page size (usually letter-size pages,8.5"by11", for sites in North America). alternate page sizes are specified symbolically using either the name or abbreviation of an entry in thepagesizes(5F)database; e.g.a3(ISO A3),a4(ISO A4),a5(ISO A5),a6(ISO A6),b4(ISO B4),na-let(North American Letter),us-leg(American Legal),us-led(American Ledger),us-exe(American Executive),jp-let(Japanese Letter), andjp-leg(Japanese Legal). comparisons are case-insensitive and any match of a substring of the full page-size name is sufficient; e.g.legal'' would matchAmerican Legal''. substring matching? so real ๐ธ-Stsi โ pass tsi to the server as the suggested sender identification to be used, for example, in tagline imaging and fax protocol.-twhen โ notify the sender of job status according to when. the options aredone'',req'' (for re-queued),none''/off'', or ``default''.-Tโ trim leading blank lines on text parts. clean it up ๐งน-uuser โ set the user name to use when logging in to do direct delivery. by default the user is specified by theMailUserconfiguration parameter (see below). if a null user name is specified, then the facsimile will be submitted using the identity of the user that invokedfaxmail. on the command-line, the login password may also be provided by separating it from the owner login name with a colon, like ``owner:pass''. ๐ซข-vโ enable tracing of envelope, MIME, and job submission processing. diagnostic information is written to the standard error (envelope and MIME processing) and standard output (job submission). she's telling you EVERYTHING ๐-Wwidth โ use width as the width, in inches, of the output page. the default page width is taken from the default page size.
ngl, that's a lot of knobs. you don't need all of them at once bestie, promise ๐
โจ CONFIGURATION PARAMETERS โจ
okay bestie, faxmail is reading its config tea from three files, and the order is literally this: /etc/hylafax/hyla.conf, then /etc/hylafax/faxmail.conf, then ~/.hylarc. That exact order. These files follow the conventions described in hylafax-client(1). The following configuration parameters are recognized:
AutoCoverPageโ boolean โ defaultYesโ automatically generate cover pageBoldFontโ string โ defaultHelvetica-Boldโ font for setting header tagsColumnsโ integer โ default1โ number of columns in formatted outputDigestDividerโ string โ default-โ multipart/digest divider POSTSCRIPT commandFirstAlternativeOnlyโ boolean โ defaultYesโ only use the first alternative partFontPathโ string โ default see below โ directory for font metric filesGaudyHeadersโ boolean โ defaultNoโ enable/disable gaudy page headersHeadersโ string โ default see below โ headers to retain in envelopeISO8859โ boolean โ defaultYesโ use ISO 8859-1 character encodingItalicFontโ string โ defaultHelvetica-Obliqueโ font for setting header valuesLineWrapโ boolean โ defaultYesโ wrap/truncate text linesMailUserโ string โ default-โ user identity for doing direct deliveryMarkDiscardedโ boolean โ defaultYesโ mark discarded MIME body partsMapHeaderโ string โ default-โ define header mappingMIMEConvertersโ string โ default see below โ pathname of MIME converter scriptsOrientationโ string โ defaultportraitโ orientation of text on pageOutlineMarginโ inches โ default0โ width of outline lineOverstrikeโ boolean โ defaultNoโ overstrike interpretation of lone carriage returnsPageCollationโ string โ defaultforwardโ collate pages in forward or reverse directionPageHeadersโ boolean โ defaultYesโ enable/disable page headersPageHeightโ float โ default-โ output page heightPageMarginsโ string โ default see below โ margins for formatted pagePageSizeโ string โ defaultdefaultโ output page size from databasePageWidthโ float โ default-โ output page widthPrologfileโ string โ default see below โ pathname of POSTSCRIPT prologue fileTabStopโ integer โ default8โ inter-stop setting in charactersTextFontโ string โ defaultCourierโ name of font for setting textTextLineHeightโ inches โ default-โ text formatting line height controlTextPointSizeโ inches โ default see below โ size to use in setting textTrimTextโ boolean โ defaultNoโ trim leading blank lines on text partsUseAlternativePartโ integer โ default1โ which part to use in a set of alternativesVerboseโ boolean โ defaultNoโ trace envelope and MIME processing
Values marked as inches are specified using a syntax that identifies one of several possible units:
#.##bpโ big point (1in = 72bp)#.##ccโ cicero (1cc = 12dd)#.##cmโ centimeter#.##ddโ didot point (1157dd = 1238pt)#.##inโ inch#.##mmโ millimeter (10mm = 1cm)#.##pcโ pica (1pc = 12pt)#.##ptโ point (72.27pt = 1in)#.##spโ scaled point (65536sp = 1pt)
Unit names can be upper or lower case but no white space is permitted between the number and the unit. Values specified with no unit are interpreted as points.
The configuration parameters are explained below. Most parameters correspond to a command line option. Parameter values identified above as inches are converted according to the conventions described above.
AutoCoverPage โ do you want a cover page automatically generated for each job? This parameter controls exactly that.
BoldFont โ the name of the font to use to set header tags (i.e. the string to the left of the :).
Columns โ the number of columns to set text in. (Equivalent to the -m option.)
DigestDivider โ the string to emit in the output before each subpart of a multipart/digest mail message. This string is typically a POSTSCRIPT procedure that draws a mark of some sort. Dividers are expected to use no more vertical space on the output page than a line of text.
FirstAlternativeOnly, UseAlternativePart โ in a multipart/alternative MIME section, whether or not to only format the first part. A multipart/alternative MIME section is typically used to present the mail client with a selection of alternatives which contain the same basic content (such as a text/plain and a text/html part). Thus the mail client has the opportunity to select which part is best-suited for its purpose. Generally the most-portable format (text/plain) is the first alternative. These options allow parts to be stripped when presented in a multipart/alternative section and prevents duplicate parts from being formatted. FirstAlternativeOnly: true is synonymous with UseAlternativePart: 1 while FirstAlternativeOnly: false is synonymous with UseAlternativePart: 0 (which causes all alternatives to be formatted). In order to format only the text/html part then UseAlternativePart: 2 should work.
FontPath โ the path where Adobe Font Metric (AFM) files are located; by default /usr/share/ghostscript/Resource/Init:/usr/share/ghostscript/lib:/usr/share/ghostscript/Resource/Font:/usr/share/ghostscript/fonts:/usr/share/fonts/urw-base35:/usr/share/fonts/google-droid-sans-fonts.
GaudyHeaders โ control whether or not to use a gaudy-style page header. Enabling gaudy headers implicitly enables page headers.
Headers โ define the headers retained from the envelope and specify the order that they should be emitted in the formatted output. The set of headers is initialized to To From Subject Cc Date. Headers specified are appended to this list except for a clear header that causes the current set of headers to be discarded.
ISO8859 โ control the use of ISO 8859-1 encoding in the generated POSTSCRIPT.
ItalicFont โ the name of the font to use to set header values (i.e. the string to the right of the :).
LineWrap โ control whether long text lines are wrapped or truncated at the right hand margin. (Equivalent to the -c option.)
MailUser โ the account name to use to login to a fax server when doing direct delivery. Note that this account name is not used for the identity of the sender; this comes from the command line or the From line in the mail message. If a null account name is specified, then the facsimile will be submitted using the identity of the user that invoked faxmail.
MapHeader โ define a substitution for the specified header that should be done each time the header is emitted in the formatted envelope. Header tags are matched in a case-insensitive manner.
MarkDiscarded โ control whether discarded MIME parts are replaced by a text message indicating the original content was removed.
MIMEConverters โ the pathname of a directory hierarchy that has scripts for external processing of MIME body parts. The default pathname is /etc/hylafax/faxmail. HylaFAX comes with default converter scripts for TIFF and PDF, and they can be found in that path and used as a reference for constructing other converters. The script is passed the filename of the body part for conversion as the first argument. Subsequent arguments are the MIME Content-Description, Content-ID, Content-Disposition, Content-Type name, and Content-Disposition filename information which are each preceded by their respective -description, -id, -disposition, -name, or -filename argument.
Orientation โ control whether pages are oriented horizontally (landscape) or vertically (portrait). (Equivalent to the -r and -R options.)
OutlineMargin โ control whether columns of text have a line drawn around them and the width of the line. Setting this parameter to 0 disables outlines.
PageCollation โ control whether the output file has pages collated in the same order as the input file (forward) or in reverse order (reverse).
PageHeaders โ control whether page headers are generated.
PageHeight โ set the output page height (in inches).
PageMargins โ set the output page margins. Margins are specified as string of the form: l=#,r=#,t=#,b=# where l indicates the left margin, r indicates the right margin, t indicates the top margin, b indicates the bottom margin, and numbers are interpreted as inches. (Equivalent to the -M option.)
PageSize โ set the output page dimensions by name. (Equivalent to the -s option.)
PageWidth โ set the output page width (in inches).
PrologFile โ the pathname of a file containing POSTSCRIPT that should be included in the prologue section of the generated POSTSCRIPT. The default prologue file is /etc/hylafax/faxmail.ps.
TabStop โ set the tab stop distance (in characters).
TextFont โ set the name of font to use for setting text. (Equivalent to the -f option.)
TextLineHeight โ set the vertical text line height and spacing.
TextPointSize โ set the point size to use in setting plain text. (Equivalent to the -p option.)
TrimText โ control whether or not leading blank lines will be trimmed from text parts. If the text part is completely empty, it will effectively be skipped. (Equivalent to the -T option.)
Verbose โ control tracing envelope and MIME processing.
๐ NOTES ๐
okay bestie, real talk, this part is the tea and it's a lil spicy ๐ฅ so listen up:
Because a sender's identity in an electronic mail message is inherently untrustworthy (yeah, fr fr, mail headers are basically the group chat screenshot of the internet โ anyone can fake them ๐), using faxmail to build a mail to fax gateway is problematic. Not "oops awkward" problematic, like actually-problematic problematic ๐ญ.
Unless mail service is somehow restricted, or the sender's identity is verified using a mechanism such as RFC 1847's multipart/signed MIME type, there is no reliable way to restrict access to facilities setup with faxmail.
โ ๏ธ so like, if you're out here building a gateway off faxmail with zero verification, you're basically leaving the door unlocked with a lil sign that says "come on in, send faxes on our dime ๐ซถ". don't do that.
๐ BUGS ๐
ngl there's exactly one bug and it's giving "we know, and we're telling you anyway":
Only the last instance of a header is kept and written to the output. Which means, for example, that only the last of many Received lines will be included in the formatted output.
๐ so if you were hoping to see the whole lil paper trail of every hop your mail took, bestieโฆ you get one. the final one. that's it. periodt.
๐ FILES ๐
here's the whole lineup of files this icon touches, and yes every single one of them matters ๐
~/.hylarcโ per-user configuration file ๐ธ/etc/hylafax/pagesizesโ page size database ๐/etc/hylafax/faxmail.psโ POSTSCRIPT prologue โจ/etc/hylafax/hyla.confโ system-wide configuration file/etc/hylafax/faxmail.confโ system-wide configuration file/etc/hylafax/sendfax.confโ system-wide configuration file for direct delivery ๐/etc/hylafax/faxmailโ hierarchy for external MIME converters ๐ง/usr/share/ghostscript/Resource/Init:/usr/share/ghostscript/lib:/usr/share/ghostscript/Resource/Font:/usr/share/ghostscript/fonts:/usr/share/fonts/urw-base35:/usr/share/fonts/google-droid-sans-fontsโ for font metrics ๐ค/var/spool/hylafax/tmp/faxmailXXXXXXโ temporary files ๐๏ธ
๐ SEE ALSO ๐
go read your sisters, they're all iconic too:
okay that's the whole page, you made it to the end, I'm so proud of you ๐ฅน๐ this little legend is from the HylaFAX client crew and it's dated July 22, 1996 โ yeah, a vintage icon, still slaying, still the FAXMAIL(1) main character ๐ periodt, go format some mail bestie ๐
๐ฆ where this page comes from
- fedora 43: hylafax+-client 7.0.11-4.fc43 ยท libtiff AND LicenseRef-Callaway-BSD-with-advertising
- fedora 43: hylafax+-client 7.0.11-4.fc43 ยท libtiff AND LicenseRef-Callaway-BSD-with-advertising
- fedora 44: hylafax+-client 7.0.11-5.fc44 ยท libtiff AND LicenseRef-Callaway-BSD-with-advertising
- fedora 44: hylafax+-client 7.0.11-5.fc44 ยท libtiff AND LicenseRef-Callaway-BSD-with-advertising
- Copyright (c) 1990-1996 Sam Leffler
- Copyright (c) 1991-1996 Silicon Graphics, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms