Indeed. One of the neat things about mail delivered via qmail-local
is that stdin is *the* queue file.
That it's a file is confirmed by this sentence in the qmail-local manpage.
The standard input for qmail-local must be a seekable
file, so that qmail-local can read it more than once.
Regards.
On Wed, Jan 19, 2000 at 02:29:03PM -0600, [EMAIL PROTECTED] wrote:
>
> On Wed, 19 Jan 2000 20:05:24 +0000 (GMT) , [EMAIL PROTECTED] writes:
> > #include <stdio.h>
> > #include <stdlib.h>
> > void main(void)
> > {
> > long len=0L;
> >
> > fseek( stdin, 0L, SEEK_END);
> > len=ftell(stdin);
> > fseek( stdin, 0L, SEEK_SET);
> > if (len>=128000L)
> > system("/var/qmail3/bin/forward \"$DEFAULT@$HOST\"");
> > else
> > system("/var/qmail2/bin/forward \"$DEFAULT@$HOST\"");
> > }
>
> ugh... two seeks? Stat() is sooo much nicer ;-)
>
> #include <stdlib.h>
> #include <unistd.h>
> #include <sys/stat.h>
> #include <sys/types.h>
>
> int main(void) {
> struct stat st;
> if (fstat(0, &st) < 0) _exit(111);
> if (lseek(0,0,SEEK_SET)< 0) _exit(111);
> if (st.st_size >= 128000L)
> system("/var/qmail3/bin/forward \"$DEFAULT@$HOST\"");
> else
> system("/var/qmail2/bin/forward \"$DEFAULT@$HOST\"");
> return 0;
> }
>
> --
> Chris Mikkelson | If you throw your bread upon the waters, it shall come
> [EMAIL PROTECTED] | back threefold, but only if you are willing to throw the
> | recipe upon the waters as well... -- Terry Lambert
>