Discussion:
[hylafax-users] EMail to fax with a separate mail server
(too old to reply)
Rolf Ackermann
2009-02-10 06:00:59 UTC
Permalink
Hi folks

Has anybody an idea how to create a email-to-fax service if the email
server and the fax server are on different machines?

Kind regards from switzerland

Rolf (aka spieler67)


____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-***@hylafax.org < /dev/null
*To learn about commercial HylaFAX(tm) support, mail ***@ifax.com.*
James Lamanna
2009-02-10 06:06:35 UTC
Permalink
Rolf-
Post by Rolf Ackermann
Hi folks
Has anybody an idea how to create a email-to-fax service if the email
server and the fax server are on different machines?
What I do is I use a custom python script to send the email using SMTP
and not sendmail.
I have a python script that accepts the same arguments that get passed
to sendmail
and then I set the SENDMAIL environment variable in FaxDispatch to that script:

The python script looks like this (this is for Hylafax+ 5.2.8):

if __name__ == '__main__':
if len(sys.argv) < 2:
sys.exit(1)

from_addr = to_addr = None

parse_msg = False

optlist, args = getopt.getopt(sys.argv[1:], 'f:oi:t')
for arg, v in optlist:
if arg == '-f':
from_addr = v
elif arg == '-i':
to_addr = v
elif arg == '-t':
parse_msg = True

if not from_addr or not to_addr:
sys.exit(2)

to_addr_set = False

msg = ''
for line in sys.stdin:
if line[:3] == 'To:' and not to_addr_set:
to_addr = line[4:]
to_addr_set = True
msg += line

to_addr_list = to_addr.split(',')

server = smtplib.SMTP('mail.mycompany.com')
server.sendmail(from_addr, to_addr_list, msg)
Post by Rolf Ackermann
Kind regards from switzerland
Rolf (aka spieler67)
-- James
Post by Rolf Ackermann
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-***@hylafax.org < /dev/null
*To learn about commercial HylaFAX(tm) support, mail ***@ifax.com.*
Rolf Ackermann
2009-02-10 09:28:42 UTC
Permalink
Hi James

JL> What I do is I use a custom python script to send the email using SMTP
JL> and not sendmail. I have a python script that accepts the same arguments
JL> that get passed to sendmail and then I set the SENDMAIL environment
JL> variable in FaxDispatch to that script:
Thanks for your answer, but I've probably described the problem the wrong
way.

On my network I have an email server on one machine and the HylaFax server on
the other machine. My goal is to send an email to my mail server and the
mail server
transfers the incoming "fax email" to the HylaFax server to send it to a fax.

I've seen the description how to setup an email-to-fax solution but this
description (even if it works for all other users) doesn't work for my
environment (circular reference because I'm using a smart host
configuration).

I'm searching for a solution (probably with API calls or a script) to
initiate a send job from my email server.

Kind regards
Rolf (aka spieler67)



____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-***@hylafax.org < /dev/null
*To learn about commercial HylaFAX(tm) support, mail ***@ifax.com.*
Chris Weiss
2009-02-10 13:48:22 UTC
Permalink
Post by Rolf Ackermann
Hi James
JL> What I do is I use a custom python script to send the email using SMTP
JL> and not sendmail. I have a python script that accepts the same arguments
JL> that get passed to sendmail and then I set the SENDMAIL environment
Thanks for your answer, but I've probably described the problem the wrong
way.
On my network I have an email server on one machine and the HylaFax server on
the other machine. My goal is to send an email to my mail server and the
mail server
transfers the incoming "fax email" to the HylaFax server to send it to a fax.
I've seen the description how to setup an email-to-fax solution but this
description (even if it works for all other users) doesn't work for my
environment (circular reference because I'm using a smart host
configuration).
possibly you could install the client pieces of hylafax on the email server...

however, it's fairly easy to install exim or postfix on the hylafax
server, you are going to want a subdomain for the faxes anyway unless
you want to write a complicated mail receive script.


____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-***@hylafax.org < /dev/null
*To learn about commercial HylaFAX(tm) support, mail ***@ifax.com.*
Siri Vias Khalsa
2009-02-10 14:37:23 UTC
Permalink
If you installed hylafax on the email server, you could indeed use faxsend to submit the faxes to the hylafax server. You would have to modify the script to specify that the hylafax server was on a different host.
However, it is usually cleaner to do as Chris recommends below, to use a subdomain like fax.domain.tld and forward all emails for that domain to a mail server on the hylafax host. An email sent to the fax gateway would look something like - ***@fax.domain.tld. If you didnt have that fax subdomain, the email address would need to be more complicated and your script and routing would need to be more discriminating to decide which emails were faxes etc.


-Siri Vias



-----Original Message-----
From: hylafax-users-***@hylafax.org on behalf of Chris Weiss
Sent: Tue 2/10/2009 5:48 AM
To: ***@spin.ch
Cc: hylafax-***@hylafax.org
Subject: Re: [hylafax-users] EMail to fax with a separate mail server
Post by Rolf Ackermann
Hi James
JL> What I do is I use a custom python script to send the email using SMTP
JL> and not sendmail. I have a python script that accepts the same arguments
JL> that get passed to sendmail and then I set the SENDMAIL environment
Thanks for your answer, but I've probably described the problem the wrong
way.
On my network I have an email server on one machine and the HylaFax server on
the other machine. My goal is to send an email to my mail server and the
mail server
transfers the incoming "fax email" to the HylaFax server to send it to a fax.
I've seen the description how to setup an email-to-fax solution but this
description (even if it works for all other users) doesn't work for my
environment (circular reference because I'm using a smart host
configuration).
possibly you could install the client pieces of hylafax on the email server...

however, it's fairly easy to install exim or postfix on the hylafax
server, you are going to want a subdomain for the faxes anyway unless
you want to write a complicated mail receive script.


____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-***@hylafax.org < /dev/null
*To learn about commercial HylaFAX(tm) support, mail ***@ifax.com.*
Continue reading on narkive:
Loading...