procmail
[Top] [All Lists]

Re: [Procmail] Re: Create new mail with procmail

1997-01-16 22:58:51
Hi Alan K. Stebbens!  I'm a UNIX administrator and I like to fight spam!

   | Mail -s "$MATCH" my_pager(_at_)paging(_dot_)com </dev/null
    ^^^                                         ^^^^^^^^^^
    Um, I don't think MAIL is going to like input from TWO sources. :-)

One more thing, since I didn't make this clear in my previous answer:
Mail doesn't care where it's ONE source of input comes from, since the
shell is being told to redirect its stdin from /dev/null.

Paste these commands into a shell:

  cat <<EOF >test.rc
    VERBOSE=yes
    LOGABSTRACT=all
    DEFAULT=|

    :0i
    | cat </dev/null
EOF

  procmail -m test.rc < /etc/hosts

This is the output you should get (with different times and pids):

procmail: [4004] Thu Jan 16 21:48:31 1997
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "DEFAULT=|"
procmail: Executing " cat </dev/null"
procmail: Assigning "LASTFOLDER= cat </dev/null"
  Folder:  cat </dev/null                                                  3886

Notice that "cat" produces no output, even though procmail is feeding
it the contents of the "/etc/hosts" file.  Because of the input
redirection, procmail execs the "cat" command with a shell, which
performs the redirection of stdin to /dev/null.  The contents
of "/etc/hosts" sent by procmail to the shell on its stdin is lost.

Hope this helps.
___________________________________________________________
Alan Stebbens <aks(_at_)sgi(_dot_)com>      http://reality.sgi.com/aks