I'm having a hard time figuring out how a bounce
queue should work.

Here's my goal:

When I print something to a certain print queue, I
want the document to be printed and to be mailed.
Normal printing is filtered through the standard
HPLJ4 magicfilter, and from there gets sent to the
remote printer.

When I want hardcopy and email, I print to a
second queue, that runs a "mailit" filter (a perl
script) that should send the printed material to
an email, and that should then bounce the printed
material to the normal queue as mentioned above.

If I manually run the "mailit" filter, the prompt
sits there, where I can type something, like "This
is a test", and then hit Ctrl-D. The mailit filter
ends, returning me to a normal prompt, and then
I can check my mail and there's the message.
Perfect.

However, whenever I print to the second queue, I
get the printout, but it never generates the email
message. Can anyone help me figure out what I'm
doing wrong?

Here's my printcap:
#
# Copyright (c) 1983 Regents of the University of
California.
# All rights reserved.
#
# Redistribution and use in source and binary
forms are permitted
# provided that this notice is preserved and that
due credit is given
# to the University of California at Berkeley. The
name of the University
# may not be used to endorse or promote products
derived from this
# software without specific prior written
permission. This software
# is provided ``as is'' without express or implied
warranty.
#
# @(#)etc.printcap 5.2 (Berkeley) 5/5/88
#
# This file was generated by
/usr/sbin/magicfilterconfig.
#
lp|HP LaserJet III (local LPT1):\
 :lp=/dev/lp0:\
 :sd=/var/spool/lpd/lp:\
 :sh:pw#80:pl#66:px#1440:mx#0:\
 :if=/etc/magicfilter/ljet4-filter:\
# :of=/etc/magicfilter/mailit:\
 :af=/var/log/lp-acct:lf=/var/log/lp-errs:

bounce:\
 :lp=:\
 :[EMAIL PROTECTED]:\
 :if=/etc/magicfilter/mailit:\
 :sd=/var/spool/lpd/bounce:


And here's my "mailit" filter:
#! /usr/bin/perl
$recipient = "[EMAIL PROTECTED]";
$subject = "Your Printout, Sir";
$mailprog = "mail";

open (MAIL, "|$mailprog -s \'$subject\'
$recipient");
print MAIL "----- Here's your printout, Sir\n\n";

while (<STDIN>) {
  print MAIL $_;
}

print MAIL "\n----- That's all, Folks!\n";

close MAIL;


Thanks for any help!

Reply via email to