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] process pdf-attachments with faxmail

At 02:14 AM 5/26/01 +0200, Niklaus Hug wrote:
>My hylafax is running. I can even send pdf's with the sendfax command and
>also faxmail ist working properly with qmail. Now i'm looking for a solution
>how to fax pdf attachments. I've read in the docu that there is a
>possibility to set up a script (in this case it's filename is "pdf"?) below
>the conversion path in the form "../application/pdf"
>Is there anyone who got this setup already working?

I don't think so.  Server-side PDF conversion is relatively new to HylaFAX.
 You'll also note that faxmail doesn't even handle faxing TIFF attachments,
and that format been around forever in HylaFAX use... no surprise that
faxmail can't do PDFs.

You can send a PDF *directly* to hfaxd without prepending it with all that
postscript junk that faxmail loves to tack onto everything.  How to do
that, I don't know.  But, you'd do something like (this is dysfunctional):

--- hylafax.orig/faxmail/faxmail.c++	Mon May 21 10:19:16 2001
+++ hylafax/faxmail/faxmail.c++	Sat May 26 00:49:41 2001
@@ -522,6 +522,8 @@
 	    fwrite((const char*) buf, buf.getLength(), 1, fout);
 	if (!withinFile) beginFile();
 	withinFile = true;
+    } else if (mime.getSubType() == "pdf") {
+	formatWithExternal(fd, "bin/pdf2fax", mime);
     } else if (mime.getSubType() == "x-faxmail-prolog") {
 	copyPart(fd, mime, clientProlog);	// save client PS prologue
     } else {

Problem in this case is that hfaxd calls on bin/pdf2fax, so faxmail doesn't
need to.  All that faxmail should do here is send the pdf file after the
postscript stream/file... but I don't think that faxmail behaves that way
(utilizing muliple files).  So what may need to happen is to do a pdf->ps
conversion to append the body Postscript with the PDF Postscript.

Well, the result is really this: faxmail isn't intended to send
attachments, really.  Okay, so it will send Postscript attachments, and
that's about it, but mostly faxmail is an email-to-fax (text-only e-mail)
system, and not a files-to-fax system (like sendfax).  My recommendation
for you would be to look into setting up a procmail script which utilizes
metamail to save the attachments as files and then calls on sendfax to fax
out the files.  This can be done in a variety of ways and is quite
powerful.  See:
(under RelayFax) for a good example of how this can be done.


____________________ HylaFAX(tm) Users Mailing List _______________________
 To unsub: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null

Project hosted by iFAX Solutions