Professional Web Applications Themes

print spooler to email - SCO

G'Day, I trying to set up a spooler interface to email print jobs (to a fixed destination) rather than have them printed. I see from google groups that Jeff Lieberman has sent email to printers - this is not what I want. I've tried a few hack attempts on the dumb spooler interface with no success. Has anyone done this?...

  1. #1

    Default print spooler to email

    G'Day,

    I trying to set up a spooler interface to email print jobs (to a fixed
    destination) rather than have them printed.

    I see from google groups that Jeff Lieberman has sent email to printers
    - this is not what I want.

    I've tried a few hack attempts on the dumb spooler interface with no
    success.

    Has anyone done this?



    /dev/null Guest

  2. #2

    Default Re: print spooler to email

    /dev/null typed (on Tue, Nov 25, 2003 at 02:49:09AM +0000):
    | G'Day,
    |
    | I trying to set up a spooler interface to email print jobs (to a fixed
    | destination) rather than have them printed.
    |
    | I see from google groups that Jeff Lieberman has sent email to printers
    | - this is not what I want.
    |
    | I've tried a few hack attempts on the dumb spooler interface with no
    | success.
    |
    | Has anyone done this?

    I've got assorted printer interface scripts that pipe their ouput to
    visionfs, or to netcat, so it's no big deal to instead pipe to a
    mail|mutt command.

    Just enclose the last part of the cript, which actually loops over the
    input file, between squiggly braces, and pipe that to whatever you wish.

    --
    JP
    Jean-Pierre Guest

  3. #3

    Default Re: print spooler to email

    /dev/null <dhartn.o.s.p.a.m.ultranet.com> wrote: 
     
     
     
     

    Yes. And more bizarre things. All it takes is an understanding of
    how the printer interface scripts work: see
    http://aplawrence.com/SCOFAQ/scotec7.html

    --
    com Unix/Linux/Mac OS X resources: http://aplawrence.com
    Get paid for writing about tech: http://aplawrence.com/publish.html



    Tony Guest

  4. #4

    Default Re: print spooler to email

    Jean-Pierre Radley wrote:
     

    FWIW, this is how i did netcat last, changing the 'dumb' interface script:

    #Use netcat for this network printer
    FILTER="/u/netcat -h highspeed -p 9100"

    and that works, so, it's what I tried first:

    FILTER="/usr/bin/mail -s report boopy"

    (boopy being a user on the system) which gives no errors and no mail.

    So I tried this:

    cat ${file}| /usr/bin/mail -s report boopy
    #0<${file} eval ${FILTER} 2>&1

    To test i typed in l|lp -d email (clever name, eh?)
    and root gets this msg:


    Your request email-4505 destined for email
    encountered an error while printing on printer email.

    Reason for failure:

    /usr/spool/lp/admins/lp/interfaces/email: /usr/bin/mail: text busy

    Well, I can fix the error msg by changing it to this:

    cat ${file}| /usr/bin/mail -s report boopy 2>&1

    but I still get no email.


    Or did you mean:

    { while [ $i -le $copies ]
    ....
    done } | mail -s report boopy

    ?

    that also gave an error which is inscrutable to me...

    Regards, Dirk

    /dev/null Guest

  5. #5

    Default Re: print spooler to email

    /dev/null typed (on Tue, Nov 25, 2003 at 04:11:11PM +0000):
    | Jean-Pierre Radley wrote:
    |
    | >/dev/null typed (on Tue, Nov 25, 2003 at 02:49:09AM +0000):
    | >| G'Day,
    | >|
    | >| I trying to set up a spooler interface to email print jobs (to a fixed
    | >| destination) rather than have them printed.
    | >|
    | >| I see from google groups that Jeff Lieberman has sent email to printers
    | >| - this is not what I want.
    | >|
    | >| I've tried a few hack attempts on the dumb spooler interface with no
    | >| success.
    | >|
    | >| Has anyone done this?
    | >
    | >I've got assorted printer interface scripts that pipe their ouput to
    | >visionfs, or to netcat, so it's no big deal to instead pipe to a
    | >mail|mutt command.
    | >
    | >Just enclose the last part of the cript, which actually loops over the
    | >input file, between squiggly braces, and pipe that to whatever you wish.
    | >
    |
    | FWIW, this is how i did netcat last, changing the 'dumb' interface script:
    |
    | #Use netcat for this network printer
    | FILTER="/u/netcat -h highspeed -p 9100"
    |
    | and that works, so, it's what I tried first:
    |
    | FILTER="/usr/bin/mail -s report boopy"
    |
    | (boopy being a user on the system) which gives no errors and no mail.
    |
    | So I tried this:
    |
    | cat ${file}| /usr/bin/mail -s report boopy
    | #0<${file} eval ${FILTER} 2>&1
    |
    | To test i typed in l|lp -d email (clever name, eh?)
    | and root gets this msg:
    |
    |
    | Your request email-4505 destined for email
    | encountered an error while printing on printer email.
    |
    | Reason for failure:
    |
    | /usr/spool/lp/admins/lp/interfaces/email: /usr/bin/mail: text busy
    |
    | Well, I can fix the error msg by changing it to this:
    |
    | cat ${file}| /usr/bin/mail -s report boopy 2>&1
    |
    | but I still get no email.
    |
    |
    | Or did you mean:
    |
    | { while [ $i -le $copies ]
    | ...
    | done } | mail -s report boopy
    |
    | ?
    |
    | that also gave an error which is inscrutable to me...

    .... and even more inscrutable to us, since our crystal balls do
    not reveal what error you got.

    I just created a printer called mailme, using the dumb model, and using
    /dev/null. I made these changes:

    { #JPRadley
    while [ $i -le $copies ]
    do
    for file in $files
    do
    0<${file} eval ${FILTER} 2>&1
    #JPRadley echo "\014\c"
    done
    i=`expr $i + 1`
    done
    } | mail -s PrintJobMailer jpr

    As expected, 'lp -dmailme file_name' put the contents of file_name in a
    message in my mailbox.

    --
    JP
    Jean-Pierre Guest

  6. #6

    Default Re: print spooler to email

    On Tue, 25 Nov 2003 16:11:11 GMT, /dev/null
    <dhartn.o.s.p.a.m.ultranet.com> wrote:
     
    >
    >FWIW, this is how i did netcat last, changing the 'dumb' interface script:
    >
    >#Use netcat for this network printer
    >FILTER="/u/netcat -h highspeed -p 9100"
    >
    >and that works, so, it's what I tried first:
    >
    >FILTER="/usr/bin/mail -s report boopy"
    >
    >(boopy being a user on the system) which gives no errors and no mail.
    >
    >So I tried this:
    >
    > cat ${file}| /usr/bin/mail -s report boopy
    > #0<${file} eval ${FILTER} 2>&1
    >
    >To test i typed in l|lp -d email (clever name, eh?)
    >and root gets this msg:
    >
    >
    > Your request email-4505 destined for email
    > encountered an error while printing on printer email.
    >
    > Reason for failure:
    >
    > /usr/spool/lp/admins/lp/interfaces/email: /usr/bin/mail: text busy
    >
    >Well, I can fix the error msg by changing it to this:
    >
    > cat ${file}| /usr/bin/mail -s report boopy 2>&1
    >
    >but I still get no email.
    >
    >
    >Or did you mean:
    >
    >{ while [ $i -le $copies ]
    >...
    >done } | mail -s report boopy
    >
    >?
    >
    >that also gave an error which is inscrutable to me...
    >
    >Regards, Dirk[/ref]

    Simplest form I could come up with quickly:
    (testmail is the printer name, using /dev/null)

    # pwd
    /usr/spool/lp/admins/lp/interfaces

    # more testmail
    shift; shift; shift; shift
    files="$*"
    for file in $files
    do
    mail -s "testing through lp" root <${file}
    done

    exit 0

    # lp -dtestmail /etc/hosts

    The contents of /etc/hosts is found in root's mailbox.


    Scott McMillan

    Scott Guest

  7. #7

    Default Re: print spooler to email

    Jean-Pierre Radley wrote: 
    <snip> 

    I had set the device to /dev/null after having used /usr/bin/mail as a
    device, forgetting to stop & start the spooler, explaing my odd 'text
    busy' msg.

    Your method works perfectly as does my changing the FILTER eg,

    FILTER="/usr/bin/mail -s report boopy"

    Thanks for your help.

    /dev/null Guest

Similar Threads

  1. Print Spooler folder
    By Vic in forum Windows Server
    Replies: 2
    Last Post: July 19th, 10:53 PM
  2. Print Spooler Problem
    By Keith in forum Windows Server
    Replies: 1
    Last Post: June 29th, 01:35 PM
  3. Print Spooler Service Keeps Stopping
    By Keith in forum Windows Server
    Replies: 0
    Last Post: June 22nd, 08:49 AM
  4. Svr 03 web-ed; rem access to print spooler
    By Steve R in forum Windows Server
    Replies: 5
    Last Post: June 5th, 07:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139