I am baffled. By the way, I suggest:
print command = /usr/spool/lp/bin/lpr -r -J "%J" -Fl -m "%m" -U "%U" -P "%p"
%s
Note the use of the quoates and spaces. This way if you get a value with a
space in it, you will survive.
This is a bit faster/leaner:
#!/bin/sh
# just a filter for the controlfile, jobs from the SAMBA queues
# that are forwarded produce annoying e-mails due to the -m option
# used for windows pop-ups
# chbeyer 07-02
/usr/bin/sed -e /\^M/d
exit 0
Could you download the current/latest version and try it with this?
> From [EMAIL PROTECTED] Fri Aug 23 04:07:39 2002
> From: [EMAIL PROTECTED]
> Date: Fri, 23 Aug 2002 12:18:23 +0200 (MEST)
> To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> cc: Gerhard Schroth <[EMAIL PROTECTED]>
> Subject: LPRng: control file filter does not work with SAMBA
>
> Hi Patrick et al,
>
> I'm experiencing a somehow bizarre problem:
>
> With SAMBA I use
>
> [printsrv3] /usr/spool/samba $ grep "print command" ~lp/etc/smb.conf
> print command = /usr/spool/lp/bin/lpr -r -J"%J" -Fl -m%m -U%U -P%p %s
>
> I use the -m option to pass the netbios name and produce a pop-up on the
> originating host by using a simple script instead of 'sendmail'. This
> works just fine but some queues get forwarded to different servers that
> don't know about my construction and send annoying e-mails :-(
>
> So I wrote a little control_file_filter script to filter the 'M' entry for
> those queues. this works fine from the command line using exactly the
> lpr command SAMBA does but it does not work from SAMBA. The job never
> arrives in the queue. In the logs I see:
I ran the above script on my current version and it appeared to work.
Sigh...
>
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: Setup_printer:
> printer now 'hsps1', spool dir '/usr/spool/lpd/request/hsps1'
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: Checkwrite: file
> 'lpq' fd 5, inode 0x42ce2, perms 0100600
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: cleanup: signal No
> signal, Errorcode 0
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: Killchildren: pid
> 6729, signal Interrupt, count 0
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: *** Dump_pinfo
> Killchildren - after - count 0 ***
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: *** done ***
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: Killchildren: pid
> 6729, signal Interrupt, count 0
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: *** Dump_pinfo
> Killchildren - after - count 0 ***
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: *** done ***
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: Killchildren: pid
> 6729, signal Hangup, count 0
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: *** Dump_pinfo
> Killchildren - after - count 0 ***
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: *** done ***
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: Killchildren: pid
> 6729, signal Quit, count 0
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: *** Dump_pinfo
> Killchildren - after - count 0 ***
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: *** done ***
> 2002-08-23-11:09:32 printsrv4 [6729] Job_status hsps1: cleanup: done,
> exit(0)
> 2002-08-23-11:09:32 printsrv4 [6672] Waiting lpd: select returned -1,
> error 'Interrupted system call'
>
> Everything works fine when I establish a remote queue (rm/rp) that points
> to a second queue with the control file filter...
>
> Maybe this makes any sense to you (?)
>
> best regards
> ~christoph
>
> P.S: I'm using 3.8.3
>
>
> heralog|log_heralog:\
> :cm=HERA_LOG Text Olaf Hensler, 3372:\
> :control_filter=/usr/spool/lp/bin/control_file_filter.sh:\
> :rm=herainfo:\
> :rp=heralog:\
> :force_localhost:\
> :mx#0:\
> :bk:\
> :du#16:\
> :
>
> [printsrv3] /usr/spool/samba $ cat
> /usr/spool/lp/bin/control_file_filter.sh
> #!/bin/sh
> # just a filter for the controlfile, jobs from the SAMBA queues
> # that are forwarded produce annoying e-mails due to the -m option
> # used for windows pop-ups
> # chbeyer 07-02
>
> PATH=/usr/bin:/usr/local/bin:/usr/spool/lp/bin
>
> while read LINE
> do
> echo $LINE | /usr/bin/sed /\^M/d
> done
>
>
> best regards
> ~christoph
>
>
> --
> /* Christoph Beyer | Office: Building 2b / 23 *\
> * DESY | Phone: 040-8998-2317 *
> * - IT - | Fax: 040-8998-4060 *
> \* 22603 Hamburg | http://www.desy.de */
>
>
>
> -----------------------------------------------------------------------------
> YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> The address you post from MUST be your subscription address
>
> If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
> or lprng-digest-requests) with the word 'help' in the body. For the impatient,
> to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
> with: | example:
> subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
> unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
>
> If you have major problems, send email to [EMAIL PROTECTED] with the word
> LPRNGLIST in the SUBJECT line.
> -----------------------------------------------------------------------------
>
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------