Koozali.org formerly Contribs.org

Hylafax Re-visited Yet Again

Hylafax Re-visited Yet Again
« on: January 29, 2007, 09:30:12 PM »
Thank you everybody for all of you help and this install had made a LOT of progress. Below are the findings of all of the people that have suggested. Please note that the next phase (adding clients) - email to fax would seem to be the next issue.

1. How do you add users the correct way? (see below)
2. How do you change Hylafax to allow e-mail to fax?

1/25/07

Given the problems a few people seem to be having with the current Hylafax howto - I have done the following based on a new server I have built.
Download the most current version from here and place the file in the /usr/sbin folder.

Install via the following command and it will install all of the required packages for you.

# yum --enablerepo=base --enablerepo=updates localinstall hylafax-4.3.1-1rhel4.i386.rpm (as of 1/25/07)

Make sure that your modem is plugged into the serial port and turned on.

After the install, the system will ask you to reboot. Before you reboot the system, run the /usr/sbin/faxsetup command and answer the questions as required.

NOTE: When I answered the questions, I accepted the defaults on most everything except the area code and telephone number of the fax line.
 
Take note of your modem tty and substitute within the inittab template to suit your setup. My modem is on ttyS0. (The first serial port is ttyS0 and the second is ttyS1) Internal Modems most likely will not work.

Issue the commands:

signal-event post-upgrade
signal-event reboot

Run the following commands. Watch out for line wrapping.

Commands:

# mkdir -p /etc/e-smith/templates-custom/etc/inittab
# cd  /etc/e-smith/templates-custom/etc/inittab
# echo 'fax:23457:respawn:/usr/sbin/faxgetty ttyS0' >> 85hylafax
# /sbin/e-smith/expand-template /etc/inittab
# ln -s /etc/rc.d/init.d/hylafax /etc/rc.d/rc7.d/S95hylafax


Reboot and you should be okay.

++++++++++++++++++++++++++++++++++++++++++

The above was tested on SME 7.1 as of  1/25/07 and seems to be working.

Now for the great unknown!

You will need to add a user to the system so your client software
will see you and let you use the fax server.

