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] Notify Problems with Attachments



* Carl Carstenson <carlc@xxxxxxxxxx> [070219 13:13]:
> I want to share issues that I have with the notify process used for
> sending emails concerning fax deliveries. I am running Hylafax 4.3.2 on
> Red Hat Enterprise Linux AS release 3. This version corrected a problem
> with 4.3.1 where the body of the email was not being sent. I have found
> two other issues concerning attachments. The first has to do with
> Hylafax creating a .ps file in docq, but the file is really a pdf file.
> The original file sent from the client is a pdf. The Hylafax environment
> knows that it is a pdf, but the extension is incorrect. Another problem
> has to do with the requested attachment type set in FaxNotify by using
> RETURNFILETYPE=pdf". If the filetype is already in the correct format,
> the ConvertFile macro does not return a filename and therefore no
> attachment is sent. Probably not the intent.
> 
> I was able to overcome these two problems by modifying ConvertFile in
> the bin/common-functions file. I added these three lines to the pdf
> conversion right after the "Nothing necessary" message is sent to the
> log.
> 
>                     name="`basename $1 .ps`"
>                     cp $1 $TMPDIR/$name.pdf
>                     echo "$TMPDIR/$name.pdf"

Good catch.  We definitely need the echo.  

As to the name - it's probably a good idea to do something with a name
change too.  We could also link it instead of copy it.

But that the filename is something.ps is indicative of the client
submitting it as a Postscript file, not a PDF file.  

With sendfax from 4.3.2 (and the recent typerules files), sendfax
submits PDF files as PDF files, and they end up with .pdf names:

	rule: offset 0 string = "%PDF" -- success (result pdf, rule "")
	Apply DisplayNumber rules to "8230"
	--> return result "8230"
	-> FORM PDF
	200 Format set to PDF.
	-> TYPE I
	200 Type set to Image.
	SEND data, 277412 bytes
	-> PORT 127,0,0,1,176,21
	200 PORT command successful.
	-> STOT
	150 FILE: /tmp/doc263.pdf (Opening new data connection).
	226 Transfer complete (FILE: /tmp/doc263.pdf).
	-> JNEW



Older clients often just submit PDF files as PostScript documents. But
HylaFAX server is smart enough to handle PDF files even when they are
submitted as PostScript files, and historically, we have accepted PDF
files as Postscript and not complained, so we should include something
like that as well.

But that change as you have it means that people could possibly get
attachments named doc262.pdf.pdf (when the document is properly
submitted as a PDF file so is named docXXXXXXXX.pdf).

What about using something like:

	name=`echo $1 | sed -e 's/[.][^.]*$//'
	ln -s $1 $TMPDIR/$name.pdf

I tried this, or checked if the mime converters actually handle symlinks
properly.

a.


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

Attachment: signature.asc
Description: Digital signature




Project hosted by iFAX Solutions