Filter for sending e-mail

Helge Blischke H.Blischke at srz-berlin.de
Mon Dec 13 05:35:57 PST 2004


Colin wrote:
> 
> Helge Blischke wrote:
> > ce.mcdonald at gmail.com wrote:
> > >
> > > I need to migrate a LPRng filter/printer solution over to CUPS
> > >
> > > Here is the LPRng printer
> > >
> > > e-mail
> > > :if=/usr/local/sbin/e-mail-lp-filter
> > > :lp=/dev/null
> > > :lpd_bounce=false
> > > :ml=0
> > > :mx=0
> > > :sd=/var/spool/lpd/email
> > >
> > > The filter looks like this
> > >
> > > FILE="/tmp"'/bin/date +/%Y%m%d_%H%M%S_email'
> > > eval cat -> $FILE
> > > eval cat $FILE|tr -d '\000\r\f'|/user/sbin/sendmail -t
> > > rm -f $FILE
> > >
> > > exit 0
> > >
> > > Basically we send a text file from an AS/400 that is text and the header info is stripped by sendmail -t and sent out through the MTA
> > >
> > > I found a mailto backend to send mail but it sends an attachment and accepts only a mailto and mailfrom variable from lp command
> > >
> > > Can any one help me come up with a simple solution for this?
> > >
> > > Thanks
> > > Colin
> >
> > You may try defining your printer as follows:
> >
> > lpadmin -p e-mail -v file:/dev/null -i /usr/local/sbin/e-mail-lp-filter
> >
> > Do not forget to enable printing to file in your mime.types and
> > mime.convs files.
> >
> > A more CUPS-like method would be to modify your script to behave like a
> > CUPS
> > backend (similar to the mailto backend you mentioned).
> >
> > Helge
> >
> > --
> > Helge Blischke
> > Softwareentwicklung
> > SRZ Berlin | Firmengruppe besscom
> > http://www.srz.de
> > tel: +49 30 75301-360
> 
> Thanks for the info. I tried the command and I get the following:
> 
> lpadmin: add-printer (set model) failed: client-error-not-found
> 
> I assume that is because of what you said about enabling printing to a file. It seems like I found something on how to do this yesterday but I can't seem to find it today. Can you guide me in the right direction. I also read somehwere about the CUPS development blocking output to a file from certain versions forward for security reasons.
> 
> Thanks again!
> 
> Colin

I never did it this way myself, so apologize. Put your script into the
model directory
(usually /usr/share/cups/model) and use only the script's basename in
the lpadmin command,
not the full path name.
If that fails, let me know.

Helge

-- 
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de
tel: +49 30 75301-360




More information about the cups mailing list