mhonarc-users

Re: how to get archives organized by month

2003-08-05 01:38:51
On August 4, 2003 at 20:33, "Christopher P. Lindsey" wrote:

   Note that this is based on the date that the file is received at your
   system.  You could use procmail to extract the date from your envelope
   from 'header' instead, pipe the message through a quick perl script
   to extract the date (at a performance hit, ick), etc.

The performance hit is not that bad.  Mharc does this since it is
more reliable to extract the date from the message itself.  This protects
you from system delays or failures that could cause a message to
be processed at a much later time than when it was actually received.

Plus, mharc processes mail via cron vs as-messages-are-delivered,
since the later does not scale well.

Mharc was a special utility script called extract-mesg-date to
do this.  It is designed to work within procmail recipies since it
returns the date to stdout so procmail can capture it and use it
in a pathname.  For example:

  :0
  * (^TO_mharc-users(_at_)mhonarc\(_dot_)org ...
  {
    HAVEMATCH=yes

    :0
    { CMDEXC_=`mkdir -m 755 -p $MBOXROOT/mharc-users` }

    :0 Wih
    * MESGDATE ?? ^^^^
    MESGDATE=| extract-mesg-date -fmt '%Y-%m'

    :0 c:
    $MBOXROOT/mharc-users/$MESGDATE
  }

--ewh

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

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