Using procmail to filter and MH to read.

1997-08-12 Thread Peter S Galbraith

Looking for advice here...

Suppose I use procmail as my delivery agent (instead of deliver)
and MH (actually mh-e in Emacs) to read mail.

What do people do to separate out (filter) the Debian mailing?
Do you use a new sendmail ruleset?  Or some /etc/procmail or 
~/.procmailrc file?

Does the filtering drop the mail directly into a folder, or better yet
produce another mail drop that can be included using MH's inc'ed, e.g.  

 inc -file /var/spool/mail/galbraith-Debian

That would be neat...  I could use standard xbiff-like programs
(like xbuffy) to monitor the mail, and inc the spool file directly into
a distinct mail folder.
--
Peter Galbraith, research scientist [EMAIL PROTECTED]
Maurice-Lamontagne Institute, Department of Fisheries and Oceans Canada
P.O. Box 1000, Mont-Joli Qc, G5H 3Z4 Canada  418-775-0852 - FAX 418-775-0546


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: Using procmail to filter and MH to read.

1997-08-12 Thread Andy Kahn

Peter S Galbraith wrote:
- 
- Looking for advice here...
- 
- Suppose I use procmail as my delivery agent (instead of deliver)
- and MH (actually mh-e in Emacs) to read mail.
- 
- What do people do to separate out (filter) the Debian mailing?
- Do you use a new sendmail ruleset?  Or some /etc/procmail or 
- ~/.procmailrc file?
- 
- Does the filtering drop the mail directly into a folder, or better yet
- produce another mail drop that can be included using MH's inc'ed, e.g.  
- 
-  inc -file /var/spool/mail/galbraith-Debian
- 
- That would be neat...  I could use standard xbiff-like programs
- (like xbuffy) to monitor the mail, and inc the spool file directly into
- a distinct mail folder.
- --
- Peter Galbraith, research scientist [EMAIL PROTECTED]
- Maurice-Lamontagne Institute, Department of Fisheries and Oceans Canada
- P.O. Box 1000, Mont-Joli Qc, G5H 3Z4 Canada  418-775-0852 - FAX 418-775-0546
- 
- 
- --

i don't use MH, but i've used procmail before.  you can simply set a
rule in ~/.procmailrc to (re)direct mail to a file.  for example:

:0 f
* ^To: debian-user@lists.debian.org
debian


in this case, the debian file resides in MAILDIR, which must be
specified in the beginning of .procmailrc (e.g., MAILDIR=$HOME/Mail)
the resulting mail file is in no particular format, other than the
format initially delivered to your system.

considering that i'm fairly new to the Debian set (after being a Redhat
user for a while), i'm sure there are other (possibly better ways) to
do this, but this has worked for me in the past.

hope this helps,
--andy


-- 
Andy Kahn  ([EMAIL PROTECTED])Phone: 603-884-2557 (DTN: 264-2557)
Digital Equipment CorporationFax  : 603-881-2257


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: Using procmail to filter and MH to read.

1997-08-12 Thread Dima
Peter S Galbraith wrote:
 
 Looking for advice here...
 
 Suppose I use procmail as my delivery agent (instead of deliver)
 and MH (actually mh-e in Emacs) to read mail.
 
 What do people do to separate out (filter) the Debian mailing?
 Do you use a new sendmail ruleset?  Or some /etc/procmail or 
 ~/.procmailrc file?

Put the following in your ~/.procmailrc:

:0:$MAILDIR/debian-user/.mh_sequences.$LOCKEXT
* ^FROMdebian-user.*
| /usr/lib/mh/rcvstore +debian-user

HTH
--
Dimitri
emaziuk at curtin dot edu dot au

