procmail
[Top] [All Lists]

Re: Add a string to "From" field

1998-11-16 16:37:27
At 08:40 AM 11/16/98 -0600, Philip Guenther wrote:
[snippety snip]
      # 'f'ilter the 'h'eader through formail, 'w'aiting for it finish
      # to check the return code
      :0 fhw
      * ^From:\/.*
      |formail -I"From: $MATCH ($WORD)"

If you wanted the word to be at the beginning of the From: field, you
would change the action line to:

      |formail -I"From: ($WORD) $MATCH"

Yes, there will usually be two spaces next to each other in the
resulting From: line, as the value of MATCH will almost certainly start
with a space.

Using this condition instead:
        * ^From: *\/.*
should avoid any leading blank(s) in MATCH, I think.

Cheers,
Stan

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