Use Putty to gain command line access (or what-ever you use) and from the command line, issue the following command ( enter your name and password instead of the X's)

useradd -u 100 XXXXXXX -p xxxxxxxxxx

or are you supposed to use;
faxadduser -a XXXXXXX -p XXXXXXXXXX -u 190 XXXXXXXX

Do we need to revise any scripts to alert the email program that .fax goes somewhere else?

I wish someone would (besides me ) write out what they did to make this fax program work. The server side is one thing but the client is YET another.

This is as far as I got!

If anyone wishes to add to this, please add away. I would like to hear from people that have install a client and what they did to do it.

Carl

Hylafax Re-visited Yet Again
« Reply #1 on: January 29, 2007, 10:01:40 PM »
Ok, I think I can you help, since I developed a Hylafax client.

Download the Client Software from:

http://www.hylafax-client.de

Login on your SME Server with putty and make a new faxuser:

faxadduser -p password username

Password is your Password and Username is your Username :wink:
Now install the HylaFAX-Client and restart the Windows Computer.
After this, you start the HylaFAX-Client and insert your Values:

Server IP:  Your SME Server IP
Port: 4559
Username: Your Username
Passord: Your Password

That's it! :D

Now you can send faxes from all your windows application with a HylaFAX printer.

yythoss

Offline Franco

  • *
  • 1,171
    • http://contribs.org
Hylafax Re-visited Yet Again
« Reply #2 on: January 29, 2007, 10:04:28 PM »
I have it installed in 03 different locations and work without problems for me in every instance:
Code: [Select]

#!/bin/sh
wget -c ftp://ftp.hylafax.org/binary/linux/redhat/RPMS/i386/hylafax-4.2.5-1rhel4.i386.rpm
yum -y localinstall hylafax*

mv /etc/cron.daily/hylafax /etc/cron.weekly/

faxsetup

mkdir -p /etc/e-smith/templates-custom/etc/inittab
echo "fax:23457:respawn:/usr/sbin/faxgetty ttyS0" > /etc/e-smith/templates-custom/etc/inittab/S85hylafax
/sbin/e-smith/expand-template /etc/inittab
/sbin/init q

ln -s /etc/rc.d/init.d/hylafax /etc/rc.d/rc7.d/S92hylafax

echo "FILETYPE=pdf;
SENDTO=FaxMaster;" > /etc/hylafax/etc/FaxDispatch

echo "RETURNFILETYPE=pdf;" > /etc/hylafax/etc/FaxNotify


create user or group faxmaster

Next issue - email to fax
« Reply #3 on: January 29, 2007, 10:35:01 PM »
Quote from: "stuntshell"
I have it installed in 03 different locations and work without problems for me in every instance:
Code: [Select]

#!/bin/sh
wget -c ftp://ftp.hylafax.org/binary/linux/redhat/RPMS/i386/hylafax-4.2.5-1rhel4.i386.rpm
yum -y localinstall hylafax*

mv /etc/cron.daily/hylafax /etc/cron.weekly/

faxsetup

mkdir -p /etc/e-smith/templates-custom/etc/inittab
echo "fax:23457:respawn:/usr/sbin/faxgetty ttyS0" > /etc/e-smith/templates-custom/etc/inittab/S85hylafax
/sbin/e-smith/expand-template /etc/inittab
/sbin/init q

ln -s /etc/rc.d/init.d/hylafax /etc/rc.d/rc7.d/S92hylafax

echo "FILETYPE=pdf;
SENDTO=FaxMaster;" > /etc/hylafax/etc/FaxDispatch

echo "RETURNFILETYPE=pdf;" > /etc/hylafax/etc/FaxNotify


create user or group faxmaster


First, let me say thanks to the both of you.

Next issue, anybody get the email to fax to work? I tried 4 different way to do this and it failed everytime.

Any ideas?

Carl

Offline Franco

  • *
  • 1,171
    • http://contribs.org
Hylafax Re-visited Yet Again
« Reply #4 on: January 29, 2007, 11:12:24 PM »
humm, that's different! You're trying the opposite to work?
I'm not sure how'd that be.
In fact I just downloaded and tried the client yythoss recommended and that works better that the WHCF I was using.

Hylafax Re-visited Yet Again
« Reply #5 on: January 29, 2007, 11:25:20 PM »
I have make a Test with this:

http://www.vangee.nl/sme/hylafax/

and that is OK. You can send faxes with your email programm:

Name@123456.fax

That's all.

yythoss

Hylafax Re-visited Yet Again
« Reply #6 on: January 30, 2007, 03:03:19 AM »
Quote from: "yythoss"
I have make a Test with this:

http://www.vangee.nl/sme/hylafax/

and that is OK. You can send faxes with your email programm:

Name@123456.fax

That's all.

yythoss


Hi,

The link for the install instructions is broken but I did manage to get the server to receive a fax and send it to my email in .pdf format.

The server will not send a fax but it will send me an email instead.

Any ideas as to what Iam doing wrong?

Thanks in advance.

Carl

Hylafax Re-visited Yet Again
« Reply #7 on: January 30, 2007, 05:11:30 AM »
All,

Forgot the instructions on the mailfax script, after that the system responded very well. I will do a clean install tomorrow and see what I get.

Thanks to ALL and I mean all of ya! You are the best!

Carl

Hylafax Re-visited Yet Again
« Reply #8 on: January 30, 2007, 09:15:29 AM »
The most problems of the HylaFAX Server is the modem config.
In the directory /var/spool/hylafax/config you can find a lot of samples.

I test the link above one more time, it is OK

yythoss

Offline Franco

  • *
  • 1,171
    • http://contribs.org
Hylafax Re-visited Yet Again
« Reply #9 on: February 01, 2007, 05:08:23 AM »
yythoss,
When viewing faxes I get permission denied from your application. I have created a group and my user is part of that group: faxmaster.
any ideas?

Thanks,

Hylafax Re-visited Yet Again
« Reply #10 on: February 01, 2007, 09:51:37 AM »
Change your permission in the /recvq directory of all tif files to 0644 or 0666.
Now you must change the permisson for the future in the config.MODEM file to

RecvFileMode:           0666
LogFileMode:            0666
DeviceMode:             0666

Change MODEM with you device Name ttyS0 for COM1 and ttyS1 for COM2.

yythoss

Offline Franco

  • *
  • 1,171
    • http://contribs.org
Hylafax Re-visited Yet Again
« Reply #11 on: February 01, 2007, 04:19:06 PM »
Thank you much, that did it!

Step-by-Step that worked for me.
« Reply #12 on: February 03, 2007, 05:57:12 AM »
Quote from: "cbacani"
All,

Forgot the instructions on the mailfax script, after that the system responded very well. I will do a clean install tomorrow and see what I get.

Thanks to ALL and I mean all of ya! You are the best!

Carl


I tested this 3 times with a clean install.

Hylafax on the SME Server                     1/29/07

These instructions will install Hylfax on the SME Server version 7.1 as of 1/29/07.

The system will send a fax and e-mail the faxuser.

Download the most current version from here and place the file in the /usr/sbin folder.

# cd /usr/sbin

# wget ftp://ftp.hylafax.org/binary/linux/redhat/RPMS/i386/hylafax-4.3.1-1rhel4.i386.rpm

Install via the following command and it will install all of the required packages for you.

# yum --enablerepo=base --enablerepo=updates localinstall hylafax-4.3.1-1rhel4.i386.rpm

Make sure that your modem is plugged into the serial port and turned on.

After the install, the system will ask you to reboot the system, then run the

# /usr/sbin/faxsetup command and answer the questions as required.

NOTE: When I answered the questions, I accepted the defaults on most everything except
the area code and telephone number of the fax line.
 
Take note of your modems tty and substitute within the inittab template to suit your setup. My modem is on ttyS0. (The first serial port is ttyS0 and the second is ttyS1) Internal Modems most likely will not work.


Run the following commands. Watch out for line wrapping.

# mkdir -p /etc/e-smith/templates-custom/etc/inittab
# cd /etc/e-smith/templates-custom/etc/inittab
# echo 'fax:23457:respawn:/usr/sbin/faxgetty ttyS0' >> 85hylafax
# /sbin/e-smith/expand-template /etc/inittab
# ln -s /etc/rc.d/init.d/hylafax /etc/rc.d/rc7.d/S95hylafax
# signal-event post-upgrade; signal-event reboot


Setting up SME-Server using the server manager

Open your server-manager.

Create a new user account using the following data:

Account Name:      faxuser

First Name:      fax

Last Name:      fax

E-Mail Delivery:   Deliver e-mail locally

Forwarding Address:   Leave Blank

Reset Password   <9Gh08pV5O;


Create a new virtual domain:

Domain Name:      fax

Brief Description:   fax

Content:      Primary Web Site

Domain DNS Servers   Resolve Locally

*************************************************************

Changing SME-Server configuration

Next step is to redirect all mail for the domain .fax to the user faxuser.
We can do this by creating a custom template file in the appropriate folder.

Create the folder (if it doesn’t already exist).
# mkdir -p /etc/e-smith/templates-custom/var/qmail/control/virtualdomains

Create the custom template file.
# pico /etc/e-smith/templates-custom/var/qmail/control/virtualdomains/95faxmail

In this 95faxmail file we will enter the virtual domain, and connect it to the faxuser.
The only line in this file will look like this:
.fax:faxuser

Redirect mail for faxuser to mailfax script.
We will create a new file that tells qmail to pipe all mail to the (to be created) mailfax script.

In the users home directory /home/e-smith/files/users/faxuser. We create and edit the file
named .qmail-default:

# pico /home/e-smith/files/users/faxuser/.qmail-default

Containing only one line
| /etc/hylafax/etc/mailfax


Set the ownership and rights on .qmail-default to the user only:

# chown faxuser:faxuser /home/e-smith/files/users/faxuser/.qmail-default
# chmod 644 /home/e-smith/files/users/faxuser/.qmail-default

Restart the qmail Server.
First we'll have to rebuild the configuration files. Then we can restart qmail.

Rebuild the SME-Server configuration files by executing:
# /sbin/e-smith/signal-event console-save

This can take awhile, after that we restart qmail:
# service qmail restart

Creating the mailfax script

# pico /etc/hylafax/etc/mailfax

This file must contain:

#!/bin/sh
#
# mailfax - email to fax gateway for qmail.
#
# Original file from HylaFAX, updated for e-smith server.
#----------------------------------------------------------
# 4 more information see: http://www.vangee.nl/sme/hylafax
#
# 1.) Install HylaFAX
# 2.) In server-manager add a virtual domain named: fax
# 3.) In server-manager add a user named: faxuser
# 4.) Install this file as: /etc/hylafax/etc/mailfax
# 5.) Add the following file to your system:
#     /etc/e-smith/templates-custom/var/qmail/control/virtualdomains/90aliases
# 6.) Put this line in the file:
#     .fax:faxuser
# 7.) Add the following file to your system:
#     /home/e-smith/files/users/faxuser/.qmail-default
# 8.) Put this line in the file:
#     | /etc/hylafax/etc/mailfax
# 9.) Execute: /sbin/e-smith/signal-event console-save
# 10) Execute: service qmail restart
 
TMPVAR=${SENDER//\`/}
TMPVAR=${TMPVAR//\$\(/}
SENDER=${TMPVAR//\)/}

/usr/bin/faxmail -f Helvetica-Bold | /usr/bin/sendfax \
        -f "$SENDER" \
        -n -d "$EXT2@`/usr/bin/expr \"$HOST\" : '\(.*\)\.fax$'`"

Change the ownership and rights for the mailfax script:
# chown root:root /etc/hylafax/etc/mailfax
# chmod 755 /etc/hylafax/etc/mailfax
Add the following file to your system:


Receiving faxes by e-mail

We can also route all incoming faxes to the faxuser's e-mail box. To do this we must create a new
HylaFAX configuration file. It is possible to receive the incoming faxes in one of three formats. (.ps .pdf or .tif)

# pico /var/spool/hylafax/etc/FaxDispatch

This file must contain:

FILETYPE=pdf;
SENDTO=faxuser;

Substitute tif or ps for pdf as you desire.

+++++++++++++++++++++++++++++++++++++++++++++++

Hylafax e-mail to Fax Gateway

One of the main uses for Hylafax is as an e-mail to fax gateway. This gateway unifies a users
communications, so that faxing is as simple as using an e-mail client. The user can e-mail
john@08812345678.fax and know that the message typed, and any attachment will be faxed via Hylafax.

To setup an e-mail 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 e-mails with pdf attachments, postscript attachments or tiff attachments. By default, hylafax will not decode any attachments, so you need to edit

Run the following commands.

# pico /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

# cd /var/spool/hylafax
# mkdir /var/spool/hylafax/mimetype
# mkdir /var/spool/hylafax/mimetype/application          pdf  file goes here     ps  file goes here  
# mkdir /var/spool/hylafax/mimetype/image        tiff   file goes here

+++++++++++++++++++++++++++++++++++++++++++++++

For PDF attachments:

cd /var/spool/hylafax/mimetype/application      

pico pdf

Insert this code below in the pdf file;

#!/bin/sh
#/application/pdf
# convert PDF attachment to Postscript for Hylafax to send
pdf2ps $1 –

Save the file.

# chmod +x pdf

For PS attachments:

pico ps

Insert this code below in the ps file;

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

Save the file.

# chmod +x ps


For TIF attachments:

cd /var/spool/hylafax/mimetype/image/

pico tif

Insert this code below in the tif file;

#!/bin/sh
#/image/tif
# convert TIF attachment to Postscript for Hylafax to send
/usr/bin/tiff2ps $1

Save the file.

# chmod +x tif

(make sure to chmod +x them to make them executable).

# signal-event post-upgrade; signal-event reboot



Testing

Send an e-mail from your favorite mailing software to the SME-Server. This means that the smtp server in your e-mail software must be set to the SME-Server. Because the e-mail address we are going to be using will only be known by our server. Then we will send an e-mail with the following recepeint: Name@FaxNumber.fax


e.g: John_Smith@5555551212.fax

+ The name can be any name.
+ The fax number is going to be used for faxing the document.
+ Mail can only be send as a plain text e-mail.
+ Mail can have a postscript attachment, this attachment will also be faxed. (filename.ps)
   So don't expect your html formatted e-mails to be faxed! Sorry!

Hylafax Re-visited Yet Again
« Reply #13 on: February 04, 2007, 10:00:45 AM »
Thanks very much for putting this together!

Works for me.

G

Hylafax Re-visited Yet Again
« Reply #14 on: February 09, 2007, 02:56:28 PM »
Hi,

Getting the following error on 3x servers.


Warning: /usr/share/ghostscript/fonts does not exist or is not a directory!

The directory /usr/share/ghostscript/fonts does not exist or this file is not a directory.
This is the directory where the HylaFAX client applications expect to
locate font metric information to use in formatting ASCII text for
submission as facsimile.  Without this information HylaFAX may generate
illegible facsimile from ASCII text.


FATAL ERROR: No tiffg3 driver in /usr/bin/gs.

HylaFAX has been configured to use Ghostscript as the PostScript
imaging program but the output of /usr/bin/gs -h does not
list the tiffg3 driver as a configured driver (see below).

----------------------------------------------------------
% /usr/bin/gs -h
/usr/bin/gs: error while loading shared libraries: libgs.so.7: cannot open shared object file: No such file or directory
/usr/sbin/faxsetup: line 1334: ----------------------------------------------------------: command not found

The tiffg3 driver is required for HylaFAX to operate correctly.
Consult the documentation for information on building Ghostscript
with the necessary TIFF driver and then rerun faxsetup when a new
Ghostscript has been installed.

Was working on servers before, killed by upgrade.

Chris
...