Personal tools
HylaFAX The world's most advanced open source fax server

Difference between revisions of "Email to Fax Gateway"

(Add some options to send multipage tiff/pdf attachments)
(Add: Convert HTML attachments to Postscript for HylaFAX to send)
Line 61: Line 61:
 
#HylaFAX will not accept the Postscript output.
 
#HylaFAX will not accept the Postscript output.
 
#any help is welcome...
 
#any help is welcome...
 +
</pre>
 +
<br>For HTML attachments and HTML formatted e-mails
 +
<pre>
 +
#!/bin/sh
 +
#/text/html
 +
# convert HTML attachment and HTML formatted e-mails to Postscript for HylaFAX to send
 +
/usr/bin/html2ps $1
 
</pre>
 
</pre>

Revision as of 10:15, 21 May 2007

HylaFAX email to fax gateway
One of the main uses for HylaFAX is as an email to fax gateway. This gateway unifies a users communications, so that faxing is as simple as using an email client. The user can email john@08812345678.fax and know that the message typed, and any attachment will be faxed via HylaFAX.
To setup an email to fax gateway using HylaFAX, a few simple scripts are needed to convert attachments into postscript so that HylaFAX can then use them. You can send emails with pdf attachments, postscript attachments or tiff attachments. By default, HylaFAX will not decode any attachments, so you need to edit

#/etc/hylafax/hyla.conf
# This line tells hylafax(faxmail) to decode attachments using scripts
# located here.
MIMEConverters: /var/spool/hylafax/mimetype
#

Create the mimetype directory, then inside that, a directory for the attachment mime type, eg application or image, then create a script inside that. The script is passed $1 as the decoded attachments filename, and HylaFAX expects postscript on standard out. The tree looks like this

/var/spool/hylafax/mimetype/
/var/spool/hylafax/mimetype/application/pdf
/var/spool/hylafax/mimetype/application/ps
/var/spool/hylafax/mimetype/image/tiff

The Scripts you will need (make sure to chmod +x them to make them executable):
For PDF attachments

#!/bin/sh
#/application/pdf
# convert PDF attachment to Postscript for HylaFAX to send
pdf2ps $1 -
# if you want to send multipage pdf attachments it is better to use "pdftops"
# use the line below instead of "pdf2ps $1 -"
# /usr/bin/pdftops $1 -


For PS attachments

#!/bin/sh
#/application/ps
# convert PS attachment to Postscript for HylaFAX to send
echo $1


For TIF attachments

#!/bin/sh
#/image/tif
# convert TIF attachment to Postscript for HylaFAX to send
/usr/bin/tiff2ps $1
# if you want to send multipage tiff images, than you have to add the option "-a"
# for example:
#/usr/bin/tiff2ps -a $1


For RTF attachments

#!/bin/sh
#/application/rtf
# convert RTF attachment to Postscript for HylaFAX to send
/usr/bin/unrtf --html $1 | /usr/bin/html2ps
#NOTE that this script does not work!
#Although it will work just fine from command line
#HylaFAX will not accept the Postscript output.
#any help is welcome...


For HTML attachments and HTML formatted e-mails

#!/bin/sh
#/text/html
# convert HTML attachment and HTML formatted e-mails to Postscript for HylaFAX to send
/usr/bin/html2ps $1


Powered by MediaWiki
Attribution-ShareAlike 2.5

Project hosted by iFAX Solutions