[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GNUS and Mail



>>>>> Mark Lever writes:

    Mark> Hi, I use gnus and rmail.  I've been using rmail for so long
    Mark> now, and it is limited.  Someone mentioned here that they
    Mark> use gnus for their mail and different folders contained
    Mark> different types of mail.  Could they elaborate and explain
    Mark> to me how to get gnus to look at my mailbox and separate the
    Mark> mail into different folders?

    Mark> Either to the list or directly...

 This works for me in XEmacs 20.  I get my mail home using
`fetchmail', which is configured with an "mua" line in its control
file that has it run `formail -s procmail'.

 I had to create "~/Mail" and "~/Mail/.incoming" with dired to get it
started.  The "~/.gnus" file is right out of the Info manual, except
for the function I've added.


;; -*- emacs-lisp -*-
(require 'mime-setup)
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(setq nnfolder-directory "~/Mail/")
(setq nnmail-spool-file 'procmail)
(setq nnmail-procmail-directory "~/Mail/.incoming/")
(setq gnus-secondary-select-methods '((nnfolder "")))
(setq nnmail-procmail-suffix "")
(add-hook 'gnus-select-group-hook 'gnus-group-set-timestamp)
;;(setq gnus-group-line-format
;;           "%M\%S\%p\%P\%5y: %(%-40,40g%) %d\n")
(setq gnus-group-line-format
           "%M\%S\%p\%P\%5y: %(%-40,40g%) %6,6~(cut 2)d\n")


;;; Experimental --- plussed addresses.
(defvar alias-suffix-history nil
  "History variable for `my-address-choice' minibuffer completion.")

(setq alias-suffix-alist
      '(("news") ("mail")
	("plug") ("xemacs") ("debdev") ("debuser")
	("support")
	("other")
	))

(make-variable-buffer-local 'mail-default-reply-to)
(make-variable-buffer-local 'user-mail-address)

(defun my-address-choice ()
  "This function chooses which alias-suffix to use"
  (interactive)
  (let* ((alias-suffix (completing-read "Which alias-suffix: "
					alias-suffix-alist
					nil nil nil
					'alias-suffix-history))
	 (mailname (exec-to-string "cat /etc/mailname")) ;Debian GNU/Linux
	 (mailname (substring mailname 0 (1- (length mailname))))
	 (alias)
	 )
    (setq alias (concat (user-login-name)
			(and alias-suffix (concat "+" alias-suffix))
			"@" mailname)
	  mail-default-reply-to alias
          user-mail-address alias)
    (message "%s" alias)))

(add-hook 'message-header-setup-hook 'my-address-choice)

# Ask XEmacs to pretend this is -*- sh -*-.
PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=$HOME/Mail/.incoming
DEFAULT=$MAILDIR/Inbox
#LOGFILE=$HOME/Mail.from
LOGFILE=/dev/xconsole
MY_ADDR=karlheg@inetarena.com

# formail -s procmail

#-------------------------------------------------------
#   From the BitterSweet Technical Support mailing list
:0:
* ^Resent-From:.*support
Support

#----------------------------------------------
#  Other users/lists on this system:
:0c
* ^To.*slarti.*inetarena
! slarti@bittersweet.inetarena.com

:0c
* ^To.*robinh.*inetarena
! robinh@bittersweet.inetarena.com

:0c
* ^To.*jillian.*inetarena
! jillian@bittersweet.inetarena.com

:0c
* ^To.*zaphod.*inetarena
! zaphod@bittersweet.inetarena.com

# And a copy for me, since these are just aliases to
#  my Internet Arena account anyhow, that I use for testing.
:0
* ^To.*((slarti)|(robinh)|(jillian)|(zaphod)).*inetarena
Lusers

#------------------------------------------
# to karlheg+support
:0
* ^To:.*karlheg\+support
Support

#---------------------------------------------------
#  Qpopper Bulletins
:0
* ^To.*bulletin@(bittersweet|localhost)*
* !^From.*bittersweet-support
{
    Bullno= `printf '%04d' $(( $(tail -1 <(ls /var/spool/popbull/) | cut -d_ -f1) + 1))`
    Bullnm= `formail -x Subject: | tr -s [:blank:] _`

    UMASK=022

    :0w
    * $^X-Passwd.*BlessedProcmail$
    | formail  -I X-Passwd: -I Return-Path: -I Received: \
	-a 'Reply-To: support@bittersweet.inetarena.com' \
	-a Message-ID: \
	> /var/spool/popbull/${Bullno}${Bullnm}
}

#---------------------------------------------------
#  Spam:
:0:
* ^FROMearthlink
SPAM

#---------------------------------------------------
#  Family
:0:
* ^From:.*(BUCKINGHAM)|(legend.*nidlink)
Family

#----------------------------------------------------
:0:
* ^From.*CERT
CERT

#----------------------------------------------------
#  Debian GNU/Linux: Software in the Public Interest
:0:
* ^TOdebian-announce
Debian.Announce

:0:
* ^TOdebian-devel-announce
Debian.Devel-Announce

:0:
* ^TOdebian-changes
Debian.Changes

:0:
* ^TOdebian-devel-changes
Debian.Devel-Changes

:0:
* ^TOdebian-bugs
Debian.Bugs

:0:
* ^From.*bugs\.debian\.org
Debian.Bugs

:0:
* ^TOdebian-qa
Debian.QA

:0:
* ^TOdebian-faq
Debian.FAQ

:0:
* ^TOdebian-user
Debian.User

:0:
* ^TOdebian-devel
Debian.Devel

:0:
* ^TOdebian-admintool
Debian.Admintool

:0:
* ^TOdebian-doc
Debian.Doc

:0:
* ^TOdebian-book
Debian.Book

:0:
* ^TOdebian-www
Debian.WWW

:0:
* ^TOdebian-publicity
Debian.Publicity

#-------------------------------------------------
:0:
* ^To:.*redhat-announce
RedHat.Announce

#-------------------------------------------------
:0:
* ^TOlinux.*kernel
Linux.Kernel

:0:
* ^To.*cc-mode
CC-Mode

:0:
* ^Toshadow-list
Shadow

:0:
* ^TO(plug.*@northwest.com|ug@peak.org)
PLUG

:0:
* ^TOprocmail
Procmail

:0:
* ^TOsmartlist
Smartlist

:0:
* ^TOparport
Parport

#---------------------------------------------------
#  XEmacs mailing lists
:0:
* ^TOxemacs-beta-discuss
XEmacs.Discuss

:0:
* ^TOxemacs-beta
* ! ^Subject.*re:
* ^Subject.*patch
XEmacs.Patches

:0:
* ^TOxemacs-beta
XEmacs.Beta

#----------------------------------------------
# Misc. Mailing lists
:0:
* ^From.*wordsmith.org
Wordsmith

:0:
* ^To:.*@quest.arc.nasa.gov
Lfa

:0:
* ^TOlyx@via
LyX

:0:
* ^To.*gcl@cli.com
GCL

#----------------------------------------------
#  Cron mail from mail run job bringing diald up.
:0
* ^Subject.*/bin/echo.*/dev/dialdctl
/dev/null

#---------------------------------------------------
# System Accounts
:0:
* ^From.*Cron.Daemon
Cron

:0:
* ^From.*news.<news>
News

:0:
* ^Subject.*Returned.mail:
Bounce

:0:
* ^FROM_DAEMON
Daemons

#----------------------------------------------
# Mail from myself and from anyone at Inetarena
:0:
* ^From.*karlheg
Myself
:0:

* ^From.*inetarena
Inetarena

mailto:karlheg+sig@inetarena.com (Karl M. Hegbloom)
http://www.inetarena.com/~karlheg
Portland, OR  USA
Debian GNU 1.3  Linux 2.1.36 AMD K5 PR-133

Reply to: