procmail
[Top] [All Lists]

Re: flaky recipe -- too bad it's not for pastries

2003-02-14 02:04:55
On Thursday, Feb 13, 2003, at 23:29 Canada/Mountain, Jeff Orrok wrote:
 :0Wh
  * !^FROM_DAEMON
  * !^X-Loop: procmail(_at_)orrok(_dot_)com
  | (formail -q- -r \
      -XSubject: \
      -XTo: ; \
     echo "From: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "Reply-To: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     echo "X-Loop: procmail(_at_)orrok(_dot_)com" ; \
echo ; echo "Hello, you sent a message with the above subject to $SENTTO" ; \
     cat $HOME/autoreply.text ; \
) 2>>ERROR${LASTMSG} | $SENDMAIL $SENDMAILFLAGS -t 2>>ERROR${LASTMSG}

I am under the impression I should be able to use -A to insert the From: Reply-To: and X-Loop: fields (or maybe -a or -I or -i or ???). No matter what
I try, formail does not cooperate.

      -a headerfield
            Append a custom headerfield onto the header; but only
            if  a similar field does not exist yet.  If you spec-
            ify either one of  the  field  names  Message-ID:  or
            Resent-Message-ID:  with no field contents, then for-
            mail will generate a unique message-ID for you.

       -A headerfield
            Append a custom headerfield onto the  header  in  any
            case.

      -i headerfield
            Same  as  -A, except that any existing similar fields
            are renamed by prepending  an  ``Old-''  prefix.   If
            headerfield  consists  only  of a field-name, it will
            not be appended.

       -I headerfield
            Same as -i, except that any existing  similar  fields
            are  simply removed.  If headerfield consists only of
            a field-name, it effectively deletes the field.

so formail -A "From: bob(_at_)domain(_dot_)tld" will add bob(_at_)domain(_dot_)tld to the From: header while -I will clobber the existing From and replace it. -i will clobber the existing From and move it to Old-From:

  | (formail -r -q- -X "Subject:" -X "To:" \
     -A "From: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     -A "Reply-To: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
     -A "X-Loop: procmail(_at_)orrok(_dot_)com" \
     -A "Precedence: bulk" ; \
echo ; echo "Hello, you sent a message with the above subject to $SENTTO" ; \
     cat $HOME/autoreply.text ; \
) 2>>ERROR${LASTMSG} | $SENDMAIL $SENDMAILFLAGS -t 2>>ERROR${LASTMSG}

(I'v never used the -X flags, so I left them intact, although you do need, I think, to quote the headers)

I'm not sure why you're extracting the To: header though, nor the subject. The autoreply format will generate the message correctly.

You should include the Precedence: bulk header, I think.

--
Well I've seen the Heart of Darkness/Read the writing on the wall/and the voice out in the desert/Was the voice out in the hall


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail