[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: procmail, problem with this delivering recipe

T o n g wrote:
> Bob Proulx wrote:
> >>   :0 Hfhwi
> >>   * ^Subject: \/.*
> >>   | formail -b -c -X From: -X To: -X Subject: -X Date: . . . |
> > 
> > You need to create another recipe for the second pipe.
> > 
> >   :0 Hfhwi
> >   * ^Subject: \/.*
> >   | formail -b -c -X From: -X To: -X Subject: -X Date: . . .
> > 
> >   :0 A
> Thanks. It works.
> Hmm, may I know why the change is necessary?

The man page for procmailrc has the following information:

       A line starting with ':' marks the beginning of a recipe.  It  has  the
       following format:

              :0 [flags] [ : [locallockfile] ]
              <zero or more conditions (one per line)>
              <exactly one action line>

The documented format is "<exactly one action line>" and therefore you
can only have exactly one action line.  :-)

> there were actually more piping commands between formail & $SENDMAIL
> in my rcfile.

Yes.  But as noted that is incorrect.  Only one action line is allowed
there.  If I need to do something more complicated then normally I
create a script and put all of the complication there and simply call it.

> Now procmail considers the mail delivered, however I wanted to send
> header only, but now I receive some part of mail body as well. Thus
> I need to know why.

If you want the header only then you need to include the 'h' flag.

       b    Feed the body to the pipe, file or mail destination (default).

       h    Feed the header to the pipe, file or mail destination (default).

       w    Wait for the filter or program to finish and  check  its  exitcode
            (normally  ignored);  if the filter is unsuccessful, then the text
            will not have been filtered.

Therefore something like this for the second part of the recipe.  The
default will be the flags "hb" and you only want the 'h' flag.  Along
with 'w' of course to wait for the exit code of sendmail.

  :0 Ahw


Attachment: signature.asc
Description: Digital signature

Reply to: