mhonarc-dev

Re: Procmail problem?

2002-11-20 23:09:29
(This is dev stuff, so I'm cc'ing mhonarc dev since it is the
 forum for discussing mharc development also.)

On November 20, 2002 at 21:38, "Christopher P. Lindsey" wrote:

I'm not sure I understand the question, but I'll try to answer.
There is one procmailrc for all list archives.  It's role is to
filter incoming mail and file it into the various raw mailbox archives.
Hence, the recipe above is replicated in the procmailrc for each
list defined in the lists.def file (lists.def is a control file
that tells mharc what lists are to be archived):

I guess I'm not sure how the messages get into the procmailrc file.  
If one copy of the message is sent per list that is being archived,
then you don't need to create a carbon copy of the mail message.  In
fact, you could even simplify things to 

   :0
   * 
^TO_\/(mharc-users(_at_)mhonarc(_dot_)org|mhonarc-dev(_at_)mhonarc(_dot_)org|mhonarc-users(_at_)mho
narc.org)
   {
      ADDRESS=$MATCH
      :0
      * ADDRESS ?? ^()\/[^(_at_)]+
      { LISTNAME = $MATCH }
      HAVEMATCH=`echo yes`

      :0 Wi
      MKDIR=`mkdir -m 755 -p $MBOXROOT/$LISTNAME`
    
      :0 Wih
      MESGDATE_=| /mnt/WWW/customers/mhonarc.org/htdocs/archive/bin/extract-m
esg-date -fmt '%Y-%m'
    
      :0:
      $MBOXROOT/$LISTNAME/$MESGDATE_
   }

This will not work.  First, a cross-posted message may contain multiple
lists addresses in the message header, so if the one rule above was
used, all versions of the message would goto the mharc-users archive.

Incoming mail is processed from a single mailbox that can contain a
variety of messages to multiple lists.  Something like the following
is used to process the mailbox:

  formail -s procmail procmailrc.mharc <.newmail

.newmail is the messages in the spool directory that have been
copied over.

Now, for a cross-post, I will get the same message more than once.
However, how do I know which list archive has already got a copy if I
use something like you provided?  BTW, I use the formail message-id
caching trick as the first rule in the procmailrc to drop any dups.
Hence, I will only get the chance to filter a message properly once.

Another thing to note is that LISTNAME is not dependent on the
mail address, but is logical label defined in lists.def.  This is
done since there is no guarantee that a list address will not change
(like the mhonarc user's list has done).  Plus, an archive can be
used to archive multiple lists.  I do this with my private archives.
I have have generic archives like "newsletters" and "security" where
multiple lists are being fed into them.

I know I'm being a pain here...  And let me know when to shut up.  :)

Keep blabbing.  I definitely want criticism about the procmail and
filtering stuff.  The procmail manpages do not always contain the
exact information I need, so what you see is due to trial-n-error.

One other question...  How come you do

   HAVEMATCH=`echo yes`

instead of

   HAVEMATCH=yes

to save the system call?

I'm not sure.  I may have thought you could not do it or it did not
work when I tried it.  I'll have to try it again.

Feel free to forward this to the list if you
want, but I wasn't sure how far off-topic I'd veered.  :)

CC'ed the mhonarc-dev list (so excuse the dups).

I appreciate your feedback,

--ewh

---------------------------------------------------------------------
To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the
message text UNSUBSCRIBE MHONARC-DEV

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