Mirrors and copulation are abominable because they multiply entities
(corollary to Occam's Razor)



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Using procmail to filter and MH to read (summary)

1997-08-12 Thread Peter S Galbraith

I wrote:

 Suppose I use procmail as my delivery agent (instead of deliver)
 and MH (actually mh-e in Emacs) to read mail.
 
 What do people do to separate out (filter) the Debian mailing?

Andy Kahn [EMAIL PROTECTED] suggested I redirect to a file using
this in ~/.procmailrc

:0 f
* ^To: debian-user@lists.debian.org
debian

Dima [EMAIL PROTECTED] suggested MH's own folder refiler like this
in ~/.procmailrc:

:0:$MAILDIR/debian-user/.mh_sequences.$LOCKEXT
* ^FROMdebian-user.*
| /usr/lib/mh/rcvstore +debian-user


What I decided to do is to mail file to a second file (a spool file) such
that: 
  - I can download a copy from home using my PC's POP server.
  - I can use an xbiff-like program to notify me of new mail.

So my filter looks like:
-- ~/.procmailrc --
MAILDIR=/var/spool/mail

:0
* ^From [EMAIL PROTECTED]
debian
-- ~/.procmailrc --

I wrote the following elisp code for Emacs to incorporate my newmail
simply by pressing `D' in a folder buffer.

Peter

-- e-mh-inc-procmail.el --
;; e-mh-inc-procmail --- inc(orporate) filtered mail into a specific folder

;; Copyright (C) 1994, 1995, 1996, 1997 Peter S. Galbraith
 
;; Author:Peter S. Galbraith [EMAIL PROTECTED]
;; Created:   12 Aug 1997
;; Version:   1.00 (12 Aug 97)
;; Keywords:  mh-e, procmail, Debian

;; RCS $Id: e-mh-inc-procmail.el,v 1.4 1997/08/12 20:17:34 rhogee Exp $
;; Note: RCS version number does not correspond to release number.

;;; This file is not part of GNU Emacs.

;; This package 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, or (at your option)
;; any later version.

;; This package 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 GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;; 
;;; Commentary:
;; This minor hack is made to ease the use of mh-e when procmail is used to 
;; filter a mailing list, by providing a quick way to `inc' the mailing
;; list's mail into a folder.

;; Usage instructions:
;; ~~
;;  Use the `D' key in any e-mh folder to switch to your procmail folder
;;  and incorporate new mail.
;;
;;  The advantage to leaving mail on a spool file rather than using 
;;  a filter pipe to something like 
;;| /usr/lib/mh/rcvstore +Debian
;;  is that (1) I can use fetchmail from home to get a copy of the mail
;;  and (2) I can use an xbiff-like program to monitor the mail spool, e.g.
;;
;;   xbuffy -orig -acmd /usr/X11R6/bin/auplay 
;;   /usr/lib/tkdesk/sounds/newmail.au 
;;  -poll 10 -header 3 
;;  -command gnudoit -q '(e-mh-inc-procmail)' 
;;  /var/spool/mail/debian


;; Installation instructions:
;; ~
;;  Create a ~/.procmailrc filter to send your mailing list's mail to
;;  a file (See `C-h v e-mh-inc-procmail-mail-file' for details).
;;
;;  setq the variables `e-mh-inc-procmail-mail-file' and 
;;  `e-mh-inc-procmail-folder' according to your re-routed spool file and 
;;  selected MH folder.  e.g. put something like this in your ~/.emacs
;;   (setq e-mh-inc-procmail-mail-file ~/Mail/debian-mail
;; e-mh-inc-procmail-folder+Debian)
;;
;;  In the default settings, I read in /var/spool/mail/debian into the 
;;  +Debian folder. 
;; 
;;; Change log:
;; V1.00 August 12 97 - Peter Galbraith - Created
;;; Code:


(defvar e-mh-inc-procmail-mail-file /var/spool/mail/debian
  Path to my Debian mail file, as filtered by procmail.
Use a procmail filter like so:

MAILDIR=/var/spool/mail

:0
* ^From [EMAIL PROTECTED]
debian
)

(defvar e-mh-inc-procmail-folder +Debian
  MH Folder used for the procmail filtered mailing list.)

(defun e-mh-inc-procmail ()
  Inc(orporate)s new Debian mail into the Debian folder
  (interactive)
  (cond 
   ((eq 0 (elt (file-attributes e-mh-inc-procmail-mail-file) 7))
(message No new Debian mail))
   (t
(let ((config (current-window-configuration)))
  (cond ((not (get-buffer e-mh-inc-procmail-folder))
 (mh-make-folder e-mh-inc-procmail-folder)
 (setq mh-previous-window-config config))
((not (eq (current-buffer) (get-buffer e-mh-inc-procmail-folder)))
 (switch-to-buffer e-mh-inc-procmail-folder)
 (setq mh-previous-window-config config
(mh-get-new-mail e-mh-inc-procmail-mail-file)
(run-hooks 'mh-inc-folder-hook

(define-key mh-folder-mode-map D 'e-mh-inc-procmail)
(provide