procmail
[Top] [All Lists]

Re: subject line permantly tagged with name of list

1997-01-31 00:02:15
Do you know of the moderate script that allows moderation from the
Subject: line?  I wrote the procedure to fit into and enhance it.  My
problem is that I wish to have multiple moderators, and they can't modify
the mail header (necessarily).

It is possible to allow the "Approved:" line to appear as the first
non-blank line of the message body.  A simple procmail recipe might
look like the one in "rc.local.r00" from my smartlist library:

    :0 HB
    * H ?? !^Approve: 
    * B ??  ^\/Approve:.*[^ ]
    * $!^X-Loop: $\listaddr
    {
      # Remove the Approve from the body, and insert it in the header
      :0 fw
      | grep -v "^Approve:" | formail -I"$MATCH"
    }

    # Or, if the Approve command is on the subject and not in the 
    # header, move it to the header.
    #
    # It must be surrounded by square-brackets [ ], in order to leave 
    # the surrouding text as the real subject
    #
    # The [Approve: ADDRESS] can occur anywhere on the Subject line (ie:
    # the beginning, or the end).
    #
    # Eg: Subject: [Approve: myaddress(_at_)foo(_dot_)com] The real subject blah
    # Or: Subject: The real subject blah [Approve: myaddress(_at_)foo(_dot_)com]
    #
    :0 E
    * !^Approve:
    *  ^Subject:.*\[Approve:.*\]
    *  ^Subject:.*\[\/Approve:[^]]+
    * $!^X-Loop: $\listaddr
    {
      # Extract the Approve text and the remaining Subject
      APPR=$MATCH               # get the approve command
      SUBJ=`formail -zxSubject: | sed -e 's/ *\[Approve:[^]]*\] */ /'`
      :0 fw
      | formail -I"Subject: $SUBJ" -I"$APPR"
    }

Place this recipe in a file, and name the file in "rc.custom" on
the RC_LOCAL_SUBMIT_00 line.

Now why you want to do this "From:" translating is beyond me.

This reply is an example of exactly why I want to munge the From: field.
In pine I see the line:

+   552 Jan 30 Alan K. Stebbens         (2,772) Re: subject.... 

I hit r for reply and here I am replying to you, and not the list.

This is as it should be.  Most MUAs offer a group-reply or individual
reply option, and the default is best to reply to the individual.

I agree that lists are for sharing, but the sharing should be a
*conscious* decision, and not an automatic one.  Look at the recent
blatherings which were probably not really intended for the list.

Granted, I can reply to all recipients, but then you get two copies.

Nope. I use "dupcheck.rc" :^).  Besides, that's my concern, not yours.

Furthermore, since I don't recognize your name (until now), I can't easily
tell where you are mailing from.  Are you an individual asking for a list
subscription, a mailing list subscriber, or what.  

Changing the "From:" line is not a good way of identifying the source
of the mail.  We all have different ways of identifying what we each
consider to be the source of a message: I prefer to think of the
original author as the source of the mail, while you apparently
consider the list by which it came to you as the "source".  Since we
disagree, it would not make me happy to have you be the manager of the
lists of which I am a member and enforce your ideas on messages I
receive.

By changing the From:
field, and including the original poster's name as the first line in the
body, the list subscribers always see the name of the list as the sender,
and yet can still tell who posted the message.

I can' tell  if you mean to do this to a list or to your personal,
incoming mail.  If the latter, then do what you like -- it's your email
:^).  But, if you are planning to affect a mailing list with this plan,
please reconsider for the benefit of your list members.

If you really wish to help identify the originating list, then insert a
new header instead of mucking with a perfectly good one.  Do something
like this:

    :0 fh
    | formail -A"X-Mailing-List: $list"

in a Smartlist recipe file (at either RC_LOCAL_SUBMIT_00, _10, or _20.

BTW, SmartList already does this, when it inserts:

    X-Mailing-List: <SmartList(_at_)informatik(_dot_)rwth-aachen(_dot_)de> 
archive/latest/3337

You just need to configure your MUA to display some part of this header
in your summary.  MH can do this easily.

Is procmail readily useful, or can I anticipate a week or two of hitting
the docs and another week or so of experimenting?  What's been your
experience?

Well, SmartList is based on procmail, and I could not nor would not
manage my mail without procmail.  I've done a lot of "pro bono" work to
make it easy for procmail users to become useful with it.  Check out my
procmail library (send me an email with "send procmail library" as the
subject, or browse my web page under the mail link).

___________________________________________________________
Alan Stebbens <aks(_at_)sgi(_dot_)com>      http://reality.sgi.com/aks

PS: I've shared this with the SmartList and procmail lists 
as a conscious decision, because the recipe above is probably
useful to others as well.

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