On Wed, 08 Nov 2000 14:24:11 GMT, "Michael Vorburger" wrote:
> I need to implement a New Mail Notification; not for login like qbiff etc,
> but more like notifiying users on another external email, SMS etc in the
> future. So a simple forward won't do, I need to call some external script
> each time new mail comes in.
This is what I do. I have a dot-qmail file that looks like this:
| if grep -i "^$SENDER" $HOME/.qmailpage > /dev/null; then sed -n -f
|$HOME/bin/mail2page.sed | qmail-inject -f$SENDER [EMAIL PROTECTED]; exit 0;
|else echo "You are noth authorized to send me a page"; exit 100; fi
| /usr/local/bin/maildrop
The first pipe will check that the sender is valid, and if so it will
allow the page through.
Here are the contents of mail2page.sed:
/^From:/p
/^Subject:/p
This works very well, provided that no on knows the real email address
of the pager and they don't spoof the SENDER. You could modify this
script not to return an error code, or not even check the sender for
that matter.
:-)
Andy