Avantfax won't send cover page and atta...

Debian
2010-08-16
2013-09-08
1 2 > >> (Page 1 of 2)
  • Fax with only cover is ok, but fax with cover and attachment send only attachment.

     
  • Dave
    Dave
    2010-08-17

    If you run this command, does it fix the problem?

    echo "CoverCmd: /var/www/avantfax/includes/faxcover.php" >> /etc/hylafax/sendfax.conf

     
  • No, the line (CoverCmd: /var/www/avantfax/includes/faxcover.php) is already in sendfax.conf

    Thanks.

     
  • padrogass aaa
    padrogass aaa
    2010-08-23

    same problem here with avantfax 3.3.2, hylafax 4.4.4, ubuntu 8.10.

     
  • Same problem with avantfax 3.3.2, hylafax 6.0.3, ubuntu 10.04

     
  • Dave
    Dave
    2010-08-31

    What happens when you run this command?

    sendfax -d TESTFAXNUMBER /etc/hosts

    Is a cover page faxed along with the text file?

     
  • The fax contain only the hosts file (one page).

     
  • J Sidhu
    J Sidhu
    2010-09-20

    same problem here, running latest version (as of 9/19/2010) of Hylafax on Ubuntu 10.10 beta

    Version: 2:6.0.4-10ubuntu1
    Avantfax:3.3.2

    I cannot get it to send a coverpage when I specify some files to fax, either pdfs or txt etc. However, if I dont have any attachments, the cover page is faxed properly. This is the case with the postscript coverpages as well as the html coverpage.

    Any ideas where to look?

     
  • Dave
    Dave
    2010-09-20

    Can you upgrade to AvantFAX 3.3.3 and let me know if you're still having problems?

     
  • Same problem with avantfax 3.3.3.

    Avantfax 3.3.3
    Hylafax 6.0.4
    Ubuntu 10.04

     
  • Hello all,
    there's not an official bugfix yet nor forums with answers, but it seems that avantfax doesn't even try to build up the cover page if you send an attach.
    So here is the solution
    Open your $INSTALLDIR/includes/functions.php and at line 531 (avantfax 3.3.3 at least) you'll find out these lines:

    if (count($files)) {
        $faxfiles = implode(" ", $files);
        return exec_sendfax("$SENDFAX $nrequeue $use_coverpage $sf_args $modem $destinations $faxfiles");
    }

    You HAVE TO change them into these:

    if (count($files)) {
    $psfile = $TMPDIR.genpasswd().".ps";
    $fcommand = "$FAXCOVER $cp_args -C '" . $INSTALLDIR . "/images/$whichcover' -p $NUM_PAGES_FOLLOW -n $first_dest > $psfile";
    $o = exec($fcommand, $output, $retval);
    array_unshift($files,$psfile);
    $faxfiles = implode(" ", $files);
    return exec_sendfax("$SENDFAX $nrequeue $use_coverpage $sf_args $modem $destinations $faxfiles");
    }

    Thi is my OWN solution, so take it as is. It works on my installation. Let me know if this solved your problems.

     
  • padrogass aaa
    padrogass aaa
    2011-02-17

    it works!!! Thank  you, cyberpingu!!!!

     
  • Eduardo Diaz
    Eduardo Diaz
    2011-03-02

    Thanks, Man!!

     
  • Eduardo Diaz
    Eduardo Diaz
    2011-04-27

    I want to said that after of applicate this upgrade I can't not disable don't send a cover, avantfax always send a cover..

    REgards!

     
  • Dreamrg
    Dreamrg
    2011-04-28

    I have the same issue with Avantfax 3.3.3 Hylafax 6.0.5 Ubuntu Lucid. No cover page with attachments, cover page with attachments. I'll try the code stated above. Is this indeed an issue with Avantfax instead of Hylafax?

     

  • Anonymous
    2011-06-13

    Upgrade the code posted above with this:

    if (count($files)) {
    if (isset($coverpage)) {
    $psfile = $TMPDIR.genpasswd().".ps";
    $fcommand = "$FAXCOVER $cp_args -C '" . $INSTALLDIR . "/images/$whichcover' -p $NUM_PAGES_FOLLOW -n $first_dest > $psfile";
    $o = exec($fcommand, $output, $retval);
    array_unshift($files,$psfile);
    $faxfiles = implode(" ", $files);
    return exec_sendfax("$SENDFAX $nrequeue $use_coverpage $sf_args $modem $destinations $faxfiles"); }
    else {
    $faxfiles = implode(" ", $files);
    return exec_sendfax("$SENDFAX $nrequeue $use_coverpage $sf_args $modem $destinations $faxfiles"); }

    }

    Regards Andrea Zorzetto
    www.ubuntu-linux.it

     
  • esouthwick
    esouthwick
    2011-06-20

    I had the same problem and added code submitted by Andrea Zorzetto. Now I have the cover page and attachment, but with a weird problem. The cover page is at the end of the fax, not the beginning. It has nothing to do with the submitted code, I don't think. I need to check out the $files array after the array_unshift($files,$psfile) line.

    Anybody having the same problem?

     
  • Dave
    Dave
    2011-06-20

    You should make sure that "/var/www/avantfax/includes/faxcover.php" is executable and executed by sendfax.  To be executed by sendfax, sendfax.conf file must be configured as above.  However, the path to sendfax.conf depends on your distro and how hylafax is installed.  On RH/CentOS, the usual path should be /etc/hylafax/sendfax.conf.  Also, the path to faxcover.php depends on where you installed avantfax, so double check your paths.

     
  • ivan
    ivan
    2011-06-30

    Hi,
    I remove 4 rows (from row number 531) from function.php and replace with code submitted by Andrea Zorzetto, but Avantfax don't start!!  I use cut&paste for added the code… It is correct?

    I can't send a cover with attach… but if I send only a cover is all oK ….

    why?

    Thanks

    P.S.: ciao Andrea, sto provando a configurare un server fax ma non riesco ad inviare la cover con il pdf allegato, mentre la sola cover viene inviata correttamente. Non capisco perchè questo bug non venga segnalato anche da altri utenti. Io uso Ubuntu 10.04 con l'ultima versione di Avantfax.
    Ho provato a copiare il tuo codice (sia con taglia e incolla, sia a mano) ma poi Avantfax non funziona più…

    Puoi aiutarmi?

    Grazie

    Ivan

     
  • Venti7
    Venti7
    2011-10-20

    Yeah man, It works!!!

    Ps per Andrea: Ho installato Avantafax 3.3.3 su Ubuntu 10.04 LTS e con la modifica del codice php nel file functions.php indicato da cyberpingu.

    ciao

     
  • Broaska
    Broaska
    2012-01-17

    After adding this code I also am getting the coverpage added after the attachement as the second page. Was this ever solved? I would like to get this working correctly. The fax system is working great, but I would prefer the coverpage go at the beginning!

     

  • Anonymous
    2012-01-25

    I have spent all day on this issue and now that I have it fixed I must report back someplace.  I am on Avantfax 3.3.3 on Ubuntu 10.04.1 with a custom compiled Hylafax.  One thing to remember is that Avantfax/Hylafax can have problems with the version of ghostscript on Ubuntu 10.04.1.  Be sure to turn off 2D MMR.  This can be set in hylafax configuration files as something like "Use2D: No"  That said, on to the issue at hand.

    First I applied the fix posted above from Andrea Zorzetto.  This gave me a filled in cover page but introduced new problems.  When sending faxes with postscript cover pages(I can't get html cover pages to work at all) from Avantfax I was getting the following pages in order.
    1. My cover page without any entries filled in (think XXXX- everywhere)
    2. My uploaded PDF fax
    3. My cover page with entries properly filled in

    The code posted by Andrea Zorzetto is on the right track but doesn't quite take it far enough.  Essentially if you leave $use_coverpage in those commands to sendfax then sendfax is going to include its own coverpage based on it's integrated invocation of faxcover.  This integrated invocation of faxcover is what seems to be broken so that is no good.  Just removing forces sendfax to use it's default cover page which is also no good.  You must replace "$use_coverpage" with "-n" to fully disable sendfax's integrated cover page function.  You also must set the number of pages so that your cover page has it correct.  Sadly this leaves Avantfax a bit broken :( more on fixing that in the next post

    if (count($files)) {
           //###Added the following nine lines as part of a coverpage bugfix
           if (isset($coverpage)) {
                    $NUM_PAGES_FOLLOW = count($files);
                    $psfile = $TMPDIR.genpasswd().".ps";
                    $fcommand = "$FAXCOVER $cp_args -C '" . $INSTALLDIR . "/images/$whichcover' -p $NUM_PAGES_FOLLOW -n $first_dest > $psfile";
                    $o = exec($fcommand, $output, $retval);
                    array_unshift($files, $psfile);
                    $faxfiles = implode(" ", $files);
                    return exec_sendfax("$SENDFAX $nrequeue -n $sf_args $modem $destinations $faxfiles");
          } else {
                    $faxfiles = implode(" ", $files);
                    return exec_sendfax("$SENDFAX $nrequeue -n $sf_args $modem $destinations $faxfiles");
          }
    } else { // SEND ONLY COVER PAGE AS FAX

     

  • Anonymous
    2012-01-25

    After this your outgoing faxes will be proper but if you are like me then your archived PDFs of sent faxes will have the cover page last.  I would say this is a bug but I'm not sure.  Essentially if you have a cover page as postscript and a fax page as a PDF the PDF will always get put in first.  You will need to modify the convert2pdf function within functions.php.  This code assumes that you have a postscript cover with pdf data, just pdf data or just a postscript cover.  I guess tiff would work too but a PDF cover would break this I think.

    Edit #1

                    for ($i = 0; $i < count($convertfiles); $i++) {
                            if (preg_match("/\.tif/i", $convertfiles)) {
                                    $convert_tiff = $convertfiles;
                            } elseif (preg_match("/\.ps/i", $convertfiles)) {
                                    $convert_ps .= $convertfiles." ";
                            } elseif (preg_match("/cover/i", $convertfiles)) {
                                    $coverpage = $convertfiles;
                            } else {
                                    //### Changed the following line to make pdfs come last
                                    //$list_pdf .= $convertfiles." ";
                                    $pdflist .= $convertfiles." ";
                            }
                    }

    Edit #2

                    //### commented out this section to prevent sendfax integrated cover generation
                    // convert cover page (.ps) to PDF
                    //if (isset($coverpage)) {
                            //echo "convert2pdf> converting coverpage to pdf\n";
                            //$tmpcover = tmpfilename('pdf');
                            //$cmd = sprintf($GSCMD, $tmpcover, $coverpage);
                            //system_v($cmd);
                            //$list_pdf = "$tmpcover $list_pdf";
                    //}

    Edit #3

                    // convert TIF files to PDF
                    if (is_array($convert_tiff)) {
                            echo "convert2pdf> processing tiffs\n";
                            foreach ($convert_tiff as $tiff) {
                                    $tmptif = tmpfilename('pdf');
                                    system_v("$TIFFPS $tiff | $GSR -sOutputFile=$tmptif - -c quit $is_quiet");
                                    $list_pdf .= $tmptif." ";
                                    $del_tif = $tmptif;
                            }
                    }

                    //###added the following line
                    //Add pdflist to list_pdf
                    $list_pdf .= $pdflist." ";

                    // create the final PDF
                    if (isset($list_pdf)) {

     
  • Broaska
    Broaska
    2012-01-25

    I have updated my functions.php to reflect the -n in place of the $use_coverpage. My coverpages are being generated, I can use html or postscript coverpages, however they are still getting placed after my pdf attachements rather than before. The coverpage indicates their is another page etc.

    Centos 5.7 64 bit
    Avantfax 3.3.3
    Hylafax 6.0.5 X64

     
  • Broaska
    Broaska
    2012-01-25

    After adding the additional edits to my functions.php this is working correctly now. The PDF always being first was the issue we were trying to solve. Thanks!

     
1 2 > >> (Page 1 of 2)