
Hello, I receive faxes from several accounts arround the world as tif files. All the 'faxes' go to individual e-mail addresses. What I would like to do is have the attachments printed out automatically whenever a new fax is received. I use kmail and can identify each 'fax' using the kmail filters. I guess I should then use kmail to pipe the fax to an external scrip to process the mime attachment and print it out. Anyone got an example of how to do this last part, or an alternative solution? TIA, Jethro

Probably you could do it with "procmail". -- Cheers, Carlos Robinson El 02.09.30 a las 17:29, Jethro Cramp escribió:
Date: Mon, 30 Sep 2002 17:29:28 +0000 From: Jethro Cramp <jsc_lists@rock-tnsc.com> To: suse-linux-e@suse.com Subject: [SLE] Print an incoming FAX
Hello,
I receive faxes from several accounts arround the world as tif files. All the 'faxes' go to individual e-mail addresses.
What I would like to do is have the attachments printed out automatically whenever a new fax is received.
I use kmail and can identify each 'fax' using the kmail filters. I guess I should then use kmail to pipe the fax to an external scrip to process the mime attachment and print it out.
Anyone got an example of how to do this last part, or an alternative solution?
TIA,
Jethro

On 30-Sep-02 Carlos E. R. wrote:
Probably you could do it with "procmail".
-- Cheers, Carlos Robinson
El 02.09.30 a las 17:29, Jethro Cramp escribió:
Date: Mon, 30 Sep 2002 17:29:28 +0000 From: Jethro Cramp <jsc_lists@rock-tnsc.com> To: suse-linux-e@suse.com Subject: [SLE] Print an incoming FAX
Hello,
I receive faxes from several accounts arround the world as tif files. All the 'faxes' go to individual e-mail addresses.
What I would like to do is have the attachments printed out automatically whenever a new fax is received.
I use kmail and can identify each 'fax' using the kmail filters. I guess I should then use kmail to pipe the fax to an external script to process the mime attachment and print it out.
Anyone got an example of how to do this last part, or an alternative solution?
TIA,
Jethro
I do this, but "by hand" when received. I can get my MUA (XFMail) to pipe the attachment to a script which prints it directly, or displays it so I can read it on-screen. Here is the on-screen script: #! /bin/bash TIME=`date +"%Y.%m.%d:%H.%M.%S"` convert -page A4 $1 FaxMePrint.$TIME.ps gv -antialias -scale 2 -geometry 990x820-0+0 FaxMePrint.$TIME.ps rm FaxMePrint.$TIME.ps This will work as is provided the attachment is identified as TIFF by having extension ".tif", so that 'convert' knows it is a TIFF file. It is then converted to PostScript and can be viewed in 'gv' page by page. You can print it (or selected pages) from 'gv' if you want, after viewing. The direct-print script is similar, but simply does #! /bin/bash TIME=`date +"%Y.%m.%d:%H.%M.%S"` convert -page A4 $1 FaxMePrint.$TIME.ps lpr FaxMePrint.$TIME.ps It does not invoke 'gv' and the line which deletes the PS file is also absent. You may be able to adapt this to what you want: hope it helps. Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 167 1972 Date: 01-Oct-02 Time: 00:08:18 ------------------------------ XFMail ------------------------------

Ted, Thanks. I like the idea but I have to put some 'glue' in first to extract the tiff mime attachment. Regards, Jethro On Monday 30 September 2002 23:08, Ted Harding wrote:
I do this, but "by hand" when received. I can get my MUA (XFMail) to pipe the attachment to a script which prints it directly, or displays it so I can read it on-screen. Here is the on-screen script:
#! /bin/bash TIME=`date +"%Y.%m.%d:%H.%M.%S"` convert -page A4 $1 FaxMePrint.$TIME.ps gv -antialias -scale 2 -geometry 990x820-0+0 FaxMePrint.$TIME.ps rm FaxMePrint.$TIME.ps
This will work as is provided the attachment is identified as TIFF by having extension ".tif", so that 'convert' knows it is a TIFF file. It is then converted to PostScript and can be viewed in 'gv' page by page. You can print it (or selected pages) from 'gv' if you want, after viewing.
The direct-print script is similar, but simply does
#! /bin/bash TIME=`date +"%Y.%m.%d:%H.%M.%S"` convert -page A4 $1 FaxMePrint.$TIME.ps lpr FaxMePrint.$TIME.ps
It does not invoke 'gv' and the line which deletes the PS file is also absent.
You may be able to adapt this to what you want: hope it helps. Ted.

Carlos, I'm not familiar with procmail, I know that it can be used for sorting incoming mail, which I presume would include doing something with mail and forwarding it on to other programs. Can procmail handle the mime>tiff conversion? TIA, Jethro On Monday 30 September 2002 19:49, Carlos E. R. wrote:
Probably you could do it with "procmail".

Jethro, procmail is a "mail processor". When sendmail (or postfix or whatever) proceses incoming mail (even if fetched with fetchmail from pop3 or imap accounts), it will pass the mail to procmail for each user that has a .procmail file. It is very powerfull, I use it to put the mail I fetch from different accounts into diferent mailboxes, separate mail-list, etc. I would recomend you to have a look at its manual page and the examples manual page (man procmailex). There are some examples somewhat similar to your case: excerpt+++ The following recipe prints every incoming mail that looks like a postscript file. :0 Bb * ^^%! | lpr The following recipe does the same, but is a bit more selective. It only prints the postscript file if it comes from the print-server. The first condition matches only if it is found in the header. The second condition only matches at the start of the body. :0 b * ^From[ :].*print-server * B ?? ^^%! | lpr The same as above, but now by slightly different means: :0 * ^From[ :].*print-server { :0 B b * ^^%! | lpr } Likewise: :0 HB b * ^^(.+$)*From[ :].*print-server * ^^(.+$)*^%! | lpr ++- Also, look up the word "fax" on the sdb. The query pops up with some programs to do conversions from/to fax formats, and client/server software. -- Cheers, Carlos Robinson El 02.10.02 a las 15:32, Jethro Cramp escribió:
Date: Wed, 2 Oct 2002 15:32:45 +0000 From: Jethro Cramp <jsc_lists@rock-tnsc.com> To: suse-linux-e@suse.com Cc: Carlos E. R. <robin1.listas@tiscali.es> Subject: Re: [SLE] Print an incoming FAX - Using Procmail?
Carlos,
I'm not familiar with procmail, I know that it can be used for sorting incoming mail, which I presume would include doing something with mail and forwarding it on to other programs. Can procmail handle the mime>tiff conversion?
TIA,
Jethro
On Monday 30 September 2002 19:49, Carlos E. R. wrote:
Probably you could do it with "procmail".
participants (3)
-
Carlos E. R.
-
Jethro Cramp
-
Ted.Harding@nessie.mcc.ac.uk