[cups.general] Mail to User if a Printjob is abortet

Johannes Meixner jsmeix at suse.de
Thu May 7 03:54:17 PDT 2009


Hello,

On May 7 11:06 Daniel Spannbauer wrote (shortened):
> Under /usr/lib/cups/notifier/ there are some Binary which seem to send
> the Mail. Is it posibly to write a own script for using by cups?

Yes.

For experimenting I added right now in subscriptions.conf
-----------------------------------------------------------
<Subscription 19>
Events job-created job-completed job-stopped
Owner jsmeix
Recipient mynotifier:jsmeix at suse.de
LeaseDuration 0
Interval 30
ExpirationTime 0
NextEventId 3
</Subscription>
-----------------------------------------------------------
and I added a new /usr/lib/cups/notifier/mynotifier
with "-rwxr-xr-x  root root" permissions
-----------------------------------------------------------
#! /bin/bash

# get debugging info in /var/log/cups/error_log:
set -x

cat /dev/null >/tmp/mynotifier.out
echo "argv[1]: '$1'" >>/tmp/mynotifier.out
echo "argv[2]: '$2'" >>/tmp/mynotifier.out
echo "argv[3]: '$3'" >>/tmp/mynotifier.out
echo "argv[4]: '$4'" >>/tmp/mynotifier.out
echo "argv[5]: '$5'" >>/tmp/mynotifier.out
echo "argv[6]: '$6'" >>/tmp/mynotifier.out
set >>/tmp/mynotifier.out

cat - >/tmp/mynotifier.stdin

exit 0
-----------------------------------------------------------

Unfortunately (at least not with my CUPS 1.3.9)
a notifier does not get the command line parameters
and environment variables like usual CUPS filters
(compare "man 7 filter") so that adding a real working
notifier as a bash script seems to be complicated.

Instead a notifier gets the data in a special format via stdin
where I currently only find the print queue URI but I can
neither find the job owner nor the job id.

I don't know a documentation where this format is described.
Perhaps you must view the sources in the notifier/ directory.


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex





More information about the cups mailing list