From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "William G. Gardella" Newsgroups: gmane.emacs.help Subject: Re: Gnus does not see new mail in Maildirs Date: Sat, 30 Nov 2013 00:03:22 +0000 Message-ID: <8738mebvsl.fsf@motoko.kusanagi> References: <5b6911644bf8063cf44102cc440f08fd@mailoo.org> <871u1yki02.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1385769828 26543 80.91.229.3 (30 Nov 2013 00:03:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 Nov 2013 00:03:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 30 01:03:54 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VmY2M-0004rQ-BY for geh-help-gnu-emacs@m.gmane.org; Sat, 30 Nov 2013 01:03:54 +0100 Original-Received: from localhost ([::1]:50410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmY2L-0004Rl-Ra for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Nov 2013 19:03:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmY26-0004R0-Tb for help-gnu-emacs@gnu.org; Fri, 29 Nov 2013 19:03:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VmY22-00015h-E0 for help-gnu-emacs@gnu.org; Fri, 29 Nov 2013 19:03:38 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:40215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmY22-00013Z-7L for help-gnu-emacs@gnu.org; Fri, 29 Nov 2013 19:03:34 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VmY20-0004aM-E9 for help-gnu-emacs@gnu.org; Sat, 30 Nov 2013 01:03:32 +0100 Original-Received: from manning1.torservers.net ([96.44.189.100]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Nov 2013 01:03:32 +0100 Original-Received: from wgg2 by manning1.torservers.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Nov 2013 01:03:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 99 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: manning1.torservers.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:HXCF6GvmPEYVDX5oifLsRg2XI74= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94732 Archived-At: Emanuel Berg writes: > William G. Gardella 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 , 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.