procmail
[Top] [All Lists]

where's STDOUT?

1999-03-08 14:01:55
Procmailers:

I am trying to include some informative text with bounces.
As I understand, procmail's STDOUT is pointed to sendmail,
and whatever sendmail sees there, gets included in the bounce
upon returned a proper exit code (from EX_foo). I've verified
this.

I have seen a number of posts dating back to something like 
1996 where I saw a number of examples on how to accomplish this
in procmail, which is our local delivery agent. It is not 
working :-(

As a test, I have the following procmailrc file, which, as 
I understand it, should echo "foo" in STDOUT, echo whatver
I'm feeding via prodmail's STDIN, and the exit (roughly the
behavior I need under sendmail):

  SHELL=/bin/sh
  LOGFILE=/var/log/procmail.log
  VERBOSE=yes
  PATH=/bin:/usr/bin:/usr/local/bin
  DROPPRIVS=yes

  :0
  {
        :0 f
        | echo "foo"

        :0
        |

        :0
        {
         EXITCODE=69
         HOST=foobar
        }
  }

I have a file, /tmp/message, that looks like this:

  THIS IS A DUMMY FILE

And the I run this from the command line (as root):

  procmail -d gerir < /tmp/message

root(_at_)blah:~# procmail -d gerir < /tmp/message
From root  Mon Mar  8 13:01:45 1999
THIS IS A DUMMY FILE
root(_at_)blah:~# 

I see the contents of /tmp/message, but whwre did "foo" go?

From the logfile:

procmail: [8769] Mon Mar  8 13:01:45 1999
procmail: Assigning "PATH=/bin:/usr/bin:/usr/local/bin"
procmail: Assigning "DROPPRIVS=yes"
procmail: Assuming identity of the recipient, VERBOSE=off
procmail: Error while writing to "echo"
procmail: Rescue of unfiltered data succeeded
From root  Mon Mar  8 13:01:45 1999
  Folder: |                                                                  58

I see the "error while writing to echo" but I'm at a loss here.

I followed the directions in 

http://www.xray.mpe.mpg.de/mailing-lists/procmail/1996-01/msg00143.html

to create the recipe: An excerpt:

Stderr is unreachable after an assignment to LOGFILE (unless you clone
procmail before that).
However, stdout is still available.  And, as it happens, sendmail treats
stdout and stderr the same.  Anything that comes out of stdout is put
in the bounce message as well.
Use a recipe like:
       :0
       |
To dump the current message to stdout.
To get intermediate texts out without destroying the message in the
procmail buffer use:

      :0 c
       {
               :0 f
               | echo "Some text you want in the response"

               :0
               |
       }
-- 
Sincerely,                                                          
srb(_at_)cuci(_dot_)nl
          Stephen R. van den Berg (AKA BuGless).


Not being a particularly good C programmer, I can get much from
the code (apologies).

Has this disposition for STDOUT changed? I've tried this with 3.11pre7
and 3.12.

Thanks much.

Gerir

<Prev in Thread] Current Thread [Next in Thread>