This is a discussion on Send print job via e-mail within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi all, I try to implement a custom backend to the AIX printing system which is supposed to send ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi all, I try to implement a custom backend to the AIX printing system which is supposed to send the print job via e-mail to the user who has submitted it. I have figured out this line in the backend script: /usr/bin/cat $@ | /usr/sbin/sendmail $USER@mydomain.com If I put a fixed username in $USER it works as expected. So my question would be: Can I find out the name of the user how submitted the printjob? I guess I should be able to, I just don't know where to search. Any hints welcome ... Regards, Torsten |
| |||
| On 2005-09-01, Torsten Schlabach <tschlabach@gmx.net> wrote: > /usr/bin/cat $@ | /usr/sbin/sendmail $USER@mydomain.com 1) This is a Useless Use of Cat (tm), it's better to use: /usr/sbin/sendmail $USER@mydomain.com < "$@" 2) To test whether the username is set in an environment variable, do something like: export | /usr/sbin/sendmail you@yourdomain.com ... and read the mail to see if the username is in there. -- Jurjen Oskam |
| |||
| > I try to implement a custom backend to the AIX printing system which is > supposed to send the print job via e-mail to the user who has submitted > it. > > I have figured out this line in the backend script: > > /usr/bin/cat $@ | /usr/sbin/sendmail $USER@mydomain.com > > If I put a fixed username in $USER it works as expected. So my question > would be: Can I find out the name of the user how submitted the > printjob? I guess I should be able to, I just don't know where to > search. If you're able to do this in C instead of a shell script, there are some calls you can make to get the print job submitter from qdaemon: log_init(); /* Initialize communication with qdaemon */ get_from(); /* Get the print job submitters user name from qdaemon */ Best regards, Paul |