| 
     Hylafax Mailing List Archives
 | 
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
Re: [hylafax-users] Send out pdf attachment
hylafax-users-bounce@xxxxxxxxxxx a écrit :
Hi,
 Sorry for this question, I know it was asked 100 times but I can't find any working solution. I tried lot of solution I found on the mailling list but none works.
Someone could help me and give to me a complete way to send pdf attachment ?
Thanks for your answer
Best regards,
 
Bonjour,
Je viens justement de le mettre en place sur une red hat 7.3 avec la 
version 4.2.0.
La solution se trouve dans le man de faxmail : ajouter un paramètre
MimeConverters "/some/directory"
Voici l'extrait du man en question
############################
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, 
application/postscript, and application/x-faxmail-prolog.  Parts can
      also be processed through external processing scripts that 
faxmail looks for in a ``MIME converters'' directory hierarchy.   External
      scripts may override builtin processing or supplement the builtin 
support.  For each MIME body part with type T and subtype S faxmail
      checks first for an executable script named T/S in the converter 
hierarchy.  If a script exists then it is  run  and  the  result  is
      appended  to the output PostScript document.  Otherwise if the 
part has builtin support then it is processed directly.  Any part that
      does not have external or builtin support is discarded and 
replaced by a message that indicates the part was removed.  This discarded
      message can be suppressed with the MarkDiscarded configuration 
parameter (also settable with an X-FAX-MarkDiscarded line in the enve-
      lope).
############################
dans le fichier hyla.conf. Sur ma configuration, il se trouve dans 
/etc/hylafax
A partir de ce moment, à chaque fois qu'il va trouver un type mime (dans 
le cas de pdf, application/pdf)
faxmail va regarder s'il n'existe pas un script dans le répertoire 
spécifier en paramètre de MimeConverters.
Dans le cas d'un pdf, si j'ai mis MimeConverters : 
"/var/spool/hylafax/mimetype", il va chercher ce script
/var/spool/hylafax/mimetype/application/pdf
Faxmail creer ensuite un fichier temporaire dans /tmp qui contient du 
postscript, il faut donc mettre ce petit script shell:
#!/bin/bash
/usr/bin/pdftops $1
pdftops est un executable obtenu avec xpdf, que j'utilise à la place de 
pdf2ps sur les conseils de quelqu'un de cette mailing list. $1 
correspond au fichier temporaire.
ATTENTION, j'ai remarquer qu'outlook (au moins 2002 et 2003) ne gérait 
pas d'une façon standard les types mime. Si l'on rédige le message en 
html, le type mime, même avec un attachement sera text/html et le script 
ne sera donc jamais appelé. Il faut forcer pour ce message une 
composition en texte brut.
Personnellement j'utilise aussi le filter.pl donné quelque part dans la 
mailing list
#######################
#!/usr/bin/perl
# Read from the standard input
@text=<STDIN>;
$size=@text;
# Count the number of "showpage"
$count=0;
for($i=0;$i<=$size;$i++){if($text[$i] =~ /showpage/){$count++;}}
# Discard the last line that contain "showpage"
$num=1;
for($i=0;$i<=$size;$i++){
       if($text[$i] =~ /showpage/){
               if($num!=$count){$num++;}
               else{$text[$i]=~s/showpage//g;}
       }
               print $text[$i];
}
#######################
et mon script pdf est le suivant
#!/bin/bash
/bin/echo " "
/bin/echo "showpage"
/usr/bin/pdftops $1 - | /var/spool/hylafax/mimetype/filter.pl
Il faut faire attention à laisser les droits en exécution à 
l'utilisateur  uucp sur les script (et bien sur qu'il puisse y accéder), 
j'ai personnellement fait un chown -R uucp:uucp /var/spool/hylafax/mimetype
En espérant avoir aidé.
--
Benjamin ALLOT
____________________ 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@xxxxxxxxx*