procmail
[Top] [All Lists]

Re: auto-responder that quotes message headers & body

2000-10-10 13:04:22
Hi lewst !

On Tue 10 Oct 2000 (12:29), you muttered on the list:

I've implemented an auto-reply recipe, but want to quote the original
message (including headers) below the echo lines, and the message
should be quoted with ">".  For example,

  From: postmaster(_at_)corp(_dot_)com
  Subject: Re: hello

  Returned mail: User not local;
  please try <melissa(_at_)virtual(_dot_)com>

  > sender's message headers and body quoted here

------------------------------------------------------

:0:
* !^FROM_DAEMON
* !^X-Loop: lewst(_at_)corp(_dot_)com
* ^TOmelissa\(_at_)corp(_dot_)com
{
  :0 fh
    | formail -r -I"Precedence: junk" \
                 -A"X-Loop: lewst(_at_)corp(_dot_)com" \
                 -I"From: postmaster(_at_)corp(_dot_)com" ;\
      echo "Returned mail: User not local;" ; \
      echo "please try <melissa(_at_)virtual(_dot_)com>" ; \
      echo ; \

  :0
  | $SENDMAIL -oi -t
}

I do this by creating a local copy and then catting it .. it might not be
perfect, but works fine for me:

:0 c
  tempcopy

:0 fhw
{
  :0 c: spamtemp.lock
  | (formail -rt + lotsa formail options \
    cat tempcopy; \
    rm -f tempcopy ) \
    | $SENDMAIL
}

You could use sed to append the ">" while piping anyway, I would presume.

Grtz,

Nils.

Attachment: pgpRa9k8mZ11D.pgp
Description: PGP signature

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