Wolfgang Zeikat <[EMAIL PROTECTED]> writes:
> In the previous episode (29.01.2001), Dave Sill <[EMAIL PROTECTED]>
> said:
> >>#!/bin/bash
> >>#~/filter
> >>cat > /tmp/to$RECIPIENT.txt
> >>if [ "$(grep 'Subject: whatever' /tmp/to$RECIPIENT.txt)" = "Subject: whatever" ]
> >>then
> >>        cat "/tmp/to$RECIPIENT.txt" | qmail-inject devnul
> >>else
> >>        cat "/tmp/to$RECIPIENT.txt" | qmail-inject $USER-real
> >>fi
> >>rm -f /tmp/to$RECIPIENT.txt
> >>
> >>
> >>
> >>/var/qmail/alias/.qmail-devnul will delete every mail sent to devnul
> >
> >Why not just not re-inject it?
> 
> i wasnt sure if i could use that "if" construction directly in a .qmail
> file (can that be done?),

Yes, but only the entire shell script is all on one line (with
commands separated by semicolons instead of newlines).  I'd rewrite
the whole thing into a .qmail file like this:
|exec > /dev/null 2>&1; 822field subject | grep 'whatever' && exit 99; exit 0
|forward other-address

Also note that the original request was for scanning outgoing mail as
well.  .qmail files can't help there.


paul

Reply via email to