User Tools

Site Tools


informatica:linux:hylafax

This is an old revision of the document!


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

...
Warning:/etc/hylafax/getty-linkdoesnotexistorisnotanexecutableprogram!
...
Warning:/etc/hylafax/vgetty-linkdoesnotexistorisnotanexecutableprogram!
...
Warning:/etc/hylafax/egetty-linkdoesnotexistorisnotanexecutableprogram!
...

Aretheseok[yes]?=>y
CanIterminatethisfaxqprocess(7586)[yes]?y
ShouldIrestarttheHylaFAXserverprocesses[yes]?y
Doyouwanttorunfaxaddmodemtoconfigureamodem[yes]?y
Serialportthatmodemisconnectedto[ttyS0]?ttyS0
Countrycode[1]?34
Areacode[415]?415
Phonenumberoffaxmodem[+1.999.555.1212]?600600600
Localidentificationstring(forTSI/CIG)["NothingSetup"]?pcmalaga
Longdistancedialingprefix[1]?34
Internationaldialingprefix[011]?011
Dialstringrulesfile(relativeto/var/spool/hylafax)[etc/dialrules]?etc/dialrules
Tracingduringnormalserveroperation[1]?1
Tracingduringsendandreceivesessions[11]?11
Protectionmodeforreceivedfacsimile[0600]?0644
Protectionmodeforsessionlogs[0600]?0600
ProtectionmodeforttyS0[0600]?0600
Ringstowaitbeforeanswering[1]?5
Modemspeakervolume[off]?off
Commandlineargumentstogettyprogram["-h%ldx_%s"]?"-h%ldx_%s"
PathnameofTSIaccesscontrollistfile(relativeto/var/spool/hylafax)[""]?""
PathnameofCaller-IDaccesscontrollistfile(relativeto/var/spool/hylafax)[""]?""
Taglinefontfile(relativeto/var/spool/hylafax)[etc/lutRS18.pcf]?etc/lutRS18.pcf
Taglineformatstring["From%%l|%c|Page%%Pof%%T"]?"Desde%%l|%c|Pagina%%Pde%%T"
TimebeforepurgingastaleUUCPlockfile(secs)[30]?30
HoldUUCPlockfileduringinbounddatacalls[Yes]?y
HoldUUCPlockfileduringinboundvoicecalls[Yes]?y
Percentgoodlinestoacceptduringcopyqualitychecking[95]?95
Maxconsecutivebadlinestoacceptduringcopyqualitychecking[5]?5
Maxnumberofpagestoacceptinareceivedfacsimile[25]?25
SyslogfacilitynameforServerTracingmessages[daemon]?daemon
SetUIDto0tomanipulateCLOCAL[""]?=>Pulso'enter'
Useavailablepriorityjobschedulingmechanism[""]?=>Pulso'enter'

CountryCode:34
AreaCode:415
FAXNumber:600600600
LongDistancePrefix:34
InternationalPrefix:011
DialStringRules:etc/dialrules
SessionTracing:11
RecvFileMode:0644
RingsBeforeAnswer:5
SpeakerVolume:off
GettyArgs:"-h%ldx_%s"
LocalIdentifier:pcmalaga
TagLineFont:etc/lutRS18.pcf
TagLineFormat:"Desde%%l|%c|Pagina%%Pde%%T"
MaxRecvPages:25
LockDataCalls:yes
LockVoiceCalls:yes

Aretheseok[yes]?y
Howshoulditbeconfigured[1]?1
DTE-DCEflowcontrolscheme[default]?default

ModemDialCmd:ATDT%s
ModemFlowControl:rtscts
ModemHardFlowCmd:AT&K3
ModemMfrQueryCmd:!Rockwell
ModemModelQueryCmd:!RC288DPi
ModemNoFlowCmd:AT&K0
ModemRate:19200
ModemRevQueryCmd:ATI3
ModemSetupDCDCmd:AT&C1
ModemSetupDTRCmd:AT&D2
ModemSoftFlowCmd:AT&K4

Aretheseok[yes]?y

CountryCode:34
AreaCode:415
LongDistancePrefix:34
InternationalPrefix:011
DialStringRules:etc/dialrules

Aretheseok[yes]?y
Doyouwanttorunfaxaddmodemtoconfigureanothermodem[yes]?n
ShouldIrunfaxmodemforeachconfiguredmodem[yes]?y

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:

(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:

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
informatica/linux/hylafax.1242377692.txt.gz · Last modified: 2015/04/13 20:19 (external edit)