Subject: mail-delivery-agents?

From: Dale Scheetz <[email-masked]>
Date: Fri, 2 Aug 1996 14:35:13 -0400 (EDT)

The current way I manage my e-mail involves using popclient to get
incoming e-mail from my ISP (mail.polaris.net) to dwarf's incoming mail
folder on my machine (dwarf.polaris.net), outgoing mail is handled by Pine
using SMTP. I would like to try some other mail readers like elm and emacs
but none of these seem to be able to do SMTP and so require the presence
of a mail-delivery-agent.
I know I have heard pro and con discussions about smail vs sendmail but am
still confused. Also I hear hints that qmail (?) will soon be a Debian
package. I am a complete idiot when it comes to mail systems, so please be
simple and clear in your answer ;-)
What do I need to understand to install and use any of the available
packages?
If I am going to go to the trouble of learning to install a
mail-delivery-agent I will want to be able to filter mail to various
mail-folders based on the source of that mail. If that is not available in
the mail-delivery-agent, then point me to a package that will work with
the target mail-delivery-agent.

Thanks in advance for any help,

Dwarf

------------                                          --------------

aka   Dale Scheetz                   Phone:   1 (904) 877-0257
      Flexible Software              Fax:     NONE 
      Black Creek Critters           e-mail:  [email-masked]

------------ If you don't see what you want, just ask --------------

---

From: [email-masked]
Date: Fri, 2 Aug 96 18:50 EDT

Dale Scheetz writes:
  Dale>  The current way I manage my e-mail involves using popclient to get
  Dale> incoming e-mail from my ISP (mail.polaris.net) to dwarf's incoming
  Dale> mail folder on my machine (dwarf.polaris.net), 

Same here. I advocate [email-masked], which forwards to
[email-masked], my wife's Debian box on campus, from where I
popclient everything to the house (edd@miles, dynamic IP).

  Dale> outgoing mail is handled by Pine using SMTP.

I use smail, locally and for outgoing mail. _Very_ easy to setup and change
all the time because Ian Jackson wrote a fantastic /usr/sbin/smailconfig.

The only problem is that you have to "fake" another email address for
outgoing mail.  There are several ways to do it, directly with emacs, pine
(as you compiled the switch in, on my hint :-) and elm, or via smail
indepently of the MUA as was recently discussed on debian-user.

I also use procmail to sort my mail into 21 (!!!) different mail folders for
different mailing lists.

  Dale>  I would like to try some other mail readers like elm and emacs but
  Dale> none of these seem to be able to do SMTP and so require the presence
  Dale> of a mail-delivery-agent.

I can really recommend emacs with the vm mode. Really. 

  Dale>   I know I have heard pro and con discussions about smail vs sendmail
  Dale> but am still confused. Also I hear hints that qmail (?) will soon be
  Dale> a Debian package. I am a complete idiot when it comes to mail
  Dale> systems, so please be simple and clear in your answer ;-)

Goes with smail. Use the "smarthost" feature of the smailconfig for outgoing
mail.

  Dale>  What do I need to understand to install and use any of the available
  Dale> packages?

Nothing, basically :-)

  Dale>   If I am going to go to the trouble o1f learning to install a
  Dale> mail-delivery-agent I will want to be able to filter mail to various
  Dale> mail-folders based on the source of that mail.

You can already do that with your existing setup. Just install procmail, and
email me for examples.

  Dale>  If that is not available in the mail-delivery-agent, then point me
  Dale> to a package that will work with the target mail-delivery-agent.
  Dale> 
  Dale> Thanks in advance for any help,

Pleasure.

--
Dirk Eddelb"uttel                             http://qed.econ.queensu.ca/~edd

---

From: Rob Browning <[email-masked]>
Date: 02 Aug 1996 21:28:05 -0500

> I can really recommend emacs with the vm mode. Really. 

My personal favorite is Gnus.  It does a *wonderful* job with mail.
Threading, filtering, deleting duplicates, etc...

Getting it set up just the way I wanted was a little tricky, but
anyone who's interested can mail me, and I'll give you an intro.

--
Rob

---

From: Ed Donovan <[email-masked]>
Date: 03 Aug 1996 03:07:00 -0400

And Dale - 

If you're thinking of going with emacs clients, there's an smtpmail.el
package.  Not to stunt your budding mail-admin-ship, but maybe it'd do
the job.  I don't use it but a decent number of people seem to.

