procmail
[Top] [All Lists]

Re: time-tested recipe fails! (NO film at 11)

1997-07-13 13:12:00
wwgrol(_at_)sparc01(_dot_)fw(_dot_)hac(_dot_)com (W. Wesley Groleau x4923) 
writes:

     # Copies sent directly to you aren't refiled
     :0
     * ^Resent-From: *procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
     | formail -A"X-List: procmail" >> procmail
or:
     # Copies sent directly to you and the list are both refiled
     :0
     * (^Resent-From: 
*|^TO)procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
     | formail -A"X-List: procmail" >> procmail

Got it?

I understand the difference in regexp but I don't get how or why the
listserver would send a message to me only.

Consider the following three possibilities:


        To: wwgrol(_at_)fw(_dot_)hac(_dot_)com
  Someone ----> wwgrol(_at_)fw(_dot_)hac(_dot_)com


        To: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE         (or Cc: 
or Bcc:)
  Someone ----> procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE ----> 
wwgrol(_at_)fw(_dot_)hac(_dot_)com


        To: wwgrol(_at_)fw(_dot_)hac(_dot_)com
        Cc: procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE         (or To:)
  Someone ----> wwgrol(_at_)fw(_dot_)hac(_dot_)com
          ----> procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE ----> 
wwgrol(_at_)fw(_dot_)hac(_dot_)com


The first would be if someone sends a message to you (perhaps by
replying to a message of yours) but doesn't send it to the list as
well.  You'll get one copy, without procmail anywhere in the headers,
which is correct because the list isn't involved at all.

The second case is of someone sending a message to the list, but not
you.  Depending on whether they used a visible destination header (To:
or Cc:) or a Bcc:, the list address may or may not appear in one of
those headers.  *However*, the list itself will always add the
Resent-From: header with the list address in it, so by matching on that
you can guarantee that this message will end up in your procmail
folder.

The third case is that of a message being sent to both you and the
list.  This usually happens when someone replies to a message you sent
to the list.  You'll get one copy directly from the other person and
one copy from the list.  The latter of those will have the Resent-From:
header and can be refiled on that criteria.  The former (the direct
one) won't.  If you want it to end up in your procmail folder you'll
need to match on the destination headers using ^TO or ^TO_ and hope
they didn't Bcc:  the list.  On the otherhand, you may want messages
like this to end up in your normal mailbox instead of being refiled
into your procmail folder.  I'm of that persausion, as it allows me
to see replies to my message sooner, while I can still remember what
I said.  Where those messages get put is the differance between the
two recipes shown above.

In case that still isn't clear, you're going to get two copies of this
message: one via the list and one directly from me.  The list one
'obviously' should go to your procmail folder.  Where should the direct
(and probably earlier) copy go?


Philip Guenther

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