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] Discarded application (pdf)

----- Original Message -----
Date: Wed  November 05, 2003  07:12 PM
From: Michele Della Marina <michele@xxxxxxxxxxx>
To: hylafax-users@xxxxxxxxxxx
Subject: Re: [hylafax-users] Discarded application (pdf)  

> Sorry if this problem was posted several times. But I have not clear
> ideas. I have hylafax 4.1.6, I have installed metamail and I use
> postfix and squirrelmail to send fax through email. Receiving fax
> converted in pdf is all ok.
> I would like send a pdf attachment but in receiver fax machine the
> error occurs: discarded application / octet-stream goes here. I have
> read that is not possible send pdf (only ascii and ps) But I have
> also read this (in manual typerules): ..
> I'm not sure if this message means that you try to use faxmail?
> faxmail isn't able to handle pdf. see "man faxmail" for details.
>         Only three types of files are accepted by the HylaFAX server for
> transmission as facsimile: POSTSCRIPT® files, PDF files, and TIFF
>         Class F (bilevel Group 3-encoded) files. All other types of files
>         must be converted to one of these two formats. ..
>         What is the problem? Why can't I send a pdf attachment? Thanks Michele
> -------------------------------------------------
What you need to configure is the local mail delivery 
(http://www.postfix.org/delivering.php) to strip off the pdf-attachment 
and pass it to sendfax.
man faxmail says:

        faxmail parses MIME mail messages and does some rudimentary work to:

        ·  strip out unprintable content such as audio, video, or binary 

        ·  decode encoded parts,

        ·  insert ``digest dividers'' between multipart/digest subparts,

        ·  format message/rfc822 parts as described above for the 
top-level envelope, and

        ·  optionally convert graphical parts (e.g. images) for display.

        MIME processing is fairly simple and (currently) somewhat 
constrained.  faxmail has  builtin  support
        for the following MIME parts: text/plain, multipart/mixed, 
multipart/digest, message/rfc822, applica­
        tion/postscript, and application/x-faxmail-prolog.

What you need is a handling for a different mime-type (application/pdf).

Thank you very much for your help.
I've decided to write a script (using mime) for converting pdf to ps
studying other scripts in archive (thank you Goldfish):

1.Adding a line in /etc/hylafax/hyla.conf to let hylafax knows where the
MIME decoder located.
MIMEConverters: /usr/bin/hyla_faxmail/
2.Adding a directory /usr/bin/hyla_faxmail/application
3.Adding a pdf file in /usr/bin/hyla_faxmail/application
4.Adding a filter.pl file in /usr/bin/hyla_faxmail

pdf file script:
/bin/echo " "
/bin/echo "showpage"
/usr/bin/pdf2ps $1 | /usr/bin/hyla_faxmail/filter.pl

filter.pl script:
# Read from the standard input
# Count the number of "showpage"
for($i=0;$i<=$size;$i++){if($text[$i] =~ /showpage/){$count++;}}
# Discard the last line that contain "showpage"
        if($text[$i] =~ /showpage/){
                print $text[$i];

But an error occurs when I send a mail to fax with pdf attachment:

Error: /undefined in ****
Operand stack:
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
2   %stopped_push   --nostringval--   --nostringval--   --nostringval--  
1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   .runexec2  
--nostringval--   --nostringval--   --nostringval--   2   %stopped_push  
--nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1056/1123(ro)(G)--   --dict:0/20(G)--   --dict:89/200(L)--  
Current allocation mode is local
GNU Ghostscript 7.05: Unrecoverable error, exit code 1

Could you help me please?
Thank you !


Another problem: when I send a ps attachment as email to fax with a message
in body of mail, the receiver fax machine reports only the attachment and no
body message.
I don't understand why it happens.

____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxxxxx*

Project hosted by iFAX Solutions