procmail
[Top] [All Lists]

Re: Newbie ?? - Changing the Subject: line

1998-04-07 21:39:11
"Kevin" == Kevin H Ingle <kingle(_at_)cisco(_dot_)com> writes:

    Kevin> I'm using procmail to advance filter my email on the UNIX
    Kevin> side, which I then download using Eudora on my PC and
    Kevin> filter it some more.  I'd like to avoid /dev/nulling my

    Kevin> Using the example of spam, how would I change the Subject:
    Kevin> from the "current title" to "SPAM - current title"?

Here's a simple way to do this using sed:

| sed -e '/^Subject:/s/Subject: \(.*\)/Subject: [ADDED_WORD] \1/'

/^Subject:/  # address of the line to be read
/s/Subject: \(.*\)/  # substitution target -- the parens capture the
                     # actual subject text for backreferencing
/Subject: [ADDED_WORD] \1/  # the entire subject line is replaced with 
                            # this.  \1 is the backreference to
                            # restore the original subject text.

mp

                Michael Powe       looie(_at_)teleport(_dot_)com
                 pgpk -a finger://teleport.com/looie
  Portland, Oregon, USA   "Home of the Summer Wiener Dog Nationals"


"Mathematics, rightly viewed, posesses not only truth, but supreme
beauty -- a beauty cold and austere, like that of sculpture."
-- Bertrand Russell

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