procmail
[Top] [All Lists]

Re: procmail

1999-07-30 03:16:13
Some random followups on something I posted earlier. (The server is
slow as molasses, slower than usual [that's "slllloooowwwwww"]; not
even sure if the post I'm following up on came through just yet.)

Sorry for talking to myself, just wanted to clarify a couple of
things.

On Thu, 29 Jul 1999 09:35:18 +0300 (EET DST), I wrote:
You don't really need formail here if you want the entire headers and
body to be preserved. Just tack on a new set of headers and your
message before the message you are forwarding:

  | ( echo "Subject: blah blah" ; \
      echo ; \
      echo "Abuse note from: $FROM" ; \
      echo "Abuse note to  : $TO" ; \
      echo ; \
      cat - ; : this is where the forwarded message gets included ) \
    | $SENDMAIL $SENDMAILFLAGS root

(This might cause trouble if the original message was a MIME message
and you are not preserving this information in the headers. In
particular, the forwarded message could contain long lines and binary
data without proper MIME headers identifying it as not strictly RFC822
mail.)

    :0
    * ^From:\<*\/.+
    { FROM=$MATCH }
    :0
    * ^To:\<*\/.*
    { TO=$MATCH }  # this will grab the first To: field when there are many

Seems I got a bit carried away with the \<* thing here. The condition
lines are better like this:

    ^From:[     ]*\/[^  ].*
    ^To:[       ]*\/[^  ].*

where the whitespace between the square brackets consists of a space
and a tab on each occurrence.

I had something like this in an earlier recipe in this thread, where
we were grabbing from the From_ line -- I used ^From\<* which will
match the From: header, too; in practice, this should not become a
problem, though (assuming there will always be a From_ line first).

Again, sorry for not being more careful,

/* era */

-- 
 Too much to say to fit into this .signature anyway: <http://www.iki.fi/era/>
  Fight spam in Europe: <http://www.euro.cauce.org/> * Sign the EU petition

<Prev in Thread] Current Thread [Next in Thread>
  • procmail, ryanm
    • Message not available
      • Re: procmail, era eriksson <=