<URL:http://www.cs.washington.edu/homes/voelker/ntemacs/contrib/smtp> is
the most recent locale I've seen (that was off the Gnus mailing list, I
have no relations with NT, thank you please! :-)  

-- 

Ed Donovan			[email-masked]

(reader should note unhealthy emacs-junkie gleam in poster's eye)

---

From: Rob Browning <[email-masked]>
Date: 03 Aug 1996 11:42:39 -0500

Rob Browning <[email-masked]> writes:

Several people have asked me for my Gnus setup, so I'll post it here.
Hope no one's offended, but it has a fairly high signal to noise ratio
if you're interested in gnus for mail with debian.  This is stuff I've
sent to a couple of people before.  Feel free to ask if you have any
questions.

Gnus supports a number of backends for mail.  It can handle RMAIL, mh,
etc, but I would recommend that you switch to using the nnml back end.
It's much faster since it generates NOV overview databases (the same
ones used by news servers) for all the mail folders.  Other than that
it stores mail just like mh, one message per file.  Makes scripting
over messages easy, but it can be hard on the inodes :>

 I think that nnml is compatible with mh, but only if you don't use
both at the same time.  I think that gnus won't notice changes made by
mh with this method until restart and vice versa.

I'f you're already using mh, you don't have to do anything special to
use nnml other than tell gnus to use it.  It will then run over your
mh heirarchy and automatically generate the databases.  That's what I
did.  All my code assumes you are using nnml, but that should only be
an issue in a couple of places where I set up the mail group servers.

I'm going to assume for now that you don't want to use the bleeding
edge release, and that the one that came with your emacs is OK.  Is it
emacs-19.31.1?  If not, you may need the newer version of Gnus (or
emacs).  I will have info below about how to use the bleeding edge if
you're interested.  I'm using 5.2.38 to write this and it works great.

Gnus treats mail groups (as opposed to news groups) specially with
respect to deleting articles.  The normal rule is: "if it's a mail
group, never delete anything unless specifically told to, and then
only after the expiration period."

You expire mail articles with "E" in the summary buffer.  The default
expire period is two weeks.  If any article is two weeks old and has
been expired, it is deleted.  This is kind of nice if you later
(within two weeks) decide you really did need some old message.  Also,
expired articles (until their deletion) still show up in threading
histories, etc.

You should also look in the info pages (gnus' are quite complete, Lars
is insanely prolific) at the section on "Topics".  This allows you to
organize your groups in collapsible outline form.

With respect to file system layout, I have my groups set up like this:

