This is an old revision of the document!
−Table of Contents
Servidor de faxes: hylafax
fax hylafax facsimil hylafax-server faxsend hfaxd
Instalación y configuración inicial
(Como root)
1. Instalar el servidor de faxes Hylafax
aptitude update && aptitude install hylafax-server
2. Conectar físicamente el módem externo, a ser posible en el puerto COM1
3. Configurar el fax
faxsetup
Ir contestando las preguntas. La mayoría de ellas pulsando 'enter' para aceptar el valor propuesto por defecto. Marco en negrita los valores que hay que introducir a mano:
... Warning:/etc/hylafax/getty-linkdoesnotexistorisnotanexecutableprogram! ... Warning:/etc/hylafax/vgetty-linkdoesnotexistorisnotanexecutableprogram! ... Warning:/etc/hylafax/egetty-linkdoesnotexistorisnotanexecutableprogram! ... Are these ok [yes]? Can I terminate this faxq process (660) [yes]? Should I restart the HylaFAX server processes [yes]? Do you want to run faxaddmodem to configure a modem [yes]? Serial port that modem is connected to [ttyS0]?
Country code [1]? 34
Area code [415]?
Phone number of fax modem [+1.999.555.1212]? 900000000
Local identification string (for TSI/CIG) [“NothingSetup”]? MI_NOMBRE
Long distance dialing prefix [1]? 34
International dialing prefix [011]? Dial string rules file (relative to /var/spool/hylafax) [etc/dialrules]? Tracing during normal server operation [1]? Tracing during send and receive sessions [11]? Protection mode for received facsimile [0600]? Protection mode for session logs [0600]? Protection mode for ttyS0 [0600]?
Rings to wait before answering [1]? 6
Modem speaker volume [off]? Command line arguments to getty program ["-h %l dx_%s"]? Pathname of TSI access control list file (relative to /var/spool/hylafax) [""]? Pathname of Caller-ID access control list file (relative to /var/spool/hylafax) [""]? Tag line font file (relative to /var/spool/hylafax) [etc/lutRS18.pcf]? Tag line format string ["From %%l|%c|Page %%P of %%T"]? Time before purging a stale UUCP lock file (secs) [30]? Hold UUCP lockfile during inbound data calls [Yes]? Hold UUCP lockfile during inbound voice calls [Yes]? Percent good lines to accept during copy quality checking [95]? Max consecutive bad lines to accept during copy quality checking [5]? Max number of pages to accept in a received facsimile [25]? Syslog facility name for ServerTracing messages [daemon]? Set UID to 0 to manipulate CLOCAL [""]? Use available priority job scheduling mechanism [""]? ... Are these ok [yes]? ... How should it be configured [1]? ... DTE-DCE flow control scheme [default]? ... Are these ok [yes]? ... Are these ok [yes]? ... Do you want to run faxaddmodem to configure another modem [yes]? n ... Should I run faxmodem for each configured modem [yes]?
4. Reiniciar el servidor de faxes:
/etc/init./hylafax restart
5. (Con cualquier usuario) Probar a enviar un fax, preferiblemente en formato .pdf:
sendfax -N -t 1 -n -d "Prueba@000111222" /ruta/documento.pdf
Donde “000111222” es el fax de destino
6. Comprobar que ha llegado (quizá sea necesario hacerlo como root):
clear && cat /var/spool/hylafax/log/xferfaxlog | grep 000111222
Si en el campo nº 11 (contando por la izquierda) hay un “1”, llegó correctamente. Si hay un “0” no llegó, y además se reintentará 3 veces (pese a haberle pasado el parámetro -t 1, pero bueno…)
Enviar por correo fax recibido
fax hylafax e-mail mail adjunto pdf recibido
ANTECEDENTES
Tenemos un servidor hylafax funcionando correctamente, y queremos que los faxes recibidos sean enviados como .pdf adjunto a un buzón de correo determinado
PROCEDIMIENTO
0. Requisitos previos:
- Salida a internet de la máquina donde está instalado el servidor de faxes hylafax
- Tener configurado un servidor de correo saliente, o bien tener configurado postfix para que use otro servidor de correo smtp
(Todo como root)
1. nano /var/spool/hylafax/etc/FaxDispatch
FILETYPE=pdf; SENDTO=FaxMaster;
2. nano /var/spool/hylafax/bin/uuencode_it
#!/bin/sh uuencode -m $1 $1 | grep -E -v "^begin|^====$" 2>/dev/null
3. chmod +x /var/spool/hylafax/bin/uuencode_it
4. Crear los siguientes archivos:
nano /etc/hylafax/FaxDispatch nano /etc/hylafax/FaxNotify nano /etc/hylafax/PollDispatch
Con el siguiente contenido:
############ ANYADIDO ################### # Fichero creado por mi FILETYPE=pdf TEMPLATE=es
5. cp /var/spool/hylafax/bin/faxrcvd /var/spool/hylafax/bin/faxrcvd.original
6. nano /var/spool/hylafax/bin/faxrcvd
Añadir estas dos lineas:
FILETYPE=pdf SENDTO=destinatario@correo.com
7. Grabar y salir
8. Reiniciar hylafax
/etc/init.d/hylafax restart
Enviar a correo notificación de fax enviado
Para que Hylafax envíe un correo electrónico al remitente del fax indicando el éxito/fracaso del envío:
0. Requisitos previos:
- Salida a internet de la máquina donde está instalado el servidor de faxes hylafax
- Tener configurado un servidor de correo saliente, o bien tener configurado postfix para que use otro servidor de correo smtp
1. Procedimiento:
sendfax -D -f "remitente@correo.com" -d "Prueba@666666666" /ruta/documento.pdf
Tratamiento de logs
ANTECEDENTES
Por defecto, hylafax escribe los logs en la siguiente ruta:
/var/spool/hylafax/log/c000000001 /var/spool/hylafax/log/xferfaxlog
Escribe dos tipos de logs:
Tipo | Nombre |
---|---|
(Revisar) 1 por 'commid' | c00000000x |
Llamadas salientes y entrantes | xferfaxlog |
Los permisos de esos logs se establecen en /etc/hylafax/config.ttyS0 (si tenemos conectado el módem externo al puerto COM1):
LogFileMode: 0600
Ejemplos
Para sacar una tabla con los campos interesantes de xferfaxlog (como root):
cat /var/spool/hylafax/log/xferfaxlog | egrep "SEND|CALL" | awk '{print $1" "$2" "$3" "$9" "$12}' && \ cat /var/spool/hylafax/log/xferfaxlog | egrep "UNSENT" | awk '{print $1" "$2" "$3" "$7" "$9}'
Si la última columna es 0, el fax no ha llegado; si es diferente, si
Contar faxes enviados a un número en una fecha x
(Como root)
cat /var/spool/hylafax/log/xferfaxlog | grep 950403000 | grep "01/20/09" | wc -l
Dejar registro de llamadas entrantes
(Todo como root)
1. Editar el fichero /etc/hylafax/config.ttyS0 (en caso de que el módem esté conectado físicamente al puerto COM1)
2. Añadir la siguiente linea:
LogCalls: True
3. Grabar y cerrar el fichero
4. Reiniciar hylafax:
/etc/init.d/hylafax restart
Fijar un horario de funcionamiento
Para establecer un horario en el que funcione hylafax editar /etc/hylafax/config:
TimeOfDay: "0800-1800"
Según esta configuración, a partir de las 18h ni salen ni entran faxes.