Hylafax Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] Email to Fax Gateway: *with* PDF. How?



Lee Howard escreveu:

On 2004.11.04 12:46 Louie Gonsalves wrote:

Greetings.

New hylafax user.  Got it to do all I want, save for one, small,
crucial
item.

From reading through the docs, howtos, googling, etc, there does not
seem a
way to send an email containing a pdf attachment to hylafax, to have
the pdf
itself faxed to a fax machine?

I see so much confusion over this in the list -- is it, or is it not
possible to do this?  I have to think it is -- since I got the thing
to
email me a PDF of an incoming fax.  Why can't the reverse be true?

If it *is* possible, then can someone point me to the right docs?
What I've
found so far is completely non-functional.

Alternatively, are there any windows clients that will allow this?
whfc
won't do it, cypheus tries but fails.


HylaFAX server can accept PDFs and will fax them. Whether or not the client program knows how to handle it, I don't know. sendfax knows how to handle PDFs.

As for email-to-fax with PDF attachments, yes, it can be done.

You can use faxmail, but you have to teach faxmail (in the MIME type handlers) to know how to handle "application/pdf" type. I've never done this.

I've always just written a faxmail replacement with a little bit of shell code working as a MIME-decoder and wrapper around sendfax.

Lee.



Ok, you can a e-mail to fax server, with a PDF attachment right?
I had the same problem with this, i send a message in the Hylafax forum
and i received this return:


E-mail to Fax+Sendmal :


1 -   Sendmail installed and running in the Fax server
2 -   Create a user account
Ex.:
adduser faxgw

3 -   Create a file in /home/faxgw/.forward with this command in file:
"| /var/spool/hylafax/bin/faxgw" our directory of Hylafax Server installed

4 -   I send attached a perl script faxgw, this is run sendfax with mail
received from client in faxserver

5 - Send a mail to faxserver:

To: faxgw@faxserver_address
Subject: Number_Of_Fax|Hour_to_Send|Subject
Ex.:        33333333333|13:21|This is a fax for my Mother...
Attach:  File.pdf or File.tiff


Obs.: This script work for PDF and TIFF, but not for html attachment. In recent version of Sendmail for security, you need make a copy of faxgw script to /etc/smrsh Doubts search in Hylafax forum with this text: FAXGW


Good Bye!






#!/usr/bin/perl
use MIME::Parser;
use POSIX;

my $tmp = "/tmp/mail-$$";
mkdir $tmp, 0700;
my $log_file = "/var/log/faxgw";

my $parser = new MIME::Parser;
$parser->output_under($tmp);

my $entity = $parser->parse(\*STDIN);

my @parts;
my @entities = ($entity);

while ($_ = shift(@entities))
{
    my @p;
    if (@p = $_->parts)
    {
        unshift @entities, @p;
    } else
    {
        push @parts, $_;
    }
}

my $from = $entity->head->get('From');
$from =~ s/\n//go;
my $oldsubject = $entity->head->get('Subject');
($num,$hour,$subj) = split(/\|/,$oldsubject,3);

my $number = $num;
my $subject = $subj; 
my $timetosend = $hour; 
my $maxdials = "10";

system( "/bin/sendfax",
        "-n",
	"-R",
	"-T", $maxdials,
	"-a", $timetosend,
        "-f", $from,
        "-r", $subject,
        "-d", $number,
        map ({$_->bodyhandle->path() } @parts)
);

system("/bin/rm", "-rf", $tmp);

my $logmessage = strftime("%d.%m.%Y %H:%M:%S", localtime) . " Sent fax, from: $from, to: $number, regarding: $subject.\n";
open (my $log, ">>", $log_file) || die "Could not open $file for append: $!";
print $log $logmessage;
close $log;


Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services