From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/3979 Path: main.gmane.org!not-for-mail From: Sudish Joseph Newsgroups: gmane.emacs.gnus.general Subject: External delivery: methods. Date: Wed, 15 Nov 1995 03:18:08 -0500 Message-ID: <199511150818.DAA05459@honsu.cis.ohio-state.edu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1035144791 28151 80.91.224.250 (20 Oct 2002 20:13:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:13:11 +0000 (UTC) Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by miranova.com (8.6.11/8.6.9) with ESMTP id BAA20774 for ; Wed, 15 Nov 1995 01:32:54 -0800 Original-Received: from news.cis.ohio-state.edu (news.cis.ohio-state.edu [164.107.8.50]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Wed, 15 Nov 1995 09:18:12 +0100 Original-Received: from honsu.cis.ohio-state.edu (honsu.cis.ohio-state.edu [164.107.138.13]) by news.cis.ohio-state.edu (8.6.8.1/8.6.4) with ESMTP id DAA18766 for ; Wed, 15 Nov 1995 03:18:10 -0500 Original-Received: (joseph@localhost) by honsu.cis.ohio-state.edu (8.6.7/8.6.4) id DAA05459; Wed, 15 Nov 1995 03:18:08 -0500 Original-To: The Ding List Xref: main.gmane.org gmane.emacs.gnus.general:3979 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:3979 Joe Hildebrand's add-active-nov script was(is?) the most common way of implementing external delivery from procmail. Essentially, it's a perl script to be run out of your filter, after the filter has delivered the article. Needs one argument, the full path name of the delivered article. The problem with this is load on your mail hub, since you're running a perl script in addition to one procmail invocation for every message you receive. It's also a tad slow. You can work around any speed/excess processes problems by doing the NOV/active update from procmail itself. I've attached a small procmail recipe file as an example of how you might do this. It's not finished, just an example I used for testing. Some of the stuff in the Notes hasn't been added yet, but they're trivial additions. Heck, the whole thing is trivial. If you're using mailagent as your filter, you can use mailagent's (well-defined and well-docmented) interface to adding new commands to create a command that also updates the nov/active files in addition to saving it. This avoids the load problem, since only one invocation of mailagent is active at any given time. Finally, Joe has a Tcl biffing script if you use the recommended .spool method for delivery. I've got a perl5/Tk script for external delivery biffing. And that's the whole story so far, -Sudish # nov.rc -*- text -*- # # procmail rc file to generate NOV entries and to update active files # meant to be used for asynchronous delivery to GNUS nnml folders # # $Id: nov.rc,v 1.1.1.1 1995/11/12 01:48:00 joseph Exp $ # # Copyright (C) 1995 Sudish Joseph # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # # Usage: # # :0 # * ^TOsome-list@some.where # { NNDIR=mail/some/list NNGROUP=mail.some.list } # # :0 # * NNDIR ?? . # { INCLUDERC=nov.rc } # # # Notes: # # * The NNDIR values are relative to MAILDIR. MAILDIR isn't changed # by this recipe. # # * The actual delivery to the nnml directory is done within this # recipe, but only if NNDIR is set. If NNDIR isn't set, including # this recipe is a no-op. # # * The setting of NNGROUP is optional. It's value is used to update # the active file. If it's not set, no active file update will be # done. # # * Though it seems redundant to have these two variables, it saves us # a call to tr later. It also lets us turn off active file update # selectively. # # for debugging #VERBOSE=ON # Play it safe and check to see if we should be in here at all. # It would be better if this were done in $HOME/.procmailrc, as shown above. :0 * NNDIR ?? . { # Get the header fields we require. # Normalize all fields to have no leading/trailing whitespace, # reduce all contiguous whitespace to a single space. # Supply sensible defaults where appropriate # Subject: :0 * ^Subject: *\/[^ ].* { SUBJECT=`echo $MATCH` } :0 E { SUBJECT='(no subject)' } # From: :0 * ^From: *\/[^ ].* { FROM=`echo $MATCH` } :0 E { FROM=nobody } # Date: :0 * ^Date: *\/[^ ].* { DATE=`echo $MATCH` } :0 E { DATE='' } # Message-Id: :0 * ^Message-Id: *\/[^ ].* { MSGID=`echo $MATCH` } :0 E { MSGID='' } # References: :0 * ^References: *\/[^ ].* { REFERENCES=`echo $MATCH` } :0 E # grab any possibilities in In-Reply-To: * ^In-Reply-To:.*\/<[^<>]*@[^<>]*> { REFERENCES=`echo $MATCH` } :0 E { REFERENCES='' } # size :0 * BH ?? 1^1 . { SIZE="$=" } # Lines: :0 * ^Lines: *\/[^ ].* { LINES=`echo $MATCH` } :0 * B ?? 1^1 ^(.|$) { LINES="$=" } # Save the article now, so that we may grab the article number :0 c $NNDIR/. # Article No. :0 * LASTFOLDER ?? .*\/[0-9]+$ { ARTICLE=$MATCH } # create the nov entry # note that this is the actual delivering recipe :0: | echo "$ARTICLE $SUBJECT $FROM $DATE $MSGID $REFERENCES $SIZE $LINES" >> $NNDIR/.overview } VERBOSE=OFF # Local Variables: # auto-fill-function: nil # eval: (progn (setq font-lock-keywords (list '("#.*" . font-lock-comment-face) '("^[\t ]*:.*" . font-lock-type-face) '("[A-Za-z_]+=.*" . font-lock-keyword-face) '("^[ ]*\\*.*" . font-lock-reference-face))) (font-lock-mode)) # End: