Operating System - HP-UX
1825001 Members
2426 Online
109678 Solutions
New Discussion юеВ

Re: if anyone cancel a lp print job I receive an email

 
Luis_75
New Member

if anyone cancel a lp print job I receive an email

and I don't want it!!!
Whenever an user cancels ( cancel pr1-1234 p.e.) a lp job, I receive an email like:
your printer request pr1-1234 was cancelled by root

But this message doesn't have a correct EOF (or something like that) and next email messages get corrupted by this one.

How can I get "cancel" command to NOT send this annoying message??

Thanks
5 REPLIES 5
Mark Grant
Honored Contributor

Re: if anyone cancel a lp print job I receive an email

I am not sure, but I think you only get this message if the original print was specified with "lp -m " (send a mail on completion of the print request).

Don't quote me on this though.
Never preceed any demonstration with anything more predictive than "watch this"
Kent Ostby
Honored Contributor

Re: if anyone cancel a lp print job I receive an email

There are ways to put filters into your email to kill off such messages, but cancel does not have a switch to turn this off.

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Steven E. Protter
Exalted Contributor

Re: if anyone cancel a lp print job I receive an email

take a look at the message header in the /var/mail/root (or whoever the user is) log and see where its coming from.

Obviously someone or some piece of software configured this and you should be able to trace it, look at logs and figure out why its happening.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Cheryl Griffin
Honored Contributor

Re: if anyone cancel a lp print job I receive an email

It's happening because the cancel command calls /usr/bin/mail to notify the originator of the print job that the job was cancelled.

It's not configurable. As Kent mentioned, you can filter the messages out. Sendmail seems to be the best in discarding the messages.

There is an enhancement request to make this user configurable.
"Downtime is a Crime."
David Bonham_1
Advisor

Re: if anyone cancel a lp print job I receive an email

I just saw a suggestion for a shell-script work-around in the following thread: http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=29057

Here'e my completed shell script which replaces /usr/bin/mail. I renamed the original mail client to mail0. Also made sure that the permissions and owner/group were set the way /usr/bin/mail was before tampering with it. Seems to work pretty well.

-----------------------------
#!/usr/bin/sh
#
# DESCRIPTION:
# Wrapper for the 'mail' client (renamed to 'mail0') to avoid sending mail
# messages to the end users mailbox when canceling their print jobs.

if ps -p ${PPID}|grep -i cancel >/dev/null ;
then exit 0;
fi

/usr/bin/mail0 $*
-----------------------------

Hope it helps anyone out there!

/dev/null