Operating System - HP-UX
1834512 Members
2397 Online
110068 Solutions
New Discussion

Re: line printer to email

 
SOLVED
Go to solution
shera canty
Occasional Contributor

line printer to email

can someone help me on setting up a printer destination on my unix 10.2 server to forward the file received to an email address ?

thanks !
2 REPLIES 2
Rita C Workman
Honored Contributor

Re: line printer to email

I want to make sure I understand your question....are you asking to change the interface scripts on a printer to send the output to an email?

Why not just email the file instead of sending it to a printer?

Rita
Olav Baadsvik
Esteemed Contributor
Solution

Re: line printer to email

Hello,

This is really quite easy, I just tested
this solution and it works
Use lpadmin to define a printer to print
to /dev/null like this:
lpadmin -pprintername -v /dev/null -mdumb

Then edit the model-script in /etc/lp/interface
directory. Modify it so that you embrace
all the statements that give output to
the printer in a pair of ( )
After the ) you redirect the output to a file
like this ) > /tmp/$$MAIL.tmp
Then add these lines
mail olav@hp.com < /tmp/$$MAIL.tmp 2> /dev/null
rm /tmp/$$MAIL.tmp
The statements that give output to the printer
are echo, and cat.

You should also comment out any stty commands
in the script.