-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
El 2006-10-18 a las 21:53 +0200, escribí:
** http://www.hylafax.org/content/Email_to_Fax_Gateway
Estoy mirando esta explicación, ¡pero es incompleta! Solo explica como
hacer los scripts conversores a postscript, pero no como lee llega el
correo ni nada de eso. No lo entiendo.
En "/usr/share/doc/packages/hylafax/html/faxgateway.html" dice:
| 5. If your system uses Postfix to deliver mail, then follow the
| instructions in faxmail/mailfax.sh-postfix.
pero ese fichero no está en la distro, debe estar en los fuentes o el
servidor ftp de los desarrolladores. Pero me parece que en los fuentes que
tiene SuSE no viene, porque el ARCHIVES.gz no lo lista.
Si viene. En:
hylafax-4.2.5-14.src.rpm --> CONTENTS.cpio --> hylafax-4.2.5.tar.bz2 -->
./hylafax-4.2.5//faxmail/mailfax.sh-postfix:
+++========================================================== CZO
#!/bin/sh
#
# mailfax - email to fax gateway for Postfix.
#
# Here you find instructions about 2 email-to-fax configurations
# using HylaFAX and Postfix, they differ in the email address format:
#
# 1. <username>@<fax-no>.fax ('classic' HylaFAX email-to-fax setup)
#
# 2. <fax-no>@fax.yourdomain.dom
#
# GENERAL NOTES:
# - Linux binary/config files locations assumed, change them to suit your
# system conventions.
# - Setup #1 requires you install this file as /usr/bin/mailfax, while
# setup #2 does not.
# - Whatever setup you chose, when finished you need to run
# # postmap /etc/postfix/transport
# # postfix reload
# in order for the changes to take effect immediately
#
##################################################
#
# 1. <username>@<fax-no>.fax ('classic' HylaFAX email-to-fax setup)
#
# *** you NEED TO INSTALL this file as /usr/bin/mailfax ***
#
# Add the following to /etc/postfix/master.cf:
# fax unix - n n - 1 pipe
# flags= user=fax argv=/usr/bin/mailfax ${user} ${recipient} ${sender}
#
# Add the following to /etc/postfix/transport:
# .fax fax:localhost
#
# Add the following to /etc/postfix/main.cf:
# transport_maps = hash:/etc/postfix/transport
# fax_destination_recipient_limit = 1
#
#
# Notes:
# 1) If you want the fax to be submitted as an user other than fax (uucp),
# then replace
# flags= user=fax argv=/usr/bin/mailfax ${user} ${recipient} ${sender}
# with
# flags= user=<anyuser> argv=/usr/bin/mailfax ${user} ${recipient} ${sender}
# Do not use 'root' ...
# 2) If you want the HylaFAX email contact to be the same for all the fax
# submitted via email, then replace
# flags= user=fax argv=/usr/bin/mailfax ${user} ${recipient} ${sender}
# with
# flags= user=fax argv=/usr/bin/mailfax ${user} ${recipient}
#
##################################################
#
# 2. <fax-no>@fax.yourdomain.dom
#
# *** you _DO_ _NOT_ NEED TO INSTALL this file as /usr/bin/mailfax ***
#
# See http://www.postfix.org/faq.html#fax for instructions on how to set up
# an email-to-fax gateway with this email address format.
#
# For your convenience the faq available at the above URL is reproduced here.
#
# ===== http://www.postfix.org/faq.html#fax (as of 2001-03-05)
# Sending mail to a FAX machine
#
# The following information is by Joerg Henne:
#
# Over here we are using the scheme <fax number>@fax.our.domain
# with Postfix and HylaFax. Here's the setup used:
#
# /etc/postfix/master.cf:
# fax unix - n n - 1 pipe
# flags= user=fax argv=/usr/bin/faxmail -d -n ${user}
#
# /etc/postfix/transport:
# fax.your.domain fax:localhost
#
# /etc/postfix/main.cf:
# transport_maps = hash:/etc/postfix/transport
# fax_destination_recipient_limit = 1
#
# The process limit of 1 in the master.cf file is necessary with fax software
# that cannot handle multiple requests at the same time.
# It won't hurt otherwise.
#
# The fax_destination_recipient_limit entry (by Simon, Mr.Simix)
# is necessary with fax software that can't have more than one destination
# on its command line. It won't hurt otherwise.
#
# Specify dbm instead of hash if your system uses dbm files instead of
# db files. To find out what map types Postfix supports, use the command
# postconf -m.
#
# Note: be sure to not advertise fax.your.domain in the DNS :-)
#
# =====
#
# Notes:
# 1) If you want the fax to be submitted as an user other than fax (uucp),
# then replace
# flags= user=fax argv=/usr/bin/faxmail -d -n ${user}
# with
# flags= user=<anyuser> argv=/usr/bin/faxmail -d -n ${user}
# Do not use 'root' ...
# 2) faxmail automatically gets the 'from' identity (to be used for email
# notifications by HylaFAX) from the email headers; should you find the
# address is not detected correctly you can try replacing
# flags= user=fax argv=/usr/bin/faxmail -d -n ${user}
# with
# flags= user=fax argv=/usr/bin/faxmail -d -n ${user} ${sender}
# If you want the email contact to be the same for all the fax submitted
# via email, then use
# flags= user=fax argv=/usr/bin/faxmail -d -n ${user}
#
##################################################
USER=$1
RECIPIENT=$2
SENDER=$3
TMPVAR=${USER//\`/}
TMPVAR=${TMPVAR//\$\(/}
USER=${TMPVAR//\)/}
TMPVAR=${RECIPIENT//\`/}
TMPVAR=${TMPVAR//\$\(/}
RECIPIENT=${TMPVAR//\)/}
TMPVAR=${SENDER//\`/}
TMPVAR=${TMPVAR//\$\(/}
SENDER=${TMPVAR//\)/}
# Try the commented out command if this does not work...
FAXNO=`/usr/bin/expr "$RECIPIENT" : '.*@\(.*\)\.fax$'`
#FAXNO=`/usr/bin/expr \"$RECIPIENT\" : '.*@\(.*\)\.fax$'`
/usr/bin/faxmail -n -d "${USER}@${FAXNO}" ${SENDER}
FINAL ==========================================================++-
La manera al estilo de hylafax es casi la misma que la del FAQ del
postfix, sólo que en vez de llamar a "faxmail" (binario) se llama a
"mailfax", el script de arriba. Y ese script lo que hace es unicamente
llamar a "faxmail" con los parámetros adecuados.
O sea, al final lo que hace es convertir el texto del emilio en un fax.
Estamos igual que antes.
Quizás en este punto es donde aplica lo que dice en
http://www.hylafax.org/content/Email_to_Fax_Gateway. A ver si lo pongo
en claro.
En /etc/hylafax/hyla.conf
# This line tells hylafax(faxmail) to decode attachments using scripts
# located here.
MIMEConverters: /var/spool/hylafax/mimetype
#
Sólo que en SuSE está en "/usr/lib/fax/hyla.conf". Y la linea a
añadir sería no la de arriba, sino:
MIMEConverters: /var/spool/fax/mimetype
Que es un directorio a añadir, con este arbol:
...fax/mimetype/
...fax/mimetype/application/pdf
...fax/mimetype/application/ps
...fax/mimetype/image/tiff
Y dentro de cada uno un script al que se le pasará en $1 el nombre de un
fichero que contiene el anexo del formato adecuado, y que deberá sacar por
la salida estandar postscript. No dice el nombre que debe tener el script,
tan sólo que lo hagamos ejecutable.
#!/bin/sh
#/application/pdf
# convert PDF attachment to Postscript for Hylafax to send
pdf2ps $1
!/bin/sh
#/application/ps
# convert PS attachment to Postscript for Hylafax to send
echo $1
#!/bin/sh
#/image/tif
# convert TIF attachment to Postscript for Hylafax to send
/usr/bin/tiff2ps $1
Tengo la sospecha de que haciendo unicamente eso el "faxmail" procesa los
anexos. A ver... si, creo que es eso, hay referencias a "mimeonverters"
en faxmail.c++.
Pruébalo y me cuentas ;-)
Lo que nos falta - si funciona - es una manera de que al remitente se le
envíe una copia procesada del ps (o pdf convertido) de lo que ha enviado.
También se puede mirar en que consiste esto que dice el faxgateway.html:
| Dirk Husemann has contributed a more elaborate system; the README file
| is accessible in the user contributed software area on the master FTP
| server.
Creo que es en "ftp.sgi.com/sgi/fax/contrib/dirks-faxmailer". Si, le he
echado un vistazo, y es más complejo:
|The FAX server will allow you to
|
| o send normal email and have it transmitted as FAX
| o use FAX addresses that are understood by almost all mail user
| agents o take advantage of the capabilities of FlexFax (such as
| delayed transmission, cover page generation, formatting of email,
| manipulating FAX jobs)
| o have an easy to use interface that works from any Unix* machine
| that understands about electronic email
| o receive facsimiles using multimedia mail
| o do authorization checking
- --
Saludos
Carlos E. R.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Made with pgp4pine 1.76
iD8DBQFFNrAEtTMYHG2NR9URAm1FAJ9FLSxPnL1RPCSKYCp1VTfM9QEQxgCfaCni
g5BHXbWxDEeTUq1rQIv0hP4=
=7JLz
-----END PGP SIGNATURE-----