mhonarc-dev

Requeueing messages processed by mharc?

2003-01-04 11:58:47
Hi guys,

I was thinking about lost messages with the current mharc setup.  As it
stands now, messages are delivered into a mailbox as part of the final
step.

Right now, a block might look like this:

   ## mhonarc-users
   :0
   * 
(^TO_(mhonarc-users(_at_)mhonarc(_dot_)org|mhonarc(_at_)ncsa(_dot_)uiuc(_dot_)edu|mhonarc(_at_)rosat(_dot_)mpe-garching(_dot_)mpg(_dot_)de)|(^(Delivered-To:|List-Post:).*(mhonarc-users(_at_)mhonarc(_dot_)org|mhonarc(_at_)ncsa(_dot_)uiuc(_dot_)edu|mhonarc(_at_)rosat(_dot_)mpe-garching(_dot_)mpg(_dot_)de)))
   {
     :0 Wi
     HAVEMATCH=|echo yes

     :0 Wi
     CMDEXC_=| mkdir -m 755 -p $MBOXROOT/mhonarc-users

     :0 Wi
     MESGDATE_=| 
/mnt/WWW/customers/mhonarc.org/htdocs/archive/bin/extract-mesg-date -fmt '%Y-%m'

     :0 c:
     $MBOXROOT/mhonarc-users/$MESGDATE_
   }

It could look like this:

   ## mhonarc-users
   :0
   * 
(^TO_(mhonarc-users(_at_)mhonarc(_dot_)org|mhonarc(_at_)ncsa(_dot_)uiuc(_dot_)edu|mhonarc(_at_)rosat(_dot_)mpe-garching(_dot_)mpg(_dot_)de)|(^(Delivered-To:|List-Post:).*(mhonarc-users(_at_)mhonarc(_dot_)org|mhonarc(_at_)ncsa(_dot_)uiuc(_dot_)edu|mhonarc(_at_)rosat(_dot_)mpe-garching(_dot_)mpg(_dot_)de)))
   {
     # CHANGE: define variable instead of system call
     HAVEMATCH=yes

     # CHANGE: tests if directory exists; saves a system call
     :0 Wic
     * ? test ! -d $MBOXROOT/mhonarc-users
     `mkdir -m 755 -p $MBOXROOT/mhonarc-users`

     # CHANGE: skip if MESGDATE_ already set; saves a fork
     # CHANGE: only send headers to extract-mesg-date; cuts down on memory
     :0 Wih
     * MESGDATE_ ?? ^^^^
     MESGDATE_=| 
/mnt/WWW/customers/mhonarc.org/htdocs/archive/bin/extract-mesg-date -fmt '%Y-%m'

     :0c:
     $MBOXROOT/mhonarc-users/$MESGDATE_

     # ADDED: requeues message if delivery failed
     :0E
     {
        :0
        * ^From \/[^ ]+[ ]+
        | $SENDMAIL -ODeliveryMode=queueonly -OErrorMode=m -oi -f $MATCH 
$LOGNAME

        :0
        | $SENDMAIL -ODeliveryMode=queueonly -OErrorMode=m -oi -f '<>' $LOGNAME
   }

(Yes, I changed some of the other stuff around for optimization :)  But 
the issue that I'm most interested in is the last block which places the
message back into the message queue if delivery failed.  

I know that this works with sendmail; is this syntax portable to other MTAs
like exim/postfix/qmail?

Chris

---------------------------------------------------------------------
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>