I've got a working installation of hylafax 4.1.x talking with sendmail.
I'd like to send faxes via e-mail and receive them via e-mail. E-mail
without attachments goes to fax no problem. The big hurdle right now
is getting either sendfax or faxmail to decode outbound pdf
attachments and also incoming faxes sent to a specified address.
Everytime I attempt to send an e-mail with a pdf to fax, I get
"DISCARDED application/pdf GOES HERE". I've been combing through
hylafax archives without a good script to get faxmail (or sendfax) to
pipe through a converter like pdf2ps, because as I understand it -
faxmail does not natively support pdf attachments...mostly just ps.
I'd love a push in the right direction - been googling for hours.
Thanks!
Robert
____________________ HylaFAX(tm) Users Mailing List _____________________
__
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.c
gi
On UNIX: mail -s unsubscribe hylafax-us...@hylafax.org < /dev/nu
ll
*To learn about commercial HylaFAX(tm) support, mail sa...@ifax.com.*
I've got a Debian Sarge install with Postfix and
Hylafax 4.1.x. I've been trolling for information for
this for ages with no firm answer.
From what I understand, you need to set the
postfix/sendmail/exim mail filter mangle up to handle
e-mails, which it sounds like you have in place. The
next thing is you have to setup a MIME converter to
handle the conversion from pdf to ps. This is where I
am at present.
I'll send you what I have (which isn't much), to see
if you can get any further than myself. If you have
any success, I'd be grateful to know.
Here's the fax section of /etc/hylafax/hyla.conf:
<snip>
MIMEConverters: /usr/bin/hylamail/application
<end-snip>
Here's /usr/bin/hylamail/filter.pl:
<snip>
#!/bin/bash
/bin/echo " "
/bin/echo "showpage"
/usr/bin/pdftops $1 | /usr/bin/hylamail/filter.pl
cipher:/usr/bin/hylamail/application# cat
/usr/bin/hylamail/filter.pl
#!/usr/bin/perl
# Read from the standard input
@text=<STDIN>;
$size=@text;
# Count the number of "showpage"
$count=0;
for($i=0;$i<=$size;$i++){if($text[$i] =~
/showpage/){$count++;}}
# Discard the last line that contain "showpage"
$num=1;
for($i=0;$i<=$size;$i++){
if($text[$i] =~ /showpage/){
if($num!=$count){$num++;}
else{$text[$i]=~s/showpage//g;}
}
print $text[$i];
}
<end-snip>
Here's /usr/bin/hylamail/application/pdf:
<snip>
#!/bin/bash
/bin/echo " "
/bin/echo "showpage"
/usr/bin/pdftops $1 | /usr/bin/hylamail/filter.pl
<end-snip>
Here's the fax section of /etc/postfix/transport:
<snip>
fax fax:localhost
<end-snip>
Here's the fax section of /etc/postfix/master.cf:
<snip>
# use for hylafax
fax unix - n n - 1
pipe
flags= user=fax argv=/usr/bin/faxmail -d -n ${user}
${sender}
<end-snip>
Here's the fax section from /etc/postfix/main.cf:
<snip>
# use for hylafax
transport_maps = hash:/etc/postfix/transport
fax_destination_recipient_limit = 1
<end-snip>
The filter.pl and postfix stuff came stright from the
hylafax source as the faxmail-postfix mangle. I've
set postfix to accept only the @fax domain and
automatically send out any e-mail destined for
<number>@fax to be send via hylafax to <phonenumber>.
As with the stage you are at, I cannot get the
filter.pl to automatically strip any pdf attachments,
convert them to ps and tack them on the end of the
fax. It's been driving me crazy for ages.
I think if we are able to get this working, we should
get it added as a fully documented section in the
hylafax documentation.
Ben
Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com
>I'd like to send faxes via e-mail and receive them via e-mail. E-mail
>without attachments goes to fax no problem. The big hurdle right now
>is getting either sendfax or faxmail to decode outbound pdf
>attachments and also incoming faxes sent to a specified address.
>
>
You say "sendfax or faxmail" but really you just mean "faxmail" because
sendfax can handle PDF natively just fine.
The best thing that you could do for yourself is to follow the faxmail
instructions, as you have, but write your own version of faxmail in your
favorite programming language (shell, php, perl, python, whatever).
Assuming that you have uudecode available to you doing writing a faxmail
replacement will amount to under 100 lines of code, a few hours of
work... and in the end you have something more versatile and more
understandable than faxmail can be.
Lee.
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
1.) I am not a programmer, so I can't just throw anything together.
2.) Why isn't the current distribution updated to make it so that
faxmail *can* handle PDF? (especially if it is so easy, and so many
others have already invented this wheel, it seems.)
Tom
You've chosen this point in the chain to ask for support, but why create
PDF's in the first place, forcing multiple conversions? Many people don't
have this issue, either.
Please don't take this badly; I mean only to answer your question, and
gently suggest that perhaps email-to-fax isn't your wisest choice. If
you're sending faxes from Windows, for example, print-to-fax may make a
heck of a lot more sense.
All you have to do is name the file the number you want to fax it to.
It uses cron to check the share every minute, if something is there, it
faxes it to the number that it's named, and then moves it. If there is
nothing there, it just exits. It's also designed to grab multiple
files, if there are more than one. I'm sure with some tweaking you can
get it to do thing other ways as you see fit as well.
All you have to do is name the file the number you want to fax it to.
A great way to do faxing from windows in my book, we are going to use it
with a VB "speed dial" app that I haven't gotten around to writing yet.
Conlan Adams
____________________ HylaFAX(tm) Users Mailing List _____________________
__
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.c
gi
> I have seen this about 500 times on the list and it always elicits the
> same response from me:
>
> 1.) I am not a programmer, so I can't just throw anything together.
I don't mean to sound elitist, but HylaFAX does require a fair amount of
skill to get customized and working ideally. For example, FaxDispatch
customization requires at least *some* shell skills. Then there's
FaxNotify, DynamicConfig, and others. These were all meant for
customization. Sure, HylaFAX works without them being touched, and that's
the idea. But when someone wants to take HylaFAX beyond the defaults,
then some skill is required to make that happen.
So my point is that when a HylaFAX administrator wants to take HylaFAX
beyond the defaults then they need to either 1) have some skills to make
that happen, or 2) get someone to do it for them.
> 2.) Why isn't the current distribution updated to make it so that
> faxmail *can* handle PDF?
faxmail works by blindly throwing a PostScript wrapper around all files it
gets and then delivers those to hfaxd. So if you submit ASCII text it
gets a PostScript wrapper. If you send PostScript then it gets a
PostScript wrapper around the PostScript. You can't take this approach,
however, with much of anything else including TIFF and PDF. So
consequently faxmail would pretty much need to be rewritten entirely to
natively handle PostScript. That said, it has already been mentioned on
this list that faxmail can be configured to handle PDF (see "External
scripts..." in the faxmail man page). I'll admit, though, that the
documentation is difficult to follow, and I've never actually heard of
anyone doing it. Honestly, I'd say that it's probably as easy to rewrite
faxmail as it is to write one of those conversion scripts.
So, anyway, extending faxmail doesn't appear to be something that
developers are interested in doing on their own motivations.
> (especially if it is so easy, and so many
> others have already invented this wheel, it seems.)
It's a customization in each case. It's not something, really, that you
expect to be useful for others. If I gave you one of my faxmail
replacements then you would be pretty much required to know shell
scripting in order to get it working for you. And so you'd ask me to do
it for you, and it would just go to reconfirm my statements above that if
you can't customize it yourself you'll need to get someone to do it for
you.
Lee.
> On Fri, 15 Apr 2005, Tom Rymes wrote:
>
>> I have seen this about 500 times on the list and it always elicits the
>> same response from me:
>>
>> 1.) I am not a programmer, so I can't just throw anything together.
>
> I don't mean to sound elitist, but HylaFAX does require a fair amount
> of
> skill to get customized and working ideally. For example, FaxDispatch
> customization requires at least *some* shell skills. Then there's
> FaxNotify, DynamicConfig, and others. These were all meant for
> customization. Sure, HylaFAX works without them being touched, and
> that's
> the idea. But when someone wants to take HylaFAX beyond the defaults,
> then some skill is required to make that happen.
>
> So my point is that when a HylaFAX administrator wants to take HylaFAX
> beyond the defaults then they need to either 1) have some skills to
> make
> that happen, or 2) get someone to do it for them.
I agree 100%, and I don't expect help for free. I was suggesting that,
due to the large number of requests that seem to pop up here, this
might be a good feature to consider implementing, thus making it part
of the "default". The only reason I even suggest it at all is that the
usual response to the questions ("Throw something together in perl,
it's really easy.") suggests that it would not be very difficult.
[snip]
>> (especially if it is so easy, and so many
>> others have already invented this wheel, it seems.)
>
> It's a customization in each case. It's not something, really, that
> you
> expect to be useful for others. If I gave you one of my faxmail
> replacements then you would be pretty much required to know shell
> scripting in order to get it working for you. And so you'd ask me to
> do
> it for you, and it would just go to reconfirm my statements above that
> if
> you can't customize it yourself you'll need to get someone to do it for
> you.
OK, this makes sense, but I would think that some reasonable "standard"
settings could be chosen, leaving the user to their own devices if they
want to deviate from the default standard settings.
I'm not complaining here, until I start contributing code myself, I'm
just happy to have such a great program to use! However, I think that
the PDF attachment to fax would be a great feature for a number of
current and potential users. Someone asked why do this instead of
print-to fax, and there are various reasons, such as not wanting to
configure a printer on all of my client PCs. Also, it makes it easier
to use multiple platforms, not to mention I could then send a fax
easily when I was out on the road by sending an e-mail. I could set it
so that I can send an occasional fax from home without messing about
with firewall settings, client programs on my home PC, etc.
Not looking a gift horse in the mouth, I swear,
Tom
> The only reason I even suggest it at all is that the
> usual response to the questions ("Throw something together in perl,
> it's really easy.") suggests that it would not be very difficult.
No it isn't too hard, but it is usually system|setup specific, to a
degree.
Matt
I'm posting because there doesn't seem to be a very clear posting on
how to get this going (at least using faxmail - thanks for the
suggestion to roll my own faxmail, Lee, but I don't have the chops)
and it's really helpful to be able to have faxmail convert and fax
pdfs. Neither the perl or bash scripts are my work and I relinquish
all credit to whom made them (I think it was Chris).
Here's my setup:
1) /etc/hylafax/hyla.conf
added the following line:
MIMEConverters: /usr/local/faxscripts/
2) pasted the filter.pl script at /usr/local/faxscripts
<cut and paste me into /usr/local/faxscripts/filter.pl>
#!/usr/bin/perl
# Read from the standard input
@text=<STDIN>;
$size=@text;
# Count the number of "showpage"
$count=0;
for($i=0;$i<=$size;$i++){if($text[$i] =~ /showpage/){$count++;}}
# Discard the last line that contain "showpage"
$num=1;
for($i=0;$i<=$size;$i++){
if($text[$i] =~ /showpage/){
if($num!=$count){$num++;}
else{$text[$i]=~s/showpage//g;}
}
print $text[$i];
}
3) Create /usr/local/faxscripts/application/pdf
<cut and paste me into /usr/local/faxscripts/application/pdf>
#!/bin/bash
/bin/echo " "
/bin/echo "showpage"
/usr/bin/gs -q -sPAPERSIZE=a4 -dBATCH -dNOPAUSE -r600x800
-sDEVICE=pswrite -sOutputFile=- $1 | /usr/local/faxscripts/filter.pl
4) Restart hylafax and test.
If my mailer mangles this message, my apologies.
Make sure gs is where it should be. Aaron's post has it in
/usr/local/bin/gs - check your distribution. Also, the resolution may
be totally off in ghostscript. It prints out great, but perhaps
there's a better choice for resolution then 600x800.
Thanks all,
Robert
On 4/14/05, Lee Howard <fax...@howardsilvan.com> wrote:
> Robert McIntosh wrote:
>
> >I'd like to send faxes via e-mail and receive them via e-mail. E-mail
> >without attachments goes to fax no problem. The big hurdle right now
> >is getting either sendfax or faxmail to decode outbound pdf
> >attachments and also incoming faxes sent to a specified address.
> >
> >
>
> You say "sendfax or faxmail" but really you just mean "faxmail" because
> sendfax can handle PDF natively just fine.
>
> The best thing that you could do for yourself is to follow the faxmail
> instructions, as you have, but write your own version of faxmail in you
r
> favorite programming language (shell, php, perl, python, whatever).
> Assuming that you have uudecode available to you doing writing a faxmai
l
> replacement will amount to under 100 lines of code, a few hours of
> work... and in the end you have something more versatile and more
> understandable than faxmail can be.
>
> Lee.
>
>
____________________ HylaFAX(tm) Users Mailing List _____________________
__
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.c
gi