Operating System - HP-UX
1824497 Members
3477 Online
109672 Solutions
New Discussion юеВ

email from cancelled print jobs

 
Unix Administrator_5
Frequent Advisor

email from cancelled print jobs

We have an hp 9000 running 11.00 with the hp printer installer software.

At times we have to cancel a large number of jobs in a print queue (network printers). The mail bombs the owner (which forwards to a list of people) with "cancelled print job" messages. Is there any way to safely turn this off?
7 REPLIES 7
S.K. Chan
Honored Contributor

Re: email from cancelled print jobs

You can't turn this off from the source. If you take a look quickly at /usr/bin/cancel by doing ..
# strings /usr/bin/cancel|grep mail
you'll see that the "mail" program is called within the "cancel". The only thing I can think of is to filter the messages on the receipient side. We use "procmail" to filter a lot of such email so that they would not fill up the mailbox.
Thomas Schler_1
Trusted Contributor

Re: email from cancelled print jobs

Before you're cancelling the print jobs, you could change /usr/bin/mail to something else that does nearly nothing. After cancelling, you should recover /usr/bin/mail. For example:

# cp -p /usr/bin/mail /usr/bin/mail.save
# echo "exit 0" > /usr/bin/mail
#
# cp -p /usr/bin/mail.save /usr/bin/mail

Most users use mailx for sending mails, so maybe no one would be affected by that work-around. Any way, you should be fast in doing so. Create a script that cancels all the relevant print jobs, in order to have a short period of time when /usr/bin/mail is changed.
no users -- no problems
A. Clay Stephenson
Acclaimed Contributor

Re: email from cancelled print jobs

One method would be to rename the 'real' mail program to something like /usr/bin/mail0 and then create a wrapper for /usr/bin/bin. If would then examine ${PPID} do a ps -p ${PPID} | grep "cancel"; If the parent process were cancel then mail could simply exit 0 otherwise invoke the 'real' mail program passing along the argments supplied.
If it ain't broke, I can fix that.
Mark Greene_1
Honored Contributor

Re: email from cancelled print jobs

Put the cancel into a script where you chown the jobs remaining in the queue (/var/spool/lp) to "nobody" or some other non-user and then cancel them. Then once a week or so review and delete the mail for that user account.

HTH
mark
the future will be a lot like now, only later
Unix Administrator_5
Frequent Advisor

Re: email from cancelled print jobs

I didnt see how you could change the ownership of a print job in the queue
Frank Slootweg
Honored Contributor

Re: email from cancelled print jobs

Building on the other responses, here is another hack:

You could edit /usr/bin/cancel to call your own (dummy) program instead of /usr/bin/mail. You will have to edit 'in place', i.e. your new path should be the same length or less than /usr/bin/mail. A very simple 'binary editor' can be realized with "vis -n", your favorite text editor and "inv -n".

I call this a hack instead of a solution, because of the above limitations and the fact that you have to redo this if /usr/bin/cancel is replaced by a newer version.

I did a quick search and found a late 2001 response from Bill Hassell saying this is a known, but not formally reported problem and advising to file an enhancement request. (Sorry, no URL. The ITRC search engine and I are not the best of friends, because I always only get *one* chance to look at *one* found document.)
Cheryl Griffin
Honored Contributor

Re: email from cancelled print jobs

This has already been submitted as an enhancement request:
ER# 5003416875 "add option to cancel(1) so that no mail is sent if cancelled by root" and was reviewed/worked on as recently as 02/12/2002. No ETA on its release as of yet.

We have a "SR Notify Database" that can keep track of the SR/ER and your contact information, so if you want to be notified when the release is fixed it would be best to log a support case so that we can add you to the database.

Cheryl

"Downtime is a Crime."