procmail
[Top] [All Lists]

Re: procmail-d Digest V96 #177

1996-12-09 14:00:58
How do I cancel this???

From:          procmail-d-request(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Date:          Mon, 9 Dec 1996 15:35:33 +0100 (MET)
Subject:       procmail-d Digest V96 #177
To:            procmail-d(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Reply-to:      procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE

------------------------------

Content-Type: text/plain

procmail-d Digest                               Volume 96 : Issue 177

Today's Topics:
  auto-reply to: procmail-d Digest V96  [ tpdweb(_at_)cadence(_dot_)com 
(Technical pract ]
  auto-reply to: procmail-d Digest V96  [ tpdweb(_at_)cadence(_dot_)com 
(Technical pract ]
  subject-based killfile                [ Timothy J Luoma 
<luomat(_at_)nerc(_dot_)com> ]
  Re: subject-based killfile            [ bodysurf(_at_)netcom(_dot_)com (Tim) ]
  Re: auto-reply to: procmail-d Digest  [ Wotan <wotan(_at_)netcom(_dot_)com> ]
  Counting messages in a mailbox        [ Stan Ryckman 
<stanr(_at_)sunspot(_dot_)tiac(_dot_)ne ]
  [Q]: Interpretation of my .forward f  [ MAILBOX <dnhunt(_at_)rain(_dot_)org> ]
  Re: Counting messages in a mailbox    [ Timothy J Luoma 
<luomat(_at_)peak(_dot_)org> ]
  Re: Counting messages in a mailbox    [ "Alan K. Stebbens" 
<aks(_at_)anywhere(_dot_)en ]
  Re: multiple simultaneous extraction  [ "Alan K. Stebbens" 
<aks(_at_)anywhere(_dot_)en ]
  Re: Counting messages in a mailbox    [ Stan Ryckman 
<stanr(_at_)sunspot(_dot_)tiac(_dot_)ne ]
  Re: subject-based killfile            [ "Alan K. Stebbens" 
<aks(_at_)anywhere(_dot_)en ]
  a ^FROM like ^TO                      [ Timothy J Luoma 
<luomat(_at_)nerc(_dot_)com> ]
  Handling of CC?                       [ Chin Fang 
<fangchin(_at_)jessica(_dot_)Stanfor ]
  sendmail                              [ "van 't Hoff" 
<erikh(_at_)rdc(_dot_)nl> ]
  Re: Handling of CC?                   [ "Alan K. Stebbens" 
<aks(_at_)anywhere(_dot_)en ]

------------------------------

Date: Fri, 06 Dec 1996 19:55:31 -0800 (PST)
From: tpdweb(_at_)cadence(_dot_)com (Technical practice development web page 
owner)
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: auto-reply to: procmail-d Digest V96 #172
Message-id: 
<9612070355(_dot_)AA17505(_at_)demo_svr(_dot_)Cadence(_dot_)COM(_dot_)Cadence(_dot_)COM>
Content-transfer-encoding: 7BIT

Your message regarding 'procmail-d Digest V96 #172' 
has been automatically archived in the tpdweb home pages.

To review the tpdweb automatic-email archives, please point your browser to:
http://demo_svr/archives/

Below you will see how your "To:" line was analyzed to determine
which archives your message was placed in.


Checking your To: line for aliases to archive.


Checking your Cc: line for aliases to archive.


Final list of archives for your message: 

Thank you for your message to '',

-- Cadence tpdweb automated archiver

------------------------------

Date: Fri, 6 Dec 96 19:55:39 PST
From: tpdweb(_at_)cadence(_dot_)com (Technical practice development web page 
owner)
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: auto-reply to: procmail-d Digest V96 #174
Message-Id: 
<9612070355(_dot_)AA17519(_at_)demo_svr(_dot_)Cadence(_dot_)COM(_dot_)Cadence(_dot_)COM>

Your message regarding 'procmail-d Digest V96 #174' 
has been automatically archived in the tpdweb home pages.

To review the tpdweb automatic-email archives, please point your browser to:
http://demo_svr/archives/

Below you will see how your "To:" line was analyzed to determine
which archives your message was placed in.


Checking your To: line for aliases to archive.


Checking your Cc: line for aliases to archive.


Final list of archives for your message: 

Thank you for your message to '',

-- Cadence tpdweb automated archiver

------------------------------

Date: Sat,  7 Dec 96 09:59:03 -0500
From: Timothy J Luoma <luomat(_at_)nerc(_dot_)com>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: subject-based killfile
Message-Id: <199612071459(_dot_)JAA14959(_at_)nerc(_dot_)com>
Content-Type: text/plain

I would like to setup a _sorting_ (not bouncing) recipe for certain  
Subjects.

Well, actually, it would be based on _parts_ of subjects.  I would  
like to be able to do this based on keywords found in the subject,  
such as:

subscribe
unsubscribe
virus
try this
credit card
money
1-900
cmsg cancel
!!!
***
+++

I don't want to bounce these, just put them in a folder so I can  
make sure they are messages to delete.

I was going to setup a file to do this, but since I'm not matching  
full subjects, but only parts, I wondered if I had to do this within  
.procmailrc with something like this:

:0:
* ^Subject:.(*ubscribe|\
                *virus|\
                *try this|\
                *cmsg cancel|\
                *credit cards|\
                *money|\
                *1-900)
Trash


of course this could get very long, which is why I wanted to do it  
in a file, but can I do that without having to match the entire  
subject??

Thanks again

TjL

--
                Tj Luoma (luomat(_at_)peak(_dot_)org)
                http://www.next.peak.org/~luomat

------------------------------

Date: Sat, 7 Dec 1996 08:24:35 -0800 (PST)
From: bodysurf(_at_)netcom(_dot_)com (Tim)
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: subject-based killfile
Message-Id: <199612071624(_dot_)IAA16404(_at_)netcom6(_dot_)netcom(_dot_)com>
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

I would like to setup a _sorting_ (not bouncing) recipe for certain  
Subjects.

Well, actually, it would be based on _parts_ of subjects.  I would  
like to be able to do this based on keywords found in the subject,  
such as:

subscribe
unsubscribe
virus
try this
credit card
money
1-900
cmsg cancel
!!!
***
+++

I don't want to bounce these, just put them in a folder so I can  
make sure they are messages to delete.

I was going to setup a file to do this, but since I'm not matching  
full subjects, but only parts, I wondered if I had to do this within  
.procmailrc with something like this:

:0:
* ^Subject:.(*ubscribe|\
              *virus|\
              *try this|\
              *cmsg cancel|\
              *credit cards|\
              *money|\
              *1-900)
Trash


of course this could get very long, which is why I wanted to do it  
in a file, but can I do that without having to match the entire  
subject??

Sure.  Something like this should work:

        #Pull "Subject:" out of incoming email.  Make sure you have
        #already defined FORMAIL.
        SUBJ=`$FORMAIL -zx 'Subject: '`
        #Define the path for the list of subjects below.
        SUBJLIST=

        :0
        * ? echo "$SUBJ" | egrep -i -f $SUBJLIST
        Trash

Keep in mind when you are trying to match parts of "Subjects:" the 
difference between REGEXPs and literal strings and you should be set.  
One more thing, make sure the version of GREP/EGREP you use will support 
the length of file you will make your "list of subjects".  Some (older) 
GREPs crap out if the file gets longer than a few lines.  I've found GNU 
GREP v2.0 works well.

Thanks again

TjL

--
                Tj Luoma (luomat(_at_)peak(_dot_)org)
                http://www.next.peak.org/~luomat

Lates!
------------------------------------
Tim <bodysurf(_at_)netcom(_dot_)com>
"Finger" for PGP v2.6.3ia Public Key

------------------------------

Date: Sat, 7 Dec 1996 12:16:04 -0500 (EST)
From: Wotan <wotan(_at_)netcom(_dot_)com>
To: procmail mailing list <procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE>
Subject: Re: auto-reply to: procmail-d Digest V96 #167
Message-ID: 
<Pine(_dot_)SUN(_dot_)3(_dot_)95(_dot_)961207121407(_dot_)20409A-100000(_at_)netcom14>
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Fri, 6 Dec 1996, Technical practice development web page owner wrote:

Oh joy, off to filter the crap from the list about mail filtering. :(

Wouldn't it be more efficent to filter this out before being sent to the
list though?

--
Q:  Where does virgin wool come from?
A:  Ugly sheep.

------------------------------

Date: Sat, 7 Dec 1996 18:50:05 -0500 (EST)
From: Stan Ryckman <stanr(_at_)sunspot(_dot_)tiac(_dot_)net>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE (procmail)
Subject: Counting messages in a mailbox
Message-Id: <199612072350(_dot_)SAA17775(_at_)sunspot(_dot_)tiac(_dot_)net>
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi.

I'd like to be able to count the number of messages in a mailbox.
The simple-minded approaches, such as:
        egrep -i '^From ' mailbox | wc -l
        egrep -i '^Subject:' mailbox | wc -l
don't work for fairly obvious reasons.

This seems to work:
        formail -s formail -X 'From ' < mailbox | wc -l
but due to the number of processes, it's *very* slow.

Is there a better way?

Thanks,
Stan Ryckman (stanr(_at_)tiac(_dot_)net)

------------------------------

Date: Sat, 7 Dec 1996 16:16:15 -0800 (PST)
From: MAILBOX <dnhunt(_at_)rain(_dot_)org>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: [Q]: Interpretation of my .forward file?
Message-ID: 
<Pine(_dot_)SUN(_dot_)3(_dot_)95(_dot_)961207160321(_dot_)21646C-100000(_at_)coyote(_dot_)rain(_dot_)org>
Content-Type: TEXT/PLAIN; charset=US-ASCII

I have procmail running now after some struggle. I could't get .forward to
work with the suggested lines so I stole and edited the line from another
user on my system. This works, but what does it mean? I'm not sure if it
is appropriate to my usage. I'm unclear about -f- and -d, exit 75, and why
my username is called twice. Actually, I don't understand any of it!

|IFS=' '&&exec /usr/local/bin/procmail -f- -d dnhunt||exit 75 #dnhunt

David <dnhunt(_at_)rain(_dot_)org>, using procmail v3.11pre3

------------------------------

Date: Sun,  8 Dec 96 00:41:33 -0500
From: Timothy J Luoma <luomat(_at_)peak(_dot_)org>
To: Stan Ryckman <stanr(_at_)sunspot(_dot_)tiac(_dot_)net>
cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE (procmail)
Subject: Re: Counting messages in a mailbox
Message-Id: <199612080541(_dot_)VAA08865(_at_)PEAK(_dot_)ORG>
Content-Type: text/plain

Responding To:  Stan Ryckman <stanr(_at_)sunspot(_dot_)tiac(_dot_)net>
Original Date:  Sat, 7 Dec 1996 18:50:05 -0500 (EST)
Message-ID:     <199612072350(_dot_)SAA17775(_at_)sunspot(_dot_)tiac(_dot_)net>

egrep -i '^From ' mailbox | wc -l

why doesn't this work?  There can be only one "^From " line per  
message right?  And there has to be one for each message, doesn't  
there?

I use this myself for some non-critical things, so I am curious why  
this would fail

TjL

--
                Tj Luoma (luomat(_at_)peak(_dot_)org)
                http://www.next.peak.org/~luomat

------------------------------

Date: Sun, 08 Dec 1996 00:44:18 -0800
From: "Alan K. Stebbens" <aks(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>
To: Stan Ryckman <stanr(_at_)sunspot(_dot_)tiac(_dot_)net>
Cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE (procmail)
Subject: Re: Counting messages in a mailbox 
Message-Id: 
<199612080844(_dot_)AAA05053(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>


I'd like to be able to count the number of messages in a mailbox.
The simple-minded approaches, such as:
      egrep -i '^From ' mailbox | wc -l
      egrep -i '^Subject:' mailbox | wc -l
don't work for fairly obvious reasons.

You can speed this up a little:

    grep -c '^From ' mailbox

The only false matches will be for sentences which start with 'From '.

You could also try awk:

  awk '/^From / {if (!header) { header=1; msgs++ }}
       /^ *$/   {header=0}
       END      {print msgs,"\n"}' mailbox

or Perl:

  perl -ne 'if (/^From /&&\!$header) { $header=1; $msgs++; }
            elsif (/^\s*$/) { $header=0; }
            if (eof) { print "$msgs\n"; }' mailbox

Perl seemed to be faster than awk; the "grep" was fastest, but is not
always accurate.

This seems to work:
      formail -s formail -X 'From ' < mailbox | wc -l
but due to the number of processes, it's *very* slow.

You've got one too many formail's:

    formail -s echo x < mailbox | wc -l
or:
    formail -s echo -c x < mailbox | wc -c

There's no need to extract anything out of the message, just being able
to run any program once on behalf of each message is sufficient.

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

------------------------------

Date: Sat, 07 Dec 1996 23:23:57 -0800
From: "Alan K. Stebbens" <aks(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>
To: dattier(_at_)wwa(_dot_)com (David W. Tamkin)
Cc: fishbowl(_at_)fotd(_dot_)netcomi(_dot_)com,
        procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE (Procmail Mailing 
List)
Subject: Re: multiple simultaneous extractions 
Message-Id: 
<199612080723(_dot_)XAA04583(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>

James McGill wrote,

| That brings up what I feel is the one thing that I'd like to see in a 
future 
| version of procmail.  The ability to delimit multiple MATCH's in the manner
| of /(.*)(.*)/$1$2/ syntax.  As it happens, it is Match to End, which is 
| useful, but not as flexible as it could be.  (You can only match one thing,
| and only to the end of the regexp.)

One can extract the entirety and then extract pieces from there; it's not
as convenient as what James proposes, but with sufficient circumlocution it
can be done.

That's the point, David: I shouldn't have to "circumlocute" procmail, I
want to use it to increase *my* email productivity and efficiency.
Computers should do more work, not humans.

There is usually a correlation between generality and complexity:
increase the generality of an algorithm, and its complexity usually
increases by some measure also, and, as complexity increases, the
computer performance and efficiency decreases.

So what if the computer has to work a little harder because its regular
expression engine is a tad more general and a bit less efficient?  With
that little bit of increased generality, I can more easily write
regular expressions to parse strings *within* procmail, which avoids my
having to invoke grep, sed, or awk at various times.

I'm not saying that procmail needs all of Perl's bloat -- if I thought
that, I'd write a Perl module which fulfills procmail's and formail's
functions of address header munging and such, and write my mail filters
in Perl.  I like procmail's efficiency and lightness--I just think that
a more powerful regexp parser would go a long, long way to making
procmail recipes even more versatile at minimal cost.
___________________________________________________________
Alan Stebbens <aks(_at_)sgi(_dot_)com>      http://reality.sgi.com/aks

------------------------------

Date: Sun, 08 Dec 1996 01:05:45 -0500 (EST)
From: Stan Ryckman <stanr(_at_)sunspot(_dot_)tiac(_dot_)net>
To: luomat(_at_)peak(_dot_)org (Timothy J Luoma)
Cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: Counting messages in a mailbox
Message-id: <199612080605(_dot_)BAA08959(_at_)sunspot(_dot_)tiac(_dot_)net>
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7bit

Timothy J. Luoma wrote:

Responding To:        Stan Ryckman <stanr(_at_)sunspot(_dot_)tiac(_dot_)net>
Original Date:        Sat, 7 Dec 1996 18:50:05 -0500 (EST)
Message-ID:   <199612072350(_dot_)SAA17775(_at_)sunspot(_dot_)tiac(_dot_)net>

egrep -i '^From ' mailbox | wc -l

why doesn't this work?  There can be only one "^From " line per  
message right?  And there has to be one for each message, doesn't  
there?

From sea to shining sea.

Did your MDA stick a character before the "From " there?  I like it
when they do, but they don't *have* to.  Assuming it didn't, then the
egrep will count this as two messages, but formail will get it right.

I use this myself for some non-critical things, so I am curious why  
this would fail

If non-critical, or if you just want an estimate, it's probably
good enough in most cases.

Another, harder, example, is when a full message is included with
all headers (including "From ") and this can only be determined by
paying attention to "Content-Length:" in the enclosing message.
Again, formail will get it right, but egrep will count too many.

Cheers,
Stan Ryckman (stanr(_at_)tiac(_dot_)net)

------------------------------

Date: Sun, 08 Dec 1996 18:55:35 -0800
From: "Alan K. Stebbens" <aks(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>
To: Timothy J Luoma <luomat(_at_)nerc(_dot_)com>
Cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: subject-based killfile 
Message-Id: 
<199612090255(_dot_)SAA06905(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>

    > I would like to setup a _sorting_ (not bouncing) recipe for certain  
    > Subjects.
    > 
    > Well, actually, it would be based on _parts_ of subjects.  I would  
    > like to be able to do this based on keywords found in the subject,  
    > such as:
    > 
    > subscribe
    > unsubscribe
    > virus
    > try this
    > credit card
    > money
    > 1-900
    > cmsg cancel
    > !!!
    > ***
    > +++
    > 
    > I don't want to bounce these, just put them in a folder so I can  
    > make sure they are messages to delete.
    > 
    > I was going to setup a file to do this, but since I'm not matching  
    > full subjects, but only parts, I wondered if I had to do this within  
    > .procmailrc with something like this:
    > 
    > :0:
    > * ^Subject:.(*ubscribe|\
    >           *virus|\
    >           *try this|\
    >           *cmsg cancel|\
    >           *credit cards|\
    >           *money|\
    >           *1-900)
    > Trash

You can do this, but you are using the '*' incorrectly.  I would write
the recipe like this:

    :0:
    * ^Subject:.*(subscribe|\
                  virus|\
                  try this|\
                  cmsg cancel|\
                  credit cards|\
                  money|\
                  1-900)
    Trash

Recall that '*' doesn't match anything itself, it just repeats the previous
pattern zero or more times.

Please read the procmailrc man page (3.11pre4), especially the section
titled: "Extended regular expressions".


If you are worried about the total length of the line, just make LINEBUF larger
before you build a large regexp line:

    LINEBUF=2048                # make a larger buffer for lines

    > of course this could get very long, which is why I wanted to do it  
    > in a file, but can I do that without having to match the entire  
    > subject??

If you would like to use a lookup file, here's how I might do it: (I
like using files for keyword lookups, because when you add or change
keywords, you end editing the data for the search, not the search
recipe itself, so mistakes--which affect only the lookup, and not your
entire recipe file--are not as costly).

First, before preparing a keyword file, you must decide on whether or
not this file is a list of search *strings* or search *patterns*
(regexps).  The former are easier, while the latter are more flexible
and general.  I'll assume that you'll just be using search strings.

Now prepare a keyword string file; I'll call it "trash-subjects".  

    % cat <<-EOF >trash-subjects
        subscribe
        virus
        try this
        cmsg cancel
        credit cards
        money
        1-900
    EOF

Here's the recipe which can use it:

    # If the subject of the current mail matches "trash-subjects",
    # then file the mail into "Trash".
    :0:
    * ? formail -zxSubject: | fgrep -s -f trash-subjects 
    Trash

You should be aware that this filter is not very discriminating.  If
your best friend sends you an email with a subject on a reall cool new
1-900 phone number, it will get trashed right along with that of a
stranger.

To make the filter a little more careful is easy, if you know how to
decide what's "trash" mail and what is not.  One way is to say "any mail
from a friend is ok".  So, now you need a file in which you keep the names
and/or addresses of your friends; this file should be kept as regular
expressions to make it flexible in handling addresses from a variety
of addresses within a domain, and to be flexible with the name matching.

Here's how I might do it:

    % cat <<-EOF >friend-regexps
        (Alan (K\. )?Stebbens|aks(_at_)(_dot_)*sgi\(_dot_)com)
        (Timothy.*Luoma|luomat(_at_)nerc\(_dot_)com)
        (David (W\.)?Tamkin|dattier(_at_)(_dot_)*wwa\(_dot_)com)
        (Soren Dayton|csdayton(_at_)cs\(_dot_)uchicago\(_dot_)edu)
    EOF

Then, the recipe to use both "friend-regexps" and "trash-subjects"

    # If the mail is NOT from a friend
    # and has a trashy subject, then file it into "Trash".
    :0:
    * !? formail -rtzxTo:   | egrep -s -f friend-regexps
    * ? formail -zxSubject: | fgrep -s -f trash-subjects
    Trash

Of course, you must keep your files up-to-date, but this is easy to do
with separate files, and if you make a mistake in them, you won't be
causing procmail to get confused on a broken recipe.

One mistake you don't want to make in the "trash-subjects" file is to 
place such a common word or phrase that "good" mail gets trashed.

One more addition might be useful: a file of addresses of known spammers; I'll
call it "spammers" and it is simply a file of "bad" addresses.

Here is a recipe to use it, and you can place this either before or after the
other recipe. 

    # If the mail is from a spammer, then trash it
    :0:
    * ? formail -rtzxTo: | fgrep -s -f spammers
    Trash

If you care to optimize these recipes, there are ways you can eliminate
the "formail" calls, using procmail recipes to extract those fields,
and feed the equivalent strings to "egrep" or "fgrep" using an "echo".
This exercise is left to the reader.

G'luck.

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

------------------------------

Date: Sun,  8 Dec 96 22:46:50 -0500
From: Timothy J Luoma <luomat(_at_)nerc(_dot_)com>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: a ^FROM like ^TO
Message-Id: <199612090346(_dot_)WAA11639(_at_)nerc(_dot_)com>
Content-Type: text/plain

This has probably been mentioned before, but is there (or could  
there be) a macro "^FROM" which would work like the macro "^TO"  
does?

TjL
--
                Tj Luoma (luomat(_at_)peak(_dot_)org)
                http://www.next.peak.org/~luomat

------------------------------

Date: Sun, 8 Dec 1996 23:34:59 -0800 (PST)
From: Chin Fang <fangchin(_at_)jessica(_dot_)Stanford(_dot_)EDU>
To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Handling of CC?
Message-Id: <199612090735(_dot_)XAA21107(_at_)jessica(_dot_)Stanford(_dot_)EDU>
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

I have been trying to come up a simple rc which handles CC (or Cc:)
without much success.

The egrep parser in procmail does just one pass, and if there is a Cc:
line in the header of the incoming message, the recipients listed on
that line won't get anything, as most likely the To: line is above the
Cc: line so it gets matched first.

For instance, if an incoming message has the following 

Date:  Wed, 4 Dec 1996 22:23:28 -0800 (PST)
To: fangchin(_at_)jessica(_dot_)stanford(_dot_)edu
cc: 
mwang(_at_)rescomp(_dot_)stanford(_dot_)edu,doh(_at_)cyclone(_dot_)stanford(_dot_)edu

and if the rc file has 

:0
* TOfangchin
! chin(_at_)ruca(_dot_)ua(_dot_)ac(_dot_)be

then only I will be getting the message, the two poor guys Mark and
Doh won't have anything :(

I can come up a ugly Perl script to do the extra Cc line processing
(basically looping thru all listed recipients in that line, and pump
the body of the incoming message to each listed person), but am
wondering whether I can use procmail's built-in commands to achieve
the Cc: line processing as well?

Thanks,

Chin Fang
fangchin(_at_)jessica(_dot_)stanford(_dot_)edu

------------------------------

Date: Mon, 9 Dec 1996 08:55:18 +0100
From: "van 't Hoff" <erikh(_at_)rdc(_dot_)nl>
To: <procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE>
Subject: sendmail
Message-Id: <199612090758(_dot_)IAA45984(_at_)bumper(_dot_)rdc(_dot_)nl>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

hello,

i will install procmail in sendmail with the -m option, but what must i
put in sendmail, this is what is in the manual


              Mprocmail,   P=/u/users/bin/procmail,   F=mSDFMhun,
              S=11, R=21,
                      A=procmail -m $h $f $u

       This enables you to use rules  like  the  following  (most
       likely  in  ruleset 0) to filter mail through the procmail
       mailer (please note the leading tab to continue the  rule,
       and the tab to separate the comments):

              R$*<@some.where>$*
                      $#procmail                   $@/etc/some.rc
              $:$1(_at_)some(_dot_)where(_dot_)procmail$2 R$*<@$*.procmail>$*
                      $1<@$2>$3       Already filtered, map back

but what do i'll have to write on some.where and what on
some.where.procmail
and what on procmail?

and can anybody send me an example of your own sendmail configuration with
the
-m flag

thanx,

erik <erikh(_at_)rdc(_dot_)nl>

 

------------------------------

Date: Mon, 09 Dec 1996 01:30:43 -0800
From: "Alan K. Stebbens" <aks(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>
To: Chin Fang <fangchin(_at_)jessica(_dot_)Stanford(_dot_)EDU>
Cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
Subject: Re: Handling of CC? 
Message-Id: 
<199612090930(_dot_)BAA08759(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>

  > I have been trying to come up a simple rc which handles CC (or Cc:)
  > without much success.
  > 
  > The egrep parser in procmail does just one pass, and if there is a Cc:
  > line in the header of the incoming message, the recipients listed on
  > that line won't get anything, as most likely the To: line is above the
  > Cc: line so it gets matched first.
  > 
  > For instance, if an incoming message has the following 
  > 
  > Date:  Wed, 4 Dec 1996 22:23:28 -0800 (PST)
  > To: fangchin(_at_)jessica(_dot_)stanford(_dot_)edu
  > cc: 
mwang(_at_)rescomp(_dot_)stanford(_dot_)edu,doh(_at_)cyclone(_dot_)stanford(_dot_)edu
  > 
  > and if the rc file has 
  > 
  > :0
  > * TOfangchin
  > ! chin(_at_)ruca(_dot_)ua(_dot_)ac(_dot_)be
  > 
  > then only I will be getting the message, the two poor guys Mark and
  > Doh won't have anything :(
  >
  > I can come up a ugly Perl script to do the extra Cc line processing
  > (basically looping thru all listed recipients in that line, and pump
  > the body of the incoming message to each listed person), but am
  > wondering whether I can use procmail's built-in commands to achieve
  > the Cc: line processing as well?

First, if you want to match a Cc: header by itself, just do so:

  :0
  * ^Cc: whomever(_at_)wherever
  <someaction>

Second, if you wish to match for multiple recipients, place multiple
recipes:

  :0c
  * ^TOfanchin
  ! chin(_at_)ruca(_dot_)ua(_dot_)ac(_dot_)be
  :0c
  * ^TOmwang
  ! mwang(_at_)wherever
  :0c
  * ^TOdoh
  ! doh(_at_)wherever

Third, I like to know what's happened to my mail, so whenever one
of my recipes does something "on the side" to my mail, I mark it.

So, here is a recipe which accumulates fowarding addresses, 
forwards a copy to these addresses, and then marks the mail (for me)
with a header indicating who received a copy.

  FWDS
  :0c
  * ^TOfanchin
  { FWDS="$FWDS chin(_at_)ruca(_dot_)ua(_dot_)ac(_dot_)be" }
  :0c
  * ^TOmwang
  { FWDS="$FWDS mwang(_at_)wherever" }
  :0c
  * ^TOdoh
  { FWDS="$FWDS doh(_at_)wherever" }
  :0
  * FWDS ?? .
  {  :0c        # forward a copy of the mail
     ! $FWDS
     :0fh       # and tell me about it
     | formail -I"Forwarded: $FWDS"
  }

Fourth: why are you forwarding mail which has already been addressed,
and independently distributed to other addresses?  If their addresses
are working, they'll receive the original mail at their "stanford.edu"
address, and another at wherever you send it.  If these people are
reading their email from another address, then *they* should be
arranging the forwarding, not you.  Most people, even friends, do
not appreciate someone doubling the time spent reading mail
messages.

G'luck.

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

--------------------------------
End of procmail-d Digest V96 Issue #177
***************************************

<Prev in Thread] Current Thread [Next in Thread>
  • Re: procmail-d Digest V96 #177, McBride <=