Stewart Stremler said:
> begin quoting Neil Schneider as of Wed, Oct 12, 2005 at 01:21:09PM
> -0700:
>> I'm working on a printer filter on a system using LRPng, that will
>> allow people to send printouts from a custom application through
>> email
>> to designated addresses.
>
> Along the lines of "lp1 is the laser printer, lp2 is the inkjet, and
> lp3
> is email to [EMAIL PROTECTED]" ?
Exactly, in this case it's lp15.
>> file was not good. Here is the current version of the code. It
>> should
>> send the report as a plain text attachment to the email, so it can
>> be
>> printed out directly.
>
> /me makes smart-aleck comment about uuencode working better anyway
I'm open to suggestions about uuencode, but in this case it's probably
a bad idea to use uuencode, because the people printing the report
will have to think to much. :-)
>> ---------- begin code -----------------
>>
>> #!/bin/bash
>>
>> # Capture the spool file
>> #
>> SPOOLDIR=$(pwd)
>> cat - >$SPOOLDIR/print.$$
>>
>> #Declare variables
>> # path to temporary files
>> # FILE_PDF=$SPOODIR/print$$.pdf
>> FILE_PRINT=$SPOODIR/print.$$
>
> SPOODIR? Wouldn't SPOOLDIR work better?
That's the kind of thing I was missing. I also found that the `date`
part below didn't work right.
>> # FILE_PS=$SPOODIR/ps.$$
>> [EMAIL PROTECTED]
>> EMAIL_FROM=
>
> To be filled in by the user? Or did you just leave out the generating
> code?
>
>> # Path to email server program
>> SENDMAIL="/usr/sbin/sendmail.postfix"
>> MIMENCODE="/usr/bin/mimencode"
>>
>> # Do we need a username?
>> # How about a comment line, or header?
>> (
>> echo "To: $EMAIL_ADDRESS"
>> echo "From: $EMAIL_FROM"
>> echo "Subject: Outgoing Invoice print job"
>
> No X-Printer-To-Email: Version 0.2a line? :)
>
>> echo ""
>> echo ""
>> echo `date`
>> echo ""
>> echo ""
>> echo "Content-Type: multipart/mixed; boundary=lprtomail"
>
> Most of the time I see long lines of dashes, random numbers, and
> suchlike,
> presumably to avoid accidently generating a false boundary. What if
> the
> text I'm sending contains "^--lprtomail$" ?
>
>> echo "Content-Description: Delivery Invoice;"
>> echo "Content-Type: text/plain; charset=\"us-ascii\""
>> echo "Content-Transfer-Encoding: 7bit"
>> echo ""
>> echo "This email contains an attachment which you can print
>> on
>> your local printer"
>> echo "--lprtomail"
>> echo "Content-Type: text/plain"
>> echo ""Content-Transfer-Encoding: base64"
>> cat $FILE_PRINT
>> echo "";
>> echo "";
>> ) | 2>&1 $SENDMAIL -oi $EMAIL_TO
>>
>> ------------- end code ---------------------
>
> Nifty.
>
> I see you're using bash -- what bashisms are in that script?
Dunno, do you see any?
--
Neil Schneider pacneil_at_linuxgeek_dot_net
http://www.paccomp.com
Key fingerprint = 67F0 E493 FCC0 0A8C 769B 8209 32D7 1DB1 8460 C47D
Secrecy, being an instrument of conspiracy, ought never to be the
system of a regular government.
- Jeremy Bentham, jurist and philosopher (1748-1832)
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg