HylaFAX The world's most advanced open source fax server

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

[hylafax-users] fax in jpeg: the complete method



Hey all,

A litle help to make the faxes recived in jpeg format:

First install imagemagick if you don't have it.

update the /var/spool/hylafax/bin/faxrecvd script like this:

     if [ "$FILETYPE" = "tif" ]; then
         echo "Content-Type: image/tiff; name=\"$FILENAME.tif\""
         echo "Content-Description: FAX document"
         echo "Content-Transfer-Encoding: $ENCODING"
         echo "Content-Disposition: attachment; filename=\"$FILENAME.tif\""
         echo ""
         encode $FILE;
#new lines from here
     elif [ "$FILETYPE" = "jpg" ]; then
         echo "Content-Type: image/jpeg; name=\"$FILENAME.jpeg\""
         echo "Content-Description: FAX document"
         echo "Content-Transfer-Encoding: $ENCODING"
         echo "Content-Disposition: attachment; filename=\"$FILENAME.tif.jpg\""
         echo ""
         convert $FILE $FILE.jpg
         encode $FILE.jpg;
#new lines till here
     elif [ "$FILETYPE" = "pdf" ]; then
         echo "Content-Type: application/pdf; name=\"$FILENAME.pdf\""
         echo "Content-Description: FAX document"
         echo "Content-Transfer-Encoding: $ENCODING"
         echo "Content-Disposition: attachment; filename=\"$FILENAME.pdf\""
         echo ""
         $TIFF2PDF -o $FILE.pdf $FILE
         encode $FILE.pdf
         $RM -f $FILE.pdf 2>$ERRORSTO

and add the file
FaxDispatch to /var/spool/hylafax/etc with this contents:
FILETYPE=jpg;

Thats all.
This way the user will recive the mail in jpeg format.

Hope it was usefull,
Regards,
Peter





Project hosted by iFAX Solutions