all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "William G. Gardella" <wgg2@member.fsf.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Gnus does not see new mail in Maildirs
Date: Sat, 30 Nov 2013 00:03:22 +0000	[thread overview]
Message-ID: <8738mebvsl.fsf@motoko.kusanagi> (raw)
In-Reply-To: 871u1yki02.fsf@nl106-137-194.student.uu.se

Emanuel Berg <embe8573@student.uu.se> writes:

> William G. Gardella <wgg2@member.fsf.org> writes:
>
>> This is very close to the config I use myself and I
>> love it, so I hope this advice helps.
>
> I remember talking to you on gnu.emacs.gnus and I
> didn't quite understand you, and that was because your
> reasoning applied to nnmaildir, and mine to nnml.
>
> In the Gnus manual FAQ on different solutions for mail
> [1], I read:

[...]

> Well, that doesn't seem to be that radical a
> difference.

The main difference between Maildir and MH-style one-message-per-file
formats like nnml is that Maildir is designed to handle concurrent
manipulations by multiple clients or mail transport/mail delivery agents
at the same time.  Rather than Gnus handling final local mail delivery
to the folders where you're keeping the mail, it's possible for system
daemons to take care of that and have Gnus (and other Maildir-compatible
MUAs, mail indexing utilities, etc.) just sit back and watch. :) Your
system's mail server can be delivering mail directly to a user's Maildir
even as the user's MUA reads, moves, flags, or deletes messages in the
same Maildir.  To read more about the Maildir specification, have a look
at http://cr.yp.to/proto/maildir.html.

In my setup, for example, mail arrives at my system's MTA, sendmail,
either by fetchmail from a remote POP site or by direct delivery to the
MTA.  As the final step in sendmail's processing of the incoming mail,
sendmail invokes procmail using my ~/.procmailrc, which instructs it to
deliver to several Maildirs based on information in the headers.  (Note
that some newer MTAs, e.g. Postfix, often support delivery to Maildirs
directly, so the additional local mail delivery agent like procmail may
be omittted.)

~/.procmailrc is here:

--8<---------------cut here---------------start------------->8---
:0 c
* ^X-Spam-Status: Yes
Maildir/spam/
:0 Ec
* ^List-Unsubscribe:.*
Maildir/lists/
:0 Ec
Maildir/mail/
:0
| notmuch new
--8<---------------cut here---------------end--------------->8---

These rules tell it to copy SpamAssassin-suspected spam to
~/Maildir/spam/, mail with a List-Unsubscribe header to
~/Maildir/lists/, and, as the fallback rule, everything else (hopefully
actual personal correspondence!) to ~/Maildir/mail/.  The final rule
runs the "notmuch" indexing software <http://notmuchmail.org>, which I
use together with Gnus's `nnir' library for fast search, on all the
incoming mail, and purges it from sendmail's spool.

Gnus mail-handling config in further detail is here:

--8<---------------cut here---------------start------------->8---
(setq gnus-select-method
      '(nnmaildir ""
		  (directory "~/Maildir/")
		  (get-new-mail nil)
		  (nnir-search-engine notmuch))
      nnmail-split-methods
      '(("spam" "^X-Spam-Status: Yes")
	("lists" "^List-Unsubscribe:.*")
	("mail" ""))
      gnus-secondary-select-methods
      '((nntp "news.gmane.org"))
      gnus-message-archive-method gnus-select-method
      gnus-message-archive-group "mail"
      nnir-notmuch-remove-prefix "/home/wgg/Maildir/"
      gnus-summary-respool-default-method 'nnmaildir)
--8<---------------cut here---------------end--------------->8---

It seems like needless redundancy, but I reproduce the procmail
splitting rules in Gnus as well so that when "respooling" mail into the
Maildir backend, e.g. from downloaded mbox archives of mailing list
posts, it is automatically filtered into the appropriate folders (even
though it didn't arrive through the sendmail->procmail pipeline).

As a subtle form of new-mail notification in the mode-line, I also use
`display-time-mode' together with an appropriate setting of
`display-time-mail-directory':

(setq display-time-mail-directory "~/Maildir/mail/new/")

`display-time' doesn't directly grok Maildir as far as I know, but the
above is a kludge so that only personal mails (those filtered to
"~/Maildir/mail"), which have not been renamed yet by Gnus or another
Maildir client (and are thus still in new/), trigger the notification.




  reply	other threads:[~2013-11-30  0:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29 10:53 Gnus does not see new mail in Maildirs Alexis Praga
2013-11-29 21:09 ` William G. Gardella
2013-11-29 21:41   ` Alexis Praga
2013-11-29 23:26     ` William G. Gardella
2013-11-29 23:48       ` Alexis Praga
2013-11-30  7:25         ` W. Greenhouse
2013-11-30 11:24           ` Alexis Praga
     [not found]   ` <mailman.7507.1385761301.10748.help-gnu-emacs@gnu.org>
2013-11-29 22:22     ` Emanuel Berg
     [not found] ` <mailman.7504.1385759419.10748.help-gnu-emacs@gnu.org>
2013-11-29 21:36   ` Emanuel Berg
2013-11-30  0:03     ` William G. Gardella [this message]
     [not found]     ` <mailman.7595.1385769824.10748.help-gnu-emacs@gnu.org>
2013-11-30  0:35       ` Emanuel Berg
2013-12-09  9:13         ` Emacs and solarized Alexis Praga
2013-12-09 10:57           ` Ian van der Neut
2013-12-09 11:25             ` Alexis Praga
2013-12-10  9:51               ` Alexis Praga
2013-12-10 14:48                 ` William G. Gardella
2013-12-10 15:07                   ` Alexis Praga
2013-12-11  4:38                     ` W. Greenhouse
2013-12-11 10:19                       ` Alexis Praga
     [not found] <mailman.7471.1385738567.10748.help-gnu-emacs@gnu.org>
2013-11-29 19:18 ` Gnus does not see new mail in Maildirs Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8738mebvsl.fsf@motoko.kusanagi \
    --to=wgg2@member.fsf.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.