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

Helge Blischke h.blischke at acm.org
Thu May 7 05:02:35 PDT 2009


Johannes Meixner wrote:

> 
> 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

With CUPS 1.3.5, I experimentally used a Perl script as a notifier which in
turn calls the testnotify utility (which gets built if you compile CUPS
from the sources). Ths test utility proviedes a lot of information about
the current event (like job attivutes etc.) and, of course, the reason
for aborting.

Helge





More information about the cups mailing list