HylaFAX The world's most advanced open source fax server

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

Re: [hylafax-users] faxing multiple documents using sendfax & STDIN



* Ross McKerchar <it@xxxxxxxxxxxx> [060118 11:20]:

> >What is this application written in? It may be just as easy to hand the
> >documents of to HylaFAX (hfaxd) directly instead of invoking sendfax.
> >Perl's Net::FTP is great for this.
>
> Yes, this sounds like a good idea. I just had a quick search but it 
> wasn't obvious to me how I do this- have you got any pointers? I 
> currently have a perl script that simply prints the postscript to stdout 
> from an I/O handle on the entity (actually a MIME:Entity from the 
> MIME-tools package).

Something simple I had laying around:
	use Net::FTP
	my $ftp = Net::FTP->new($OPTIONS{hylafax}, Debug => ($OPTIONS{debug} > 2), Port => $OPTIONS{port})
		  or die "Cannot connect to $OPTIONS{hylafax}: $@";

	$ftp->login('poison') or die "Couldnt' login in: $@";
	$ftp->put("$ENV{HOME}/files/music.pdf", "/tmp/poison.pdf");
	$ftp->quot('JOB', 'default');
	$ftp->quot('JPARM', 'FROMUSER poison');
	$ftp->quot('JPARM', 'LASTTIME 000300');
	$ftp->quot('JPARM', 'MAXDIALS 1');
	$ftp->quot('JPARM', 'MAXTRIES 1');
	$ftp->quot('JPARM', 'NOTIFYADDR faxmaster');
	$ftp->quot('JPARM', 'VRES 98');
	$ftp->quot('JPARM', 'PAGEWIDTH 215');
	$ftp->quot('JPARM', 'PAGELENGTH 279');
	$ftp->quot('JPARM', 'NOTIFY none');
	$ftp->quot('JPARM', 'PAGECHOP default');
	$ftp->quot('JPARM', 'CHOPTHRESHOLD 3');
	$ftp->quot('JNEW');
	$ftp->quot('JPARM', "DOCUMENT /tmp/poison.pdf");
	$ftp->quot('JPARM', "DIALSTRING", parse_dial($dest) );
	$ftp->quot('JSUBM');

If you want to use the HylaFAX "STOT" to store a temp file that hfaxd
will delete when you disconnect, you need a slightly patched FTP.pm
	http://people.ifax.com/~aidan/hylafax/perl/
I just put int in a local include and don't touch the system FTP.pm.

a.

-- 
Aidan Van Dyk                                             aidan@xxxxxxxx
Senior Software Developer                          +1 215 438-4638 x8103
iFAX Solutions, Inc.                                http://www.ifax.com/

Attachment: signature.asc
Description: Digital signature




Project hosted by iFAX Solutions