Re: [gentoo-user] Procmail and mail "notification" (SOVLED)

2003-08-30 Thread Jason Stubbs
On Saturday 30 August 2003 14:15, Yorkshire Dave wrote: > On Fri, 2003-08-29 at 14:50, Jason Stubbs wrote: > > Hmmm > > > > I've called the script notify and changed it as follows: > > > > #!/bin/sh > > This is probably a silly question but why not just script it straigh

Re: [gentoo-user] Procmail and mail "notification" (SOVLED)

2003-08-30 Thread Yorkshire Dave
On Fri, 2003-08-29 at 14:50, Jason Stubbs wrote: > Hmmm > > I've called the script notify and changed it as follows: > > #!/bin/sh > This is probably a silly question but why not just script it straight into ~/.procmailrc? Oh, and it makes sense to use formail to extract the relevant field

Re: [gentoo-user] Procmail and mail "notification" (SOVLED)

2003-08-30 Thread Marshal Newrock
On Sat, 30 Aug 2003, Jason Stubbs wrote: > The grep line is fairly easy to understand. I've got to learn regular > expressions, though. They seem too useful! That's what I meant. 'man 7 regex' and 'man pcre' for regular regular expressions and perl compatible regular expressions, respectively.

Re: [gentoo-user] Procmail and mail "notification" (SOVLED)

2003-08-30 Thread Jason Stubbs
On Saturday 30 August 2003 03:02, Marshal Newrock wrote: > It's been a little while since I've done something like this, but I think > I've got it. 'cat /dev/stdin' is the wrong way to read input to a > command. Also, I'd just save everything in a variable, and avoid disk > access. And make sure

Re: [gentoo-user] Procmail and mail "notification" (SOVLED)

2003-08-29 Thread Marshal Newrock
On Fri, 29 Aug 2003, Jason Stubbs wrote: > #!/bin/sh > > TMP1=`mktemp /tmp/mailcheck.XX` > TMP2=`mktemp /tmp/mailcheck.XX` > > cat /dev/stdin > $TMP1 > grep Date: $TMP1 | head -n 1 > $TMP2 > grep From: $TMP1 | head -n 1 >> $TMP2 > grep Subject: $TMP1 | head -n 1 >> $TMP2 > cat $TMP2 | mail

Re: [gentoo-user] Procmail and mail "notification" (SOVLED)

2003-08-29 Thread Jason Stubbs
Hmmm I've called the script notify and changed it as follows: #!/bin/sh TMP1=`mktemp /tmp/mailcheck.XX` TMP2=`mktemp /tmp/mailcheck.XX` cat /dev/stdin > $TMP1 grep Date: $TMP1 | head -n 1 > $TMP2 grep From: $TMP1 | head -n 1 >> $TMP2 grep Subject: $TMP1 | head -n 1 >> $TMP2 cat $TMP

Re: [gentoo-user] Procmail and mail "notification" (SOVLED)

2003-08-29 Thread Jason Stubbs
Okay! Done it. Here's the script if anyone else is interested: #!/bin/sh MAILADDR="[EMAIL PROTECTED]" TMP1=`mktemp /tmp/mailcheck.XX` TMP2=`mktemp /tmp/mailcheck.XX` cat /dev/stdin > $TMP1 grep Date: $TMP1 | head -n 1 > $TMP2 grep From: $TMP1 | head -n 1 >> $TMP2 grep Subject: $TMP1 | he