~/Mail/Incoming/inbox        (incoming mail that doesn't go anywhere else)
~/Mail/Incoming/debian-bugs  (debian bug list)
~/Mail/Incoming/...          (other assorted mail groups)

and for outgoing stuff:

~/Mail/Outgoing/misc-mail 
~/Mail/Outgoing/misc-news 

this used to be the default in gnus, but in the latest version, it
saves no mail by default, so I explicitly enable this in my .emacs.

For news (don't forget to check out the info pages on persistent
articles and asynchronous fetching -- too cool):

~/News/...  (all Gnus related stuff for *incoming* news goes here)

Note that it might make more semantic sense for misc-news to go under
~/News, but it turns out that would be pretty awkward to manage with
the way Gnus wants to handle things right now.  I don't think you
could do it without more hassle than it's worth, and the way I have it
now, all personal writings are in one subdir.

A couple of other things of note.  If you just want to read mail,
without going through the time consuming (at 28.8) process of
contacting the news server and getting the current news group status,
you just use M-x gnus-no-server instead of M-x gnus to launch gnus.

One caveat, you might notice that all of the mail groups vanish along
with the news groups when you do this (i.e. when you run
gnus-no-server).  That's just because groups have levels of
"activeness", and gnus-no-server only shows groups of level 2 or
lower.  Unfortunately all groups, including mail groups, are created
at level 3 by default, so they vanish with gnus-no-server.  To see
them again, you just need to launch gnus the old fashioned way (M-x
gnus) and then use the set level command to set the level of all your
mail groups to 2.  You can set the levels via "S l" with the cursor on
the relevant group in the Group buffer.

In order to actually get your mail, you might be able to use pop
directly from gnus (I think that's supported now, but I'm not sure),
but I just use popclient to grab my mail from all the relevant
machines, and then let gnus suck up the mail from my normal system
mailbox, which it does by default.

Gnus automatically gets your new mail when you launch it, but if you
want to incorporate all the new mail after launching gnus, you can use
"g" from the group buffer which updates all the mail and news groups,
or "2 g" which only does groups level 2 or higher, i.e. the mail
groups (there are other commands too, see M-g, for example, which
works from a mail summary buffer).

Incoming mail is split into sub-groups (if you want) via
gnus-nnmail-split-methods.  There's an example below.  It will
automatically create a new group when it needs one according to the
rules and the incoming mail.  Gnus can recognize most duplicates in
incoming mail.  It does this by keeping a cache of article numbers.
It can be told to delete them, but I have it shunt them to a separate
group instead with the split-methods.

I hope I anticipated all your problems, but if not, feel free to ask
me any questions.  I would, of course, recommend first backing up your
mail setup just in case.

Here's the Gnus relevant bits from my current .emacs.  Note that there
are a couple of places where I have either "osiris" or my name.
You'll need to change all those.  Make sure you do this *before* the
first time you run gnus.  Some of the things it does are hard to undo
without starting over with an empty .newsrc.eld

Also, be warned, this is not necessarily organized in any particular
fashion, except that I moved most of the stuff that I could find that
you *must* change to the beginning.

=== Begin gnus .emacs stuff

;; I like these, and they affect gnus too.
(line-number-mode 1)
(global-font-lock-mode t)
(transient-mark-mode 1)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Gnus setup
;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; You have to change these:

;; Your primary server
(setq gnus-select-method '(nntp "newshost.cc.utexas.edu"))

;; So the server will accept me
(setq gnus-local-domain "cs.utexas.edu")

;; So the from field will be reasonable.
(setq gnus-user-from-line "Rob Browning <[email-masked]>")
(setq user-mail-address "[email-masked]")
(setq gnus-local-organization "The University of Texas at Austin")

;; Change the name osiris below to whatever you like.  As far as gnus
;; is concerned, it's the name of the mail server.

;; "server" for all incoming mail
(setq gnus-secondary-select-methods 
      '((nnml "osiris" 
              (nnml-directory "~/Mail/Incoming")
              (nnml-active-file "~/Mail/Incoming/active")
              )))

;; "server" for all outgoing mail and news
(setq gnus-message-archive-method
      '(nnml "outgoing" 
						 (nnml-directory "~/Mail/Outgoing") 
             (nnml-active-file "~/Mail/Outgoing/active")
						 (nnml-get-new-mail nil)))

;; Change this to be whatever you like, but make sure that the last
;; item in the list has an empty regex.  That's where all the
;; unmatched mail goes.  If you don't, gnus will happily trash the
;; mail that doesn't match a regex.
(setq		
 nnmail-split-methods
 '(
   ("debian-bugs" "^Subject: \\(Re: \\)?Bug#[0-9]+:")
   ("guile" "^Sender: [email-masked]")
   ("duplicates"  "^Gnus-Warning:")
   ("inbox"       "")))  

;; This is *only* if you want to use the latest gnus, and you build it
;; in the directory mentioned. (also see the footnote*** at the end.)
;;(setq load-path 
;;      (cons (expand-file-name 
;;             "/usr/local/lib/emacs/site-lisp/gnus/lisp") 
;;            load-path))

;; This is stuff that you probably want, but don't have to change.

;; Very nice...
(setq gnus-asynchronous t)

