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

Difference between revisions of "Email to Fax Gateway"

m
m
Line 1: Line 1:
'''Hylafax email to fax gateway'''
+
'''HylaFAX email to fax gateway'''
 
<br>
 
<br>
One of the main uses for Hylafax is as an 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.
 
This gateway unifies a users communications, so that faxing is as simple as using an email client.
The user can email <i>john@08812345678.fax</i> and know that the message typed, and any attachment will be faxed via Hylafax.
+
The user can email <i>john@08812345678.fax</i> and know that the message typed, and any attachment will be faxed via HylaFAX.
 
<br>
 
<br>
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.
+
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
+
By default, HylaFAX will not decode any attachments, so you need to edit
 
<pre>
 
<pre>
 
#/etc/hylafax/hyla.conf
 
#/etc/hylafax/hyla.conf
Line 15: Line 15:
 
</pre>
 
</pre>
  
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.
+
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'''
 
'''The tree looks like this'''
 
<pre>
 
<pre>
Line 28: Line 28:
 
#!/bin/sh
 
#!/bin/sh
 
#/application/pdf
 
#/application/pdf
# convert PDF attachment to Postscript for Hylafax to send
+
# convert PDF attachment to Postscript for HylaFAX to send
 
pdf2ps $1 -
 
pdf2ps $1 -
 
</pre>
 
</pre>
Line 35: Line 35:
 
#!/bin/sh
 
#!/bin/sh
 
#/application/ps
 
#/application/ps
# convert PS attachment to Postscript for Hylafax to send
+
# convert PS attachment to Postscript for HylaFAX to send
 
echo $1
 
echo $1
 
</pre>
 
</pre>
Line 42: Line 42:
 
#!/bin/sh
 
#!/bin/sh
 
#/image/tif
 
#/image/tif
# convert TIF attachment to Postscript for Hylafax to send
+
# convert TIF attachment to Postscript for HylaFAX to send
 
/usr/bin/tiff2ps $1
 
/usr/bin/tiff2ps $1
 
</pre>
 
</pre>
Line 49: Line 49:
 
#!/bin/sh
 
#!/bin/sh
 
#/application/rtf
 
#/application/rtf
# convert RTF attachment to Postscript for Hylafax to send
+
# convert RTF attachment to Postscript for HylaFAX to send
 
/usr/bin/unrtf --html $1 | /usr/bin/html2ps
 
/usr/bin/unrtf --html $1 | /usr/bin/html2ps
 
#NOTE that this script does not work!
 
#NOTE that this script does not work!
 
#Although it will work just fine from command line
 
#Although it will work just fine from command line
#Hylafax will not accept the Postscript output.
+
#HylaFAX will not accept the Postscript output.
 
#any help is welcome...
 
#any help is welcome...
 
</pre>
 
</pre>

Revision as of 06:19, 19 March 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 -


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


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...


Powered by MediaWiki
Attribution-ShareAlike 2.5

Project hosted by iFAX Solutions