(nnmairix): Mention mairix.el. Point out the importance of nnml-get-new-mail.
[gnus] / texi / gnus.texi
index 89fd97a..a7b2044 100644 (file)
@@ -827,6 +827,7 @@ Various
 * Fuzzy Matching::              What's the big fuzz?
 * Thwarting Email Spam::        Simple ways to avoid unsolicited commercial email.
 * Spam Package::                A package for filtering and processing spam.
+* The Gnus Registry::           A package for tracking messages by Message-ID.
 * Other modes::                 Interaction with other modes.
 * Various Various::             Things that are really various.
 
@@ -4449,7 +4450,9 @@ one of these back ends for using @code{nnmairix}.  Other back ends, like
 If you absolutely must use mbox and still want to use @code{nnmairix},
 you can set up a local @acronym{IMAP} server, which you then access via
 @code{nnimap}.  This is a rather massive setup for accessing some mbox
-files, so just change to MH or Maildir already...
+files, so just change to MH or Maildir already...  However, if you're
+really, really passionate about using mbox, you might want to look into
+the package @file{mairix.el}, which comes with Emacs 23.
 
 @node What nnmairix does
 @subsubsection What nnmairix does
@@ -4471,7 +4474,7 @@ automatically update themselves by calling mairix.
 
 You might ask why you need @code{nnmairix} at all, since mairix already
 creates the group, populates it with links to the mails so that you can
-then access it with Gnus, right? Well, this @emph{might} work, but often
+then access it with Gnus, right?  Well, this @emph{might} work, but often
 does not---at least not without problems.  Most probably you will get
 strange article counts, and sometimes you might see mails which Gnus
 claims have already been canceled and are inaccessible.  This is due to
@@ -4481,21 +4484,22 @@ use mairix with an @acronym{IMAP} server (I had Dovecot complaining
 about corrupt index files when mairix changed the contents of the search
 group).  Using @code{nnmairix} should circumvent these problems.
 
-@code{nnmairix} is not really a mail back end---it's actually more like a
-wrapper, sitting between a ``real'' mail back end where mairix stores the
-searches and the Gnus front end.  You can choose between three different
-mail back ends for the mairix folders: @code{nnml}, @code{nnmaildir} or
-@code{nnimap}.  @code{nnmairix} will call the mairix binary so that the
-search results are stored in folders named
+@code{nnmairix} is not really a mail back end---it's actually more like
+a wrapper, sitting between a ``real'' mail back end where mairix stores
+the searches and the Gnus front end.  You can choose between three
+different mail back ends for the mairix folders: @code{nnml},
+@code{nnmaildir} or @code{nnimap}.  @code{nnmairix} will call the mairix
+binary so that the search results are stored in folders named
 @code{zz_mairix-<NAME>-<NUMBER>} on this mail back end, but it will
-present these folders in the Gnus front end only with @code{<NAME>}.  You
-can use an existing mail back end where you already store your mail, but
-if you're uncomfortable with @code{nnmairix} creating new mail groups
-alongside your other mail, you can also create e.g. a new
-@code{nnmaildir} server exclusively for mairix.  However, a special case
-exists if you want to use mairix remotely on an IMAP server with
-@code{nnimap}---here the mairix folders and your other mail must be on
-the same @code{nnimap} back end.
+present these folders in the Gnus front end only with @code{<NAME>}.
+You can use an existing mail back end where you already store your mail,
+but if you're uncomfortable with @code{nnmairix} creating new mail
+groups alongside your other mail, you can also create e.g. a new
+@code{nnmaildir} or @code{nnml} server exclusively for mairix, but then
+make sure those servers do not accidentally receive your new mail
+(@pxref{nnmairix caveats}).  A special case exists if you want to use
+mairix remotely on an IMAP server with @code{nnimap}---here the mairix
+folders and your other mail must be on the same @code{nnimap} back end.
 
 @node Setting up mairix
 @subsubsection Setting up mairix
@@ -4521,9 +4525,11 @@ mh= ... your nnml/mh folders which should be indexed ...
 mbox = ... your mbox files which should be indexed ...
 @end example
 
