Installing Hylafax server on Ubuntu

Installation includes the following steps:

  • Basic install
  • Workaround for PAM SSL
  • Configuration of T38 modem
  • Setup of cron jobs
  • Setup of mail notifications (e.g. in CommuniGate)

1. Basic install

  • Install
apt-get install -y hylafax-server hylafax-client
apt-get install -y a2ps
  • Configure ports in /etc/default/hylafax:
#OLDPROT="-o 4557"
NEWPROT="-i 4559"
#SNPP="-s 444"
  • Enable hosts in /etc/hylafax/hosts.hfaxd:
^.*@127\.0\.0\.1$
^.*@10\.20\..*\..*$

(this means: any user from 10.20.x.x or 127.0.0.1)

  • Edit /etc/hylafax/hyla.conf client config:
Host: fax.ourdom.com
Port: 4559
Verbose: No
TimeZone: local
DialRules: "/etc/hylafax/dialrules"
AutoCoverPage: No
FontMap: /usr/share/fonts/type1/pscyr
FontPath: /usr/share/fonts/type1/pscyr

The AutoCoverPage=No configuration eliminates -n every now and then on the sendfax command line.

2. Workaround PAM SSL

  • IMPORTANT! There is a tricky issue with hfaxd: it chroot's to /var/spool/hylafax on every client connection and accesses NSS/PAM after that. In our LDAP-based configuration this means using SSL connection with a random secret and server certificate as set by /etc/ldap.conf (note that as strace shows, ldap.conf is read before chroot). If chroot'ed process does not find /dev/[u]random, it prematurely exits. Another trick is that the LDAP server certificate should be placed in /var/spool/hylafax/etc, the location which is rewritten by the /etc/init.d/hylafax startup script. Commands that overcome the above problems are as follows:
cp -a /dev/random /dev/urandom /var/spool/hylafax/dev
mkdir /etc/hylafax/ssl
cp -a /etc/ssl/ourdom-ldap-ca.crt /etc/hylafax/ssl

3. Configure T38 Modem

  • Configure with t38modem:
cp /usr/share/doc/t38modem/examples/config.ttyx /etc/hylafax/config.ttyx
cd /etc/hylafax
ln -s config.ttyx config.ttyx0
  • Enable CID reporting in /etc/hylafax/config.ttyx0:
ModemResetCmds:         "AT#CID=10"     # enable ANI/DNIS reporting
RingsBeforeAnswer:      2               # collect info between two RINGs
QualifyCID:             etc/cid         # CID access control list file
CIDNumber:              "NMBR = "       # pattern string for calling number
CIDName:                "NDID = "       # pattern string for called number
  • Improve transmission speeds: default baud rate of 14400 is way too slow. This probably does not help as RTS/CTS is enabled.
ModemRate:  57600
  • Fix received fax permissions in config.ttyx0 as set by faxgetty so that received faxes can be acessed via anonymous FTP (by default faxgetty writes faxes and sessions transcripts as uucp:uucp 0600, but anonymous FTP runs as faxmaster):
LogFileMode:            0644
RecvFileMode:           0644

4. Cron jobs

  • Fix /etc/cron.weekly/hylafax: remove lines for faxcron, faxqclean lines writing to a log and related savelog entries, then re-add them as:
faxcron -info 35 -log 35 -rcv 100 -tmp 15 -mode 664          | mail -e -n -s "fax cron job on fax.ourdom.com" faxmaster
faxqclean -t -j 3024000 -a          | mail -e -n -s "fax queue clean job on fax.ourdom.com" faxmaster
  • Fix xferfaxstats mail subjects in /etc/cron.monthly/hylafax and include there the fax.ourdom.com host name
  • Disable reporting from /etc/cron.daily, we allow for daily cron jobs, but want only weekly statistics:
/usr/sbin/faxcron > /dev/null
#| mail -s "fax usage report for server.ourdom.com" reports
exit 0

5. Configure notifications

  • Configure mail address in /etc/hylafax/hfaxd.conf:
FaxContact:     faxmaster@fax1.ourdom.com
  • Install russian notification templates in /etc/hylafax/templates/ru from hylafax-templates-ru-v02.tgz
  • Configure delivery of incoming faxes via /etc/hylafax/FaxDispatch (make it executable):
# helper script for hylafax
FROMADDR="faxmaster@fax1.ourdom.com"
TOADDR="Fax Receptors <faxmaster@ourdom.com>"
EMPTYSENDTO="FaxMaster"
HOSTNAME="fax1.ourdom.com"
FILETYPE=pdf
NOTIFY_FAXMASTER=always
TEMPLATE=ru
# fix mail addresses
[ -z "$SENDTO" -o "x$SENDTO" = "x$EMPTYSENDTO" ] && SENDTO="$TOADDR"
if [ -z "$SENDER" ]; then
  SENDER="Unknown"
  [ -n "$CALLID1" -o -n "$CALLID2" ] && SENDER="$CALLID1:$CALLID2"
fi

HOSTNAME is fax1.ourdom.com above. This name will appear in notification mails with links to access data via anonymous FTP (will be configured below). Since users will probably access this via a web browser via proxy, we want that this address bypasses proxy.

  • Expand those settings to the notify script and others:
cd /etc/hylafax
ln -s FaxDispatch FaxNotify
ln -s FaxDispatch FaxWedged
ln -s FaxDispatch PollDispatch
  • restart hylafax and vsftd:
/etc/init.d/hylafax restart

 

Вложения

Комментарии

Отправить комментарий

Содержание этого поля является приватным и не предназначено к показу.
To prevent automated spam submissions leave this field empty.