;; Make all new groups zombies.  You can peruse them at your leisure
;; (with "A z" from the group buffer) and either subscribe (with "u",
;; from the group buffer.  It's a toggle) or kill them (C-k) as
;; desired.
(setq gnus-subscribe-newsgroup-method 'gnus-subscribe-zombies)

;; All kinds of good config stuff.  I think you can leave this alone
;; until/unless you feel like figuring it out.
(setq gnus-check-new-newsgroups 'ask-server)
(setq gnus-save-newsrc-file nil)
(setq gnus-extract-address-components 'mail-extract-address-components)
(setq gnus-auto-select-next t)
(setq gnus-auto-select-same t)
(setq gnus-use-cross-reference 'all)
(setq gnus-auto-select-newsgroup nil)
(setq gnus-summary-check-current t)
(setq gnus-fetch-old-headers 'some)
(setq gnus-thread-hide-subtree t)
(setq gnus-thread-indent-level 2)
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(setq gnus-use-cache 'passive)
(setq gnus-permanently-visible-groups "^nnml+")
(setq gnus-build-sparse-threads 'some)
(setq gnus-keep-backlog 50)

;; Tell gnus where to put outgoing copies
(setq gnus-message-archive-group 
      '((if (message-news-p)
            "misc-news" 
          "misc-mail")))

;;; Score file stuff
(setq gnus-kill-killed t)  ;; so you can re-kill a set of articles

;; Change this as indicated in the info pages if you actually want
;; gnus to delete the duplicates.
(setq nnmail-delete-duplicates 'warn)

(setq gnus-uu-user-view-rules
      (list 
       '("\\.\\(jpe?g\\|gif\\|tiff?\\|p[pgb]m\\|xwd\\|xbm\\|pcx\\)$" "xv -8")))

=== End gnus .emacs stuff

*** If you do want the bleeding edge gnus, you need to uncomment the
relevant bit in the .emacs code above, build the latest version in the
directory mentioned, and add the following to your .bashrc:

export INFOPATH=/usr/local/lib/emacs/site-lisp/gnus/texi:/usr/local/info:/usr/info

so you get the right info pages.  Note that you can't just add to your
INFOPATH with:

export INFOPATH=/usr/local/lib/emacs/site-lisp/gnus/texi:${INFOPATH}

because the environment variable is not normally set at all.  Info has
defaults that it uses if there's no INFOPATH.

Hope this helps
--
Rob

---

From: [email-masked]
Date: Sat, 3 Aug 96 13:18 EDT

Hi Lamar

I hope you don't mind that I put this back onto the list as other people
might wonder about this too.

  Lamar>  Hi, Dirk.  I seem to be having some trouble getting posts to the
  Lamar> debian-user list, so I'm mailing you directly.
  Lamar> 
  Lamar> You posted something about using procmail _and_ pop to sort your
  Lamar> mail.  I was wondering how you invoke procmail?  I, too, use
  Lamar> popclient to get my mail, and I'd _love_ to be able to have procmail
  Lamar> (or slocal or something) filter it for me.

It is all in the procmail manpages --- but as those are quite detailed it
hard to find as first sight. Note also that Debian procmail package has, as
many other packages, a lot of documentation in /usr/doc/<package> and 
/usr/doc/example/<package>.

1. I start popclient as (indented by a TAB for readability)
	popclient -s -3 -P ~/.file-with-password host.that.has.mail  
to get my mail to my local machine.

2. One needs a file ~/.forward of the following form
	"|IFS=' '&&exec /usr/bin/procmail -f-||exit 75 #edd"
where the end must  #<user-id>"  as a fallback strategy. This passes the mail
to the procmail program.

3. A file ~/.procmailrc describes the sorting rules. There are lots of
examples in the manpage, and the /usr/doc/examples/procmail directory. But as
a concrete example, here are some pieces. If it looks all to strange, than
it's probably time to review a Unix book with something on regular
expressions. I just show some entries as it is mostly repetitive

------------------------ ~/.procmailrc --------------------------------------
# edd 26.10.95	installed from adapted version from /usr/doc/examples/procmail

PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:.
MAILDIR=$HOME/mail
# use `usual' default and not this one:  DEFAULT=$MAILDIR/mail.in
LOGABSTRACT=all
LOGFILE=$MAILDIR/log/procmail

:0:				# mail To or CC ctan-ann
* (^To|^CC|^Resent-).*ctan-ann@(shsu.edu|RELAY.URZ.UNI-HEIDELBERG.DE)
in.ctan-announce

:0:				# mail To or CC debian-announce
* (^To|^CC|^Resent-).*debian-announce@.*(debian.org|pixar.com)
in.debian-announce

:0:				# mail To or CC debian-bugs, debian-bugs-done
* (^To|^CC|^Resent-).*debian-bugs(-done)?@.*(debian.org|pixar.com)
in.debian-bugs

:0:				# Another one for new bugs system
* (^To|^CC|^Resent-)[email-masked]
in.debian-bugs

:0:				# mail To or CC debian-changes
* (^To|^CC|^Resent-).*debian-changes@.*(debian.org|pixar.com)
in.debian-changes

:0:				# mail To or CC debian-devel
* (^To|^CC|^Resent-).*debian-devel@.*(debian.org|pixar.com)
in.debian-devel

:0:				# mirror logs
* ^To: edd
* ^Subject: mirror update$
in.mirror-update
-----------------------------------------------------------------------------

:0: always starts a new rule section. Line with * describes rules, if there
are several they are ANDed together. The last line shows the folder into
which a message is put. 

Hope this helps, Dirk