-Specify all your maildir/nnml folders and mbox files (relative to the
-base directory!) you want to index with mairix.  See the man-page for
-mairixrc for details.
+This specifies all your mail folders and mbox files (relative to the
+base directory!) you want to index with mairix.  Note that the
+@code{nnml} back end saves mails in MH format, so you have to put those
+directories in the @code{mh} line.  See the example at the end of this
+section and mairixrc's man-page for further details.
 
 @example
 omit=zz_mairix-*
@@ -4591,14 +4597,20 @@ The @strong{name} of the @code{nnmairix} server---choose whatever you
 want.
 
 @item
-The @strong{mail back end} where mairix should stores its
-searches.  Currently @code{nnmaildir}, @code{nnimap} and @code{nnml} are
-supported.  As explained above, for locally stored mails, this can be an
-existing mail back end where you store your mails.  However, you can also
-create e.g. a new @code{nnmaildir} server exclusively for
-@code{nnmairix} in your secondary select methods (@pxref{Finding the
-News}).  If you want to use mairix remotely on an @acronym{IMAP} server,
-you have to choose the corresponding @code{nnimap} back end here.
+The name of the @strong{back end server} where mairix should store its
+searches.  This must be a full server name, like @code{nnml:mymail}.
+Just hit @kbd{TAB} to see the available servers.  Currently, servers
+which are accessed through @code{nnmaildir}, @code{nnimap} and
+@code{nnml} are supported.  As explained above, for locally stored
+mails, this can be an existing server where you store your mails.
+However, you can also create e.g. a new @code{nnmaildir} or @code{nnml}
+server exclusively for @code{nnmairix} in your secondary select methods
+(@pxref{Finding the News}).  If you use a secondary @code{nnml} server
+just for mairix, make sure that you explicitly set the server variable
+@code{nnml-get-new-mail} to @code{nil}, or you might loose mail
+(@pxref{nnmairix caveats}).  If you want to use mairix remotely on an
+@acronym{IMAP} server, you have to choose the corresponding
+@code{nnimap} server here.
 
 @item
 @vindex nnmairix-mairix-search-options
@@ -4788,7 +4800,7 @@ First of: you really need a patched mairix binary for using the marks
 propagation feature efficiently. Otherwise, you would have to update
 the mairix database all the time. You can get the patch at
 
-@uref{http://m61s02.vlinux.de/mairix-maildir-patch.tar}
+@uref{http://www.randomsample.de/mairix-maildir-patch.tar}
 
 You need the mairix v0.21 source code for this patch; everything else
 is explained in the accompanied readme file. If you don't want to use
@@ -4968,8 +4980,20 @@ for turning it off for all groups beginning with @samp{zz_}:
 
 @itemize
 @item
-If you use the Gnus agent (@pxref{Gnus Unplugged}): don't agentize
-@code{nnmairix} groups (though I have no idea what happens if you do).
+You can create a secondary @code{nnml} server just for nnmairix, but then
+you have to explicitly set the corresponding server variable
+@code{nnml-get-new-mail} to @code{nil}.  Otherwise, new mail might get
+put into this secondary server (and would never show up again).  Here's
+an example server definition:
+
+@lisp
+(nnml "mairix" (nnml-directory "mairix") (nnml-get-new-mail nil))
+@end lisp
+
+(The @code{nnmaildir} back end also has a server variabe
+@code{get-new-mail}, but its default value is @code{nil}, so you don't
+have to explicitly set it if you use a @code{nnmaildir} server just for
+mairix.)
 
 @item
 If you use the Gnus registry: don't use the registry with
@@ -4983,6 +5007,10 @@ you check the group for new mail (yes, it has happened to me...).
 Therefore: @emph{Never ever} put ``real'' mails into @code{nnmairix}
 groups (you shouldn't be able to, anyway).
 
+@item
+If you use the Gnus agent (@pxref{Gnus Unplugged}): don't agentize
+@code{nnmairix} groups (though I have no idea what happens if you do).
+
 @item
 mairix does only support us-ascii characters.
 
@@ -8111,11 +8139,13 @@ tickles your fancy.
 
 @findex gnus-article-sort-functions
 @findex gnus-article-sort-by-date
+@findex gnus-article-sort-by-most-recent-date
 @findex gnus-article-sort-by-score
 @findex gnus-article-sort-by-subject
 @findex gnus-article-sort-by-author
 @findex gnus-article-sort-by-random
 @findex gnus-article-sort-by-number
+@findex gnus-article-sort-by-most-recent-number
 If you are using an unthreaded display for some strange reason or
 other, you have to fiddle with the @code{gnus-article-sort-functions}
 variable.  It is very similar to the
@@ -8518,9 +8548,11 @@ Save the current article in a VM folder
 Save the current article in a pipe.  Uhm, like, what I mean is---Pipe
 the current article to a process (@code{gnus-summary-pipe-output}).
 If given a symbolic prefix (@pxref{Symbolic Prefixes}), include the
-complete headers in the piped output.  The
-@code{gnus-summary-pipe-output-default-command} variable can be set to a
-string containing the default command and options (default @code{nil}).
+complete headers in the piped output.  The symbolic prefix @code{r} is
+special; it lets this command pipe a raw article including all headers.
+The @code{gnus-summary-pipe-output-default-command} variable can be set
+to a string containing the default command and options (default
+@code{nil}).
 
 @item O P
 @kindex O P (Summary)
@@ -8619,14 +8651,23 @@ reader to use this setting.
 
 @item gnus-summary-save-in-pipe
 @findex gnus-summary-save-in-pipe
-Pipe the article to a shell command.  This function takes optional one
-argument; if it is a string, it is used as the command; if it is
-@code{nil} or omitted, you will be prompted for the command; if it is
-the symbol @code{default}, the command which the
-@code{gnus-summary-pipe-output-default-command} variable holds or the
-command last used for saving will be used if it is non-@code{nil}.  The
-command should be a string that the shell can interpret (e.g. the
-executable command name and the arguments).
+Pipe the article to a shell command.  This function takes optional two
+arguments COMMAND and RAW.  Valid values for COMMAND include:
+
+@itemize @bullet
+@item a string@*
+The executable command name and possibly arguments.
+@item @code{nil}@*
+You will be prompted for the command in the minibuffer.
+@item the symbol @code{default}@*
+It will be replaced with the command which the variable
+@code{gnus-summary-pipe-output-default-command} holds or the command
+last used for saving.
+@end itemize
+
+Non-@code{nil} value for RAW overrides @code{:decode} and
+@code{:headers} properties (see below) and the raw article including all
+headers will be piped.
 @end table
 
 The symbol of each function may have the following properties:
@@ -10784,6 +10825,12 @@ can't really see why you'd want that.
 @findex gnus-summary-sort-by-number
 Sort by article number (@code{gnus-summary-sort-by-number}).
 
+@item C-c C-s C-m C-n
+@kindex C-c C-s C-n (Summary)
+@findex gnus-summary-sort-by-most-recent-number
+Sort by most recent article number
+(@code{gnus-summary-sort-by-most-recent-number}).
+
 @item C-c C-s C-a
 @kindex C-c C-s C-a (Summary)
 @findex gnus-summary-sort-by-author
@@ -10804,6 +10851,11 @@ Sort by subject (@code{gnus-summary-sort-by-subject}).
 @findex gnus-summary-sort-by-date
 Sort by date (@code{gnus-summary-sort-by-date}).
 
+@item C-c C-s C-m C-d
+@kindex C-c C-s C-m C-d (Summary)
+@findex gnus-summary-sort-by-most-recent-date
+Sort by most recent date (@code{gnus-summary-sort-by-most-recent-date}).
+
 @item C-c C-s C-l
 @kindex C-c C-s C-l (Summary)
 @findex gnus-summary-sort-by-lines
@@ -10838,6 +10890,8 @@ root-by-root basis, which might not be what you were looking for.  To
 toggle whether to use threading, type @kbd{T T} (@pxref{Thread
 Commands}).
 
+If a prefix argument if given, the sort order is reversed.
+
 
 @node Finding the Parent
 @section Finding the Parent
@@ -22709,6 +22763,7 @@ four days, Gnus will decay the scores four times, for instance.
 * Fuzzy Matching::              What's the big fuzz?
 * Thwarting Email Spam::        Simple ways to avoid unsolicited commercial email.
 * Spam Package::                A package for filtering and processing spam.
+* The Gnus Registry::           A package for tracking messages by Message-ID.
 * Other modes::                 Interaction with other modes.
 * Various Various::             Things that are really various.
 @end menu
@@ -24679,17 +24734,9 @@ spam.  And here is the nifty function:
 
 @lisp
 (defun my-gnus-raze-spam ()
-  "Invoke SpamAssassin reporting , then mark it as expirable."
+  "Submit SPAM to Vipul's Razor, then mark it as expirable."
   (interactive)
-  (let ((decode (get 'gnus-summary-save-in-pipe :decode))
-        (headers (get 'gnus-summary-save-in-pipe :headers))
-        (gnus-save-all-headers t))
-    (put 'gnus-summary-save-in-pipe :decode nil)
-    (put 'gnus-summary-save-in-pipe :headers nil)
-    (unwind-protect
-        (gnus-summary-save-in-pipe "spamassassin -r")
-      (put 'gnus-summary-save-in-pipe :decode decode)
-      (put 'gnus-summary-save-in-pipe :headers headers)))
+  (gnus-summary-save-in-pipe "razor-report -f -d" t)
   (gnus-summary-mark-as-expirable 1))
 @end lisp
 
@@ -26479,6 +26526,222 @@ Reduce table size: (spam-stat-reduce-size)
 Save table: (spam-stat-save)
 @end smallexample
 
+@node The Gnus Registry
+@section The Gnus Registry
+@cindex registry
+@cindex split
+@cindex track
+
+The Gnus registry is a package that tracks messages by their
+Message-ID across all backends.  This allows Gnus users to do several
+cool things, be the envy of the locals, get free haircuts, and be
+experts on world issues.  Well, maybe not all of those, but the
+features are pretty cool.
+
+Although they will be explained in detail shortly, here's a quick list
+of said features in case your attention span is...  never mind.
+
+@enumerate
+@item
+Split messages to their parent
+
+This keeps discussions in the same group.  You can use the subject and
+the sender in addition to the Message-ID.  Several strategies are
+available.
+
+@item
+Store custom flags and keywords
+
+The registry can store custom flags and keywords for a message.  For
+instance, you can mark a message ``To-Do'' this way and the flag will
+persist whether the message is in the nnimap, nnml, nnmaildir,
+etc. backends.
+
+@item
+Store arbitrary data
+
+Through a simple ELisp API, the registry can remember any data for a
+message.  A built-in inverse map, when activated, allows quick lookups
+of all messages matching a particular set of criteria.
+@end enumerate
+
+@menu
+* Setup::                       
+* Fancy splitting to parent::   
+* Store custom flags and keywords::  
+* Store arbitrary data::        
+@end menu
+
+@node Setup
+@subsection Setup
+
+Fortunately, setting up the Gnus registry is pretty easy:
+
+@lisp
+(setq gnus-registry-max-entries 2500
+      gnus-registry-use-long-group-names t)
+
+(gnus-registry-initialize)
+@end lisp
+
+This adds registry saves to Gnus newsrc saves (which happen on exit
+and when you press @kbd{s} from the @code{*Group*} buffer.  It also
+adds registry calls to article actions in Gnus (copy, move, etc.)  so
+it's not easy to undo the initialization.  See
+@code{gnus-registry-initialize} for the gory details.
+
+Here are other settings used by the author of the registry (understand
+what they do before you copy them blindly).
+
+@lisp
+(setq
+ gnus-registry-split-strategy 'majority
+ gnus-registry-ignored-groups '(("nntp" t)
+                                ("nnrss" t)
+                                ("spam" t)
+                                ("train" t))
+ gnus-registry-max-entries 500000
+ gnus-registry-use-long-group-names t
+ gnus-registry-track-extra '(sender subject))
+@end lisp
+
+They say: keep a lot of messages around, use long group names, track
+messages by sender and subject (not just parent Message-ID), and when
+the registry splits incoming mail, use a majority rule to decide where
+messages should go if there's more than one possibility.  In addition,
+the registry should ignore messages in groups that match ``nntp'',
+``nnrss'', ``spam'', or ``train.''
+
+You are doubtless impressed by all this, but you ask: ``I am a Gnus
+user, I customize to live.  Give me more.''  Here you go, these are
+the general settings.
+
+@defvar gnus-registry-unfollowed-groups
+The groups that will not be followed by
+@code{gnus-registry-split-fancy-with-parent}.  They will still be
+remembered by the registry.  This is a list of regular expressions.
+@end defvar
+
+@defvar gnus-registry-ignored-groups
+The groups that will not be remembered by the registry.  This is a
+list of regular expressions, also available through Group/Topic
+customization (so you can ignore or keep a specific group or a whole
+topic).
+@end defvar
+
+@defvar gnus-registry-use-long-group-names
+Whether the registry will use long group names.  It's recommended to
+set this to @code{t}, although everything works if you don't.  Future
+functionality will require it.
+@end defvar
+
+@defvar gnus-registry-max-entries
+The number (an integer or @code{nil} for unlimited) of entries the
+registry will keep.
+@end defvar
+
+@defvar gnus-registry-cache-file
+The file where the registry will be stored between Gnus sessions.
+@end defvar
+
+@node Fancy splitting to parent
+@subsection Fancy splitting to parent
+
+Simply put, this lets you put followup e-mail where it belongs.
+
+Every message has a Message-ID, which is unique, and the registry
+remembers it.  When the message is moved or copied, the registry will
+notice this and offer the new group as a choice to the splitting
+strategy.
+
+When a followup is made, usually it mentions the original message's
+Message-ID in the headers.  The registry knows this and uses that
+mention to find the group where the original message lives.  You only
+have to put a rule like this:
+
+@lisp
+(setq nnimap-my-split-fancy '(|
+
+      ;; split to parent: you need this
+      (: gnus-registry-split-fancy-with-parent)
+
+      ;; other rules, as an example
+      (: spam-split)
+      ;; default mailbox
+      "mail")
+@end lisp
+
+in your fancy split setup.  In addition, you may want to customize the
+following variables.
+
+@defvar gnus-registry-track-extra
+This is a list of symbols, so it's best to change it from the
+Customize interface.  By default it's @code{nil}, but you may want to
+track @code{subject} and @code{sender} as well when splitting by parent.
+It may work for you.  It can be annoying if your mail flow is large and
+people don't stick to the same groups.
+@end defvar
+
+@defvar gnus-registry-split-strategy
+This is a symbol, so it's best to change it from the Customize
+interface.  By default it's @code{nil}, but you may want to set it to
+@code{majority} or @code{first} to split by sender or subject based on
+the majority of matches or on the first found.
+@end defvar
+
+@node Store custom flags and keywords
+@subsection Store custom flags and keywords
+
+The registry lets you set custom flags and keywords per message.  You
+can use the Gnus->Registry Marks menu or the @kbd{M M x} keyboard
+shortcuts, where @code{x} is the first letter of the mark's name.
+
+@defvar gnus-registry-marks
+The custom marks that the registry can use.  You can modify the
+default list, if you like.  If you do, you'll have to exit Emacs
+before they take effect (you can also unload the registry and reload
+it or evaluate the specific macros you'll need, but you probably don't
+want to bother).  Use the Customize interface to modify the list.
+
+By default this list has the @code{Important}, @code{Work},
+@code{Personal}, @code{To-Do}, and @code{Later} marks.  They all have
+keyboard shortcuts like @kbd{M M i} for Important, using the first
+letter.
+@end defvar
+
+@defun gnus-registry-mark-article
+Call this function to mark an article with a custom registry mark.  It
+will offer the available marks for completion.
+@end defun
+
+@node Store arbitrary data
+@subsection Store arbitrary data
+
+The registry has a simple API that uses a Message-ID as the key to
+store arbitrary data (as long as it can be converted to a list for
+storage).
+
+@defun gnus-registry-store-extra-entry (id key value)
+Store @code{value} in the extra data key @code{key} for message
+@code{id}.
+@end defun
+
+@defun gnus-registry-delete-extra-entry (id key)
+Delete the extra data key @code{key} for message @code{id}.
+@end defun
+
+@defun gnus-registry-fetch-extra (id key)
+Get the extra data key @code{key} for message @code{id}.
+@end defun
+
+@defvar gnus-registry-extra-entries-precious
+If any extra entries are precious, their presence will make the
+registry keep the whole entry forever, even if there are no groups for
+the Message-ID and if the size limit of the registry is reached.  By
+default this is just @code{(marks)} so the custom registry marks are
+precious.
+@end defvar
+
 @node Other modes
 @section Interaction with other modes