Sometimes, you might wish to delay the sending of a message. For
example, you might wish to arrange for a message to turn up just in time
to remind your about the birthday of your Significant Other. For this,
there is the gnus-delay
package. Setup is simple:
A time span. Consists of an integer and a letter. For example,
42d
means to delay for 42 days. Available letters are m
(minutes), h
(hours), d
(days), w
(weeks), M
(months) and Y
(years).
A specific date. Looks like YYYY-MM-DD
. The message will be
delayed until that day, at a specific time (eight o’clock by default).
See also gnus-delay-default-hour
.
A specific time of day. Given in hh:mm
format, 24h, no am/pm
stuff. The deadline will be at that time today, except if that time has
already passed, then it’s at the given time tomorrow. So if it’s ten
o’clock in the morning and you specify 11:15
, then the deadline
is one hour and fifteen minutes hence. But if you specify 9:20
,
that means a time tomorrow.
The action of the gnus-delay-article
command is influenced by a
couple of variables:
gnus-delay-default-hour
¶
When you specify a specific date, the message will be due on that hour
on the given date. Possible values are integers 0 through 23.
gnus-delay-default-delay
¶
This is a string and gives the default delay. It can be of any of the
formats described above.
gnus-delay-group
¶
Delayed articles will be kept in this group on the drafts server until
they are due. You probably don’t need to change this. The default
value is "delayed"
.
The deadline for each article will be stored in a header. This variable
is a string and gives the header name. You probably don’t need to
change this. The default value is "X-Gnus-Delayed"
.
The way delaying works is like this: when you use the
gnus-delay-article
command, you give a certain delay. Gnus
calculates the deadline of the message and stores it in the
X-Gnus-Delayed
header and puts the message in the
nndraft:delayed
group.
And whenever you get new news, Gnus looks through the group for articles
which are due and sends them. It uses the gnus-delay-send-queue
function for this. By default, this function is added to the hook
gnus-get-new-news-hook
. But of course, you can change this.
Maybe you want to use the demon to send drafts? Just tell the demon to
execute the gnus-delay-send-queue
function.
gnus-delay-initialize
¶
By default, this function installs gnus-delay-send-queue
in
gnus-get-new-news-hook
. But it accepts the optional second
argument no-check
. If it is non-nil
,
gnus-get-new-news-hook
is not changed. The optional first
argument is ignored.
For example, (gnus-delay-initialize nil t)
means to do nothing.
Presumably, you want to use the demon for sending due delayed articles.
Just don’t forget to set that up :-)
When delaying an article with C-c C-j, Message mode will
automatically add a "Date"
header with the current time. In
many cases you probably want the "Date"
header to reflect the
time the message is sent instead. To do this, you have to delete
Date
from message-draft-headers
.
4.7 Marking Articles
There are several marks you can set on an article.
You have marks that decide the readedness (whoo, neato-keano
neologism ohoy!) of the article. Alphabetic marks generally mean
read, while non-alphabetic characters generally mean unread.
In addition, you also have marks that do not affect readedness.
4.7.1 Unread Articles
The following marks mark articles as (kinda) unread, in one form or
other.
- ‘!’ ¶
Marked as ticked (gnus-ticked-mark
).
Ticked articles are articles that will remain visible always. If
you see an article that you find interesting, or you want to put off
reading it, or replying to it, until sometime later, you’d typically
tick it. However, articles can be expired (from news servers by the
news server software, Gnus itself never expires ticked messages), so if
you want to keep an article forever, you’ll have to make it persistent
(see Persistent Articles).
- ‘?’ ¶
Marked as dormant (gnus-dormant-mark
).
Dormant articles will only appear in the summary buffer if there
are followups to it. If you want to see them even if they don’t have
followups, you can use the / D command (see Limiting).
Otherwise (except for the visibility issue), they are just like ticked
messages.
- ‘SPC’ ¶
Marked as unread (gnus-unread-mark
).
Unread articles are articles that haven’t been read at all yet.
4.7.2 Read Articles
All the following marks mark articles as read.
- ‘r’ ¶
These are articles that the user has marked as read with the d
command manually, more or less (gnus-del-mark
).
- ‘R’ ¶
Articles that have actually been read (gnus-read-mark
).
- ‘O’ ¶
Articles that were marked as read in previous sessions and are now
old (gnus-ancient-mark
).
- ‘K’ ¶
Marked as killed (gnus-killed-mark
).
- ‘X’ ¶
Marked as killed by kill files (gnus-kill-file-mark
).
- ‘Y’ ¶
Marked as read by having too low a score (gnus-low-score-mark
).
- ‘C’ ¶
Marked as read by a catchup (gnus-catchup-mark
).
- ‘G’ ¶
Canceled article (gnus-canceled-mark
)
- ‘Q’ ¶
Sparsely reffed article (gnus-sparse-mark
). See Customizing Threading.
- ‘M’ ¶
Article marked as read by duplicate suppression
(gnus-duplicate-mark
). See Duplicate Suppression.
All these marks just mean that the article is marked as read, really.
They are interpreted differently when doing adaptive scoring, though.
One more special mark, though:
- ‘E’ ¶
Marked as expirable (gnus-expirable-mark
).
Marking articles as expirable (or have them marked as such
automatically) doesn’t make much sense in normal groups—a user doesn’t
control expiring of news articles, but in mail groups, for instance,
articles marked as expirable can be deleted by Gnus at
any time.
4.7.3 Other Marks
There are some marks that have nothing to do with whether the article is
read or not.
- You can set a bookmark in the current article. Say you are reading a
long thesis on cats’ urinary tracts, and have to go home for dinner
before you’ve finished reading the thesis. You can then set a bookmark
in the article, and Gnus will jump to this bookmark the next time it
encounters the article. See Setting Marks.
-
All articles that you have replied to or made a followup to (i.e., have
answered) will be marked with an ‘A’ in the second column
(
gnus-replied-mark
).
-
All articles that you have forwarded will be marked with an ‘F’ in
the second column (
gnus-forwarded-mark
).
-
Articles stored in the article cache will be marked with an ‘*’ in
the second column (
gnus-cached-mark
). See Article Caching.
-
Articles “saved” (in some manner or other; not necessarily
religiously) are marked with an ‘S’ in the second column
(
gnus-saved-mark
).
-
Articles that haven’t been seen before in Gnus by the user are marked
with a ‘.’ in the second column (
gnus-unseen-mark
).
-
When using the Gnus agent (see Agent Basics), articles may be
downloaded for unplugged (offline) viewing. If you are using the
‘%O’ spec, these articles get the ‘+’ mark in that spec.
(The variable
gnus-downloaded-mark
controls which character to
use.)
-
When using the Gnus agent (see Agent Basics), some articles might
not have been downloaded. Such articles cannot be viewed while you
are unplugged (offline). If you are using the ‘%O’ spec, these
articles get the ‘-’ mark in that spec. (The variable
gnus-undownloaded-mark
controls which character to use.)
-
The Gnus agent (see Agent Basics) downloads some articles
automatically, but it is also possible to explicitly mark articles for
download, even if they would not be downloaded automatically. Such
explicitly-marked articles get the ‘%’ mark in the first column.
(The variable
gnus-downloadable-mark
controls which character to
use.)
-
If the ‘%e’ spec is used, the presence of threads or not will be
marked with
gnus-not-empty-thread-mark
and
gnus-empty-thread-mark
in the third column, respectively.
-
Finally we have the process mark (
gnus-process-mark
). A
variety of commands react to the presence of the process mark. For
instance, X u (gnus-uu-decode-uu
) will uudecode and view
all articles that have been marked with the process mark. Articles
marked with the process mark have a ‘#’ in the second column.
You might have noticed that most of these “non-readedness” marks
appear in the second column by default. So if you have a cached, saved,
replied article that you have process-marked, what will that look like?
Nothing much. The precedence rules go as follows: process -> cache ->
replied -> saved. So if the article is in the cache and is replied,
you’ll only see the cache mark and not the replied mark.
4.7.4 Setting Marks
All the marking commands understand the numeric prefix.
- M c ¶
- M-u
-
Clear all readedness-marks from the current article
(gnus-summary-clear-mark-forward
). In other words, mark the
article as unread.
- M t ¶
- !
-
Tick the current article (gnus-summary-tick-article-forward
).
See Article Caching.
- M ? ¶
- ?
-
Mark the current article as dormant
(gnus-summary-mark-as-dormant
). See Article Caching.
- M d ¶
- d
-
Mark the current article as read
(gnus-summary-mark-as-read-forward
).
- D ¶
-
Mark the current article as read and move point to the previous line
(gnus-summary-mark-as-read-backward
).
- M k ¶
- k
-
Mark all articles that have the same subject as the current one as read,
and then select the next unread article
(gnus-summary-kill-same-subject-and-select
).
- M K ¶
- C-k
-
Mark all articles that have the same subject as the current one as read
(gnus-summary-kill-same-subject
).
- M C ¶
-
Mark all unread articles as read (gnus-summary-catchup
).
- M C-c ¶
-
Mark all articles in the group as read—even the ticked and dormant
articles (gnus-summary-catchup-all
).
- M H ¶
-
Catchup the current group to point (before the point)
(gnus-summary-catchup-to-here
).
- M h ¶
-
Catchup the current group from point (after the point)
(gnus-summary-catchup-from-here
).
- C-w ¶
-
Mark all articles between point and mark as read
(gnus-summary-mark-region-as-read
).
- M V k ¶
-
Kill all articles with scores below the default score (or below the
numeric prefix) (gnus-summary-kill-below
).
- M e ¶
- E
-
Mark the current article as expirable
(gnus-summary-mark-as-expirable
).
- M b ¶
-
Set a bookmark in the current article
(gnus-summary-set-bookmark
).
- M B ¶
-
Remove the bookmark from the current article
(gnus-summary-remove-bookmark
).
- M V c ¶
-
Clear all marks from articles with scores over the default score (or
over the numeric prefix) (gnus-summary-clear-above
).
- M V u ¶
-
Tick all articles with scores over the default score (or over the
numeric prefix) (gnus-summary-tick-above
).
- M V m ¶
-
Prompt for a mark, and mark all articles with scores over the default
score (or over the numeric prefix) with this mark
(gnus-summary-clear-above
).
The gnus-summary-goto-unread
variable controls what action should
be taken after setting a mark. If non-nil
, point will move to
the next/previous unread article. If nil
, point will just move
one line up or down. As a special case, if this variable is
never
, all the marking commands as well as other commands (like
SPC) will move to the next article, whether it is unread or not.
The default is t
.
4.7.5 Generic Marking Commands
Some people would like the command that ticks an article (!) to
go to the next article. Others would like it to go to the next unread
article. Yet others would like it to stay on the current article.
And even though I haven’t heard of anybody wanting it to go to the
previous (unread) article, I’m sure there are people that want that as
well.
Multiply these five behaviors with five different marking commands, and
you get a potentially complex set of variable to control what each
command should do.
To sidestep that mess, Gnus provides commands that do all these
different things. They can be found on the M M map in the summary
buffer. Type M M C-h to see them all—there are too many of them
to list in this manual.
While you can use these commands directly, most users would prefer
altering the summary mode keymap. For instance, if you would like the
! command to go to the next article instead of the next unread
article, you could say something like:
(add-hook 'gnus-summary-mode-hook 'my-alter-summary-map)
(defun my-alter-summary-map ()
(local-set-key "!" 'gnus-summary-put-mark-as-ticked-next))
or
(defun my-alter-summary-map ()
(local-set-key "!" "MM!n"))
4.7.6 Setting Process Marks
Process marks are displayed as #
in the summary buffer, and are
used for marking articles in such a way that other commands will
process these articles. For instance, if you process mark four
articles and then use the * command, Gnus will enter these four
articles into the cache. For more information,
see Process/Prefix.
- M P p ¶
- #
-
Toggle the process mark for the current article
(gnus-summary-mark-as-processable
).
If gnus-process-mark-toggle
is nil
, set the process mark
for the current article.
- M P u ¶
- M-#
-
Remove the process mark, if any, from the current article
(gnus-summary-unmark-as-processable
).
- M P U ¶
-
Remove the process mark from all articles
(gnus-summary-unmark-all-processable
).
- M P i ¶
-
Invert the list of process marked articles
(gnus-uu-invert-processable
).
- M P R ¶
-
Mark articles that have a Subject
header that matches a regular
expression (gnus-uu-mark-by-regexp
).
- M P G ¶
-
Unmark articles that have a Subject
header that matches a regular
expression (gnus-uu-unmark-by-regexp
).
- M P r ¶
-
Mark articles in region (gnus-uu-mark-region
).
- M P g ¶
-
Unmark articles in region (gnus-uu-unmark-region
).
- M P t ¶
-
Mark all articles in the current (sub)thread
(gnus-uu-mark-thread
).
- M P T ¶
-
Unmark all articles in the current (sub)thread
(gnus-uu-unmark-thread
).
- M P v ¶
-
Mark all articles that have a score above the prefix argument
(gnus-uu-mark-over
).
- M P s ¶
-
Mark all articles in the current series (gnus-uu-mark-series
).
- M P S ¶
-
Mark all series that have already had some articles marked
(gnus-uu-mark-sparse
).
- M P a ¶
-
Mark all articles in series order (gnus-uu-mark-all
).
- M P b ¶
-
Mark all articles in the buffer in the order they appear
(gnus-uu-mark-buffer
).
- M P k ¶
-
Push the current process mark set onto the stack and unmark all articles
(gnus-summary-kill-process-mark
).
- M P y ¶
-
Pop the previous process mark set from the stack and restore it
(gnus-summary-yank-process-mark
).
- M P w ¶
-
Push the current process mark set onto the stack
(gnus-summary-save-process-mark
).
Also see the & command in Searching for Articles, for how to
set process marks based on article body contents.
4.8 Limiting
It can be convenient to limit the summary buffer to just show some
subset of the articles currently in the group. The effect most limit
commands have is to remove a few (or many) articles from the summary
buffer.
Limiting commands work on subsets of the articles already fetched from
the servers. These commands don’t query the server for additional
articles.
- / / ¶
- / s
-
Limit the summary buffer to articles that match some subject
(gnus-summary-limit-to-subject
). If given a prefix, exclude
matching articles.
- / a ¶
-
Limit the summary buffer to articles that match some author
(gnus-summary-limit-to-author
). If given a prefix, exclude
matching articles.
- / R ¶
-
Limit the summary buffer to articles that match some recipient
(gnus-summary-limit-to-recipient
). If given a prefix, exclude
matching articles.
- / A ¶
-
Limit the summary buffer to articles in which contents of From, To or Cc
header match a given address (gnus-summary-limit-to-address
). If
given a prefix, exclude matching articles.
- / S ¶
-
Limit the summary buffer to articles that aren’t part of any displayed
threads (gnus-summary-limit-to-singletons
). If given a prefix,
limit to articles that are part of displayed threads.
- / x ¶
-
Limit the summary buffer to articles that match one of the “extra”
headers (see To From Newsgroups)
(gnus-summary-limit-to-extra
). If given a prefix, exclude
matching articles.
- / u ¶
- x
-
Limit the summary buffer to articles not marked as read
(gnus-summary-limit-to-unread
). If given a prefix, limit the
buffer to articles strictly unread. This means that ticked and
dormant articles will also be excluded.
- / m ¶
-
Ask for a mark and then limit to all articles that have been marked
with that mark (gnus-summary-limit-to-marks
).
- / t ¶
-
Ask for a number and then limit the summary buffer to articles older than (or equal to) that number of days
(gnus-summary-limit-to-age
). If given a prefix, limit to
articles younger than that number of days.
- / n ¶
-
With prefix ‘n’, limit the summary buffer to the next ‘n’
articles. If not given a prefix, use the process marked articles
instead. (gnus-summary-limit-to-articles
).
- / w ¶
-
Pop the previous limit off the stack and restore it
(gnus-summary-pop-limit
). If given a prefix, pop all limits off
the stack.
- / . ¶
-
Limit the summary buffer to the unseen articles
(gnus-summary-limit-to-unseen
).
- / v ¶
-
Limit the summary buffer to articles that have a score at or above some
score (gnus-summary-limit-to-score
). If given a prefix, below
some score.
- / p ¶
-
Limit the summary buffer to articles that satisfy the display
group parameter predicate
(gnus-summary-limit-to-display-predicate
). See Group Parameters, for more on this predicate.
- / r ¶
-
Limit the summary buffer to replied articles
(gnus-summary-limit-to-replied
). If given a prefix, exclude
replied articles.
- / E ¶
- M S
-
Include all expunged articles in the limit
(gnus-summary-limit-include-expunged
).
- / D ¶
-
Include all dormant articles in the limit
(gnus-summary-limit-include-dormant
).
- / * ¶
-
Include all cached articles in the limit
(gnus-summary-limit-include-cached
).
- / d ¶
-
Exclude all dormant articles from the limit
(gnus-summary-limit-exclude-dormant
).
- / M ¶
-
Exclude all marked articles (gnus-summary-limit-exclude-marks
).
- / T ¶
-
Include all the articles in the current thread in the limit.
- / c ¶
-
Exclude all dormant articles that have no children from the limit
(gnus-summary-limit-exclude-childless-dormant
).
- / C ¶
-
Mark all excluded unread articles as read
(gnus-summary-limit-mark-excluded-as-read
). If given a prefix,
also mark excluded ticked and dormant articles as read.
- / b ¶
-
Limit the summary buffer to articles that have bodies that match a
certain regexp (gnus-summary-limit-to-bodies
). If given a
prefix, reverse the limit. This command is quite slow since it
requires selecting each article to find the matches.
- / h ¶
-
Like the previous command, only limit to headers instead
(gnus-summary-limit-to-headers
).
The following commands aren’t limiting commands, but use the /
prefix as well.
- / N ¶
-
Insert all new articles in the summary buffer. It scans for new emails
if back-end-get-new-mail
is non-nil
.
- / o ¶
-
Insert all old articles in the summary buffer. If given a numbered
prefix, fetch this number of articles.
4.9 Threading
Gnus threads articles by default. To thread is to put responses
to articles directly after the articles they respond to—in a
hierarchical fashion.
Threading is done by looking at the References
headers of the
articles. In a perfect world, this would be enough to build pretty
trees, but unfortunately, the References
header is often broken
or simply missing. Weird news propagation exacerbates the problem,
so one has to employ other heuristics to get pleasing results. A
plethora of approaches exists, as detailed in horrible detail in
Customizing Threading.
First, a quick overview of the concepts:
- root
The top-most article in a thread; the first article in the thread.
- thread
A tree-like article structure.
- sub-thread
A small(er) section of this tree-like structure.
- loose threads
Threads often lose their roots due to article expiry, or due to the root
already having been read in a previous session, and not displayed in the
summary buffer. We then typically have many sub-threads that really
belong to one thread, but are without connecting roots. These are
called loose threads.
- thread gathering
An attempt to gather loose threads into bigger threads.
- sparse threads
A thread where the missing articles have been “guessed” at, and are
displayed as empty lines in the summary buffer.
4.9.1 Customizing Threading
4.9.1.1 Loose Threads
gnus-summary-make-false-root
¶
If non-nil
, Gnus will gather all loose subtrees into one big tree
and create a dummy root at the top. (Wait a minute. Root at the top?
Yup.) Loose subtrees occur when the real root has expired, or you’ve
read or killed the root in a previous session.
When there is no real root of a thread, Gnus will have to fudge
something. This variable says what fudging method Gnus should use.
There are four possible values:
adopt
Gnus will make the first of the orphaned articles the parent. This
parent will adopt all the other articles. The adopted articles will be
marked as such by pointy brackets (‘<>’) instead of the standard
square brackets (‘[]’). This is the default method.
dummy
¶
-
Gnus will create a dummy summary line that will pretend to be the
parent. This dummy line does not correspond to any real article, so
selecting it will just select the first real article after the dummy
article. gnus-summary-dummy-line-format
is used to specify the
format of the dummy roots. It accepts only one format spec: ‘S’,
which is the subject of the article. See Formatting Variables.
If you want all threads to have a dummy root, even the non-gathered
ones, set gnus-summary-make-false-root-always
to t
.
empty
Gnus won’t actually make any article the parent, but simply leave the
subject field of all orphans except the first empty. (Actually, it will
use gnus-summary-same-subject
as the subject (see Summary Buffer Format).)
none
Don’t make any article parent at all. Just gather the threads and
display them after one another.
nil
Don’t gather loose threads.
gnus-summary-gather-subject-limit
¶
Loose threads are gathered by comparing subjects of articles. If this
variable is nil
, Gnus requires an exact match between the
subjects of the loose threads before gathering them into one big
super-thread. This might be too strict a requirement, what with the
presence of stupid newsreaders that chop off long subject lines. If
you think so, set this variable to, say, 20 to require that only the
first 20 characters of the subjects have to match. If you set this
variable to a really low number, you’ll find that Gnus will gather
everything in sight into one thread, which isn’t very helpful.
If you set this variable to the special value fuzzy
, Gnus will
use a fuzzy string comparison algorithm on the subjects (see Fuzzy Matching).
gnus-simplify-subject-fuzzy-regexp
¶
This can either be a regular expression or list of regular expressions
that match strings that will be removed from subjects if fuzzy subject
simplification is used.
gnus-simplify-ignored-prefixes
¶
If you set gnus-summary-gather-subject-limit
to something as low
as 10, you might consider setting this variable to something sensible:
(setq gnus-simplify-ignored-prefixes
(concat
"\\`\\[?\\("
(regexp-opt '("looking"
"wanted" "followup" "summary" "summary of"
"help" "query" "problem" "question"
"answer" "reference" "announce"
"How can I" "How to" "Comparison of"
;; ...
))
"\\)\\s *\\("
(regexp-opt '("for" "for reference" "with" "about"))
"\\)?\\]?:?[ \t]*"))
All words that match this regexp will be removed before comparing two
subjects.
gnus-simplify-subject-functions
¶
If non-nil
, this variable overrides
gnus-summary-gather-subject-limit
. This variable should be a
list of functions to apply to the Subject
string iteratively to
arrive at the simplified version of the string.
Useful functions to put in this list include:
gnus-simplify-subject-re
¶
Strip the leading ‘Re:’.
gnus-simplify-subject-fuzzy
¶
Simplify fuzzily.
gnus-simplify-whitespace
¶
Remove excessive whitespace.
gnus-simplify-all-whitespace
¶
Remove all whitespace.
You may also write your own functions, of course.
gnus-summary-gather-exclude-subject
¶
Since loose thread gathering is done on subjects only, that might lead
to many false hits, especially with certain common subjects like
‘’ and ‘(none)’. To make the situation slightly better,
you can use the regexp gnus-summary-gather-exclude-subject
to say
what subjects should be excluded from the gathering process.
The default is ‘^ *$\\|^(none)$’.
gnus-summary-thread-gathering-function
¶
Gnus gathers threads by looking at Subject
headers. This means
that totally unrelated articles may end up in the same “thread”, which
is confusing. An alternate approach is to look at all the
Message-ID
s in all the References
headers to find matches.
This will ensure that no gathered threads ever include unrelated
articles, but it also means that people who have posted with broken
newsreaders won’t be gathered properly. The choice is yours—plague or
cholera:
gnus-gather-threads-by-subject
¶
This function is the default gathering function and looks at
Subject
s exclusively.
gnus-gather-threads-by-references
¶
This function looks at References
headers exclusively.
If you want to test gathering by References
, you could say
something like:
(setq gnus-summary-thread-gathering-function
'gnus-gather-threads-by-references)
4.9.1.2 Filling In Threads
If non-nil
, Gnus will attempt to build old threads by fetching
more old headers—headers to articles marked as read. If you would
like to display as few summary lines as possible, but still connect as
many loose threads as possible, you should set this variable to
some
or a number. If you set it to a number, no more than that
number of extra old headers will be fetched. In either case, fetching
old headers only works if the back end you are using carries overview
files—this would normally be nntp
, nnspool
,
nnml
, and nnmaildir
. Also remember that if the root of
the thread has been expired by the server, there’s not much Gnus can
do about that.
This variable can also be set to invisible
. This won’t have any
visible effects, but is useful if you use the A T command a lot
(see Finding the Parent).
The server has to support NOV for any of this to work.
This feature can seriously impact performance it ignores all locally
cached header entries. Setting it to t
for groups for a server
that doesn’t expire articles (such as news.gmane.org), leads to very
slow summary generation.
Same as gnus-fetch-old-headers
, but only used for ephemeral
newsgroups.
gnus-build-sparse-threads
¶
Fetching old headers can be slow. A low-rent similar effect can be
gotten by setting this variable to some
. Gnus will then look at
the complete References
headers of all articles and try to string
together articles that belong in the same thread. This will leave
gaps in the threading display where Gnus guesses that an article
is missing from the thread. (These gaps appear like normal summary
lines. If you select a gap, Gnus will try to fetch the article in
question.) If this variable is t
, Gnus will display all these
“gaps” without regard for whether they are useful for completing the
thread or not. Finally, if this variable is more
, Gnus won’t cut
off sparse leaf nodes that don’t lead anywhere. This variable is
nil
by default.
This is a rather obscure variable that few will find useful. It’s
intended for those non-news newsgroups where the back end has to fetch
quite a lot to present the summary buffer, and where it’s impossible to
go back to parents of articles. This is mostly the case in the
web-based groups.
If you don’t use those, then it’s safe to leave this as the default
nil
. If you want to use this variable, it should be a regexp
that matches the group name, or t
for all groups.
4.9.1.3 More Threading
gnus-show-threads
¶
If this variable is nil
, no threading will be done, and all of
the rest of the variables here will have no effect. Turning threading
off will speed group selection up a bit, but it is sure to make reading
slower and more awkward.
gnus-thread-hide-subtree
¶
If non-nil
, all threads will be hidden when the summary buffer is
generated.
This can also be a predicate specifier (see Predicate Specifiers).
Available predicates are gnus-article-unread-p
and
gnus-article-unseen-p
.
Here’s an example:
(setq gnus-thread-hide-subtree
'(or gnus-article-unread-p
gnus-article-unseen-p))
(It’s a pretty nonsensical example, since all unseen articles are also
unread, but you get my drift.)
gnus-thread-expunge-below
¶
All threads that have a total score (as defined by
gnus-thread-score-function
) less than this number will be
expunged. This variable is nil
by default, which means that no
threads are expunged.
gnus-thread-hide-killed
¶
if you kill a thread and this variable is non-nil
, the subtree
will be hidden.
gnus-thread-ignore-subject
¶
Sometimes somebody changes the subject in the middle of a thread. If
this variable is non-nil
, which is the default, the subject
change is ignored. If it is nil
, a change in the subject will
result in a new thread.
gnus-thread-indent-level
¶
This is a number that says how much each sub-thread should be indented.
The default is 4.
gnus-sort-gathered-threads-function
¶
Sometimes, particularly with mailing lists, the order in which mails
arrive locally is not necessarily the same as the order in which they
arrived on the mailing list. Consequently, when sorting sub-threads
using the default gnus-thread-sort-by-number
, responses can end
up appearing before the article to which they are responding to.
Setting this variable to an alternate value
(e.g., gnus-thread-sort-by-date
), in a group’s parameters or in an
appropriate hook (e.g., gnus-summary-generate-hook
) can produce a
more logical sub-thread ordering in such instances.
4.9.1.4 Low-Level Threading
Hook run before parsing any headers.
If non-nil
, this function will be called to allow alteration of
article header structures. The function is called with one parameter,
the article header vector, which it may alter in any way. For instance,
if you have a mail-to-news gateway which alters the Message-ID
s
in systematic ways (by adding prefixes and such), you can use this
variable to un-scramble the Message-ID
s so that they are more
meaningful. Here’s one example:
(setq gnus-alter-header-function 'my-alter-message-id)
(defun my-alter-message-id (header)
(let ((id (mail-header-id header)))
(when (string-match
"\\(<[^<>@]*\\)\\.?cygnus\\..*@\\([^<>@]*>\\)" id)
(mail-header-set-id
(concat (match-string 1 id) "@" (match-string 2 id))
header))))
4.9.2 Thread Commands
- T k ¶
- C-M-k
-
Mark all articles in the current (sub-)thread as read
(gnus-summary-kill-thread
). If the prefix argument is positive,
remove all marks instead. If the prefix argument is negative, tick
articles instead.
- T l ¶
- C-M-l
-
Lower the score of the current (sub-)thread
(gnus-summary-lower-thread
).
- T i ¶
-
Increase the score of the current (sub-)thread
(gnus-summary-raise-thread
).
- T # ¶
-
Set the process mark on the current (sub-)thread
(gnus-uu-mark-thread
).
- T M-# ¶
-
Remove the process mark from the current (sub-)thread
(gnus-uu-unmark-thread
).
- T T ¶
-
Toggle threading (gnus-summary-toggle-threads
).
- T s ¶
-
Expose the (sub-)thread hidden under the current article, if any
(gnus-summary-show-thread
).
- T h ¶
-
Hide the current (sub-)thread (gnus-summary-hide-thread
).
- T S ¶
-
Expose all hidden threads (gnus-summary-show-all-threads
).
- T H ¶
-
Hide all threads (gnus-summary-hide-all-threads
).
- T t ¶
-
Re-thread the current article’s thread
(gnus-summary-rethread-current
). This works even when the
summary buffer is otherwise unthreaded.
- T ^ ¶
-
Make the current article the child of the marked (or previous) article
(gnus-summary-reparent-thread
).
- T M-^ ¶
-
Make the current article the parent of the marked articles
(gnus-summary-reparent-children
).
The following commands are thread movement commands. They all
understand the numeric prefix.
- T n ¶
-
- C-M-f
-
- M-DOWN
-
Go to the next thread (gnus-summary-next-thread
).
- T p ¶
-
- C-M-b
-
- M-UP
-
Go to the previous thread (gnus-summary-prev-thread
).
- T d ¶
-
Descend the thread (gnus-summary-down-thread
).
- T u ¶
-
Ascend the thread (gnus-summary-up-thread
).
- T o ¶
-
Go to the top of the thread (gnus-summary-top-thread
).
If you ignore subject while threading, you’ll naturally end up with
threads that have several different subjects in them. If you then issue
a command like T k (gnus-summary-kill-thread
) you might not
wish to kill the entire thread, but just those parts of the thread that
have the same subject as the current article. If you like this idea,
you can fiddle with gnus-thread-operation-ignore-subject
. If it
is non-nil
(which it is by default), subjects will be ignored
when doing thread commands. If this variable is nil
, articles in
the same thread with different subjects will not be included in the
operation in question. If this variable is fuzzy
, only articles
that have subjects fuzzily equal will be included (see Fuzzy Matching).
4.10 Sorting the Summary Buffer
If you are using a threaded summary display, you can sort the threads by
setting gnus-thread-sort-functions
, which can be either a single
function, a list of functions, or a list containing functions and
(not some-function)
elements.
By default, sorting is done on article numbers. Ready-made sorting
predicate functions include gnus-thread-sort-by-number
,
gnus-thread-sort-by-author
, gnus-thread-sort-by-recipient
,
gnus-thread-sort-by-subject
,
gnus-thread-sort-by-date
,
gnus-thread-sort-by-score
,
gnus-thread-sort-by-most-recent-number
,
gnus-thread-sort-by-most-recent-date
,
gnus-thread-sort-by-newsgroups
and
gnus-thread-sort-by-random
and
gnus-thread-sort-by-total-score
.
Each function takes two threads and returns non-nil
if the first
thread should be sorted before the other. Note that sorting really is
normally done by looking only at the roots of each thread. Exceptions
to this rule are gnus-thread-sort-by-most-recent-number
and
gnus-thread-sort-by-most-recent-date
.
If you use more than one function, the primary sort key should be the
last function in the list. You should probably always include
gnus-thread-sort-by-number
in the list of sorting
functions—preferably first. This will ensure that threads that are
equal with respect to the other sort criteria will be displayed in
ascending article order.
If you would like to sort by reverse score, then by subject, and finally
by number, you could do something like:
(setq gnus-thread-sort-functions
'(gnus-thread-sort-by-number
gnus-thread-sort-by-subject
(not gnus-thread-sort-by-total-score)))
The threads that have highest score will be displayed first in the
summary buffer. When threads have the same score, they will be sorted
alphabetically. The threads that have the same score and the same
subject will be sorted by number, which is (normally) the sequence in
which the articles arrived.
If you want to sort by score and then reverse arrival order, you could
say something like:
(setq gnus-thread-sort-functions
'((not gnus-thread-sort-by-number)
gnus-thread-sort-by-score))
By default, threads including their subthreads are sorted according to
the value of gnus-thread-sort-functions
. By customizing
gnus-subthread-sort-functions
you can define a custom sorting
order for subthreads. This allows for example to sort threads from
high score to low score in the summary buffer, but to have subthreads
still sorted chronologically from old to new without taking their
score into account.
The function in the gnus-thread-score-function
variable (default
+
) is used for calculating the total score of a thread. Useful
functions might be max
, min
, or squared means, or whatever
tickles your fancy.
If you are using an unthreaded display for some strange reason or
other, you have to fiddle with the gnus-article-sort-functions
variable. It is very similar to the
gnus-thread-sort-functions
, except that it uses slightly
different functions for article comparison. Available sorting
predicate functions are gnus-article-sort-by-number
,
gnus-article-sort-by-author
,
gnus-article-sort-by-subject
, gnus-article-sort-by-date
,
gnus-article-sort-by-newsgroups
, gnus-article-sort-by-random
,
and gnus-article-sort-by-score
.
If you want to sort an unthreaded summary display by subject, you could
say something like:
(setq gnus-article-sort-functions
'(gnus-article-sort-by-number
gnus-article-sort-by-subject))
You can define group specific sorting via gnus-parameters
,
See Group Parameters.
4.11 Asynchronous Article Fetching
If you read your news from an NNTP server that’s far away, the
network latencies may make reading articles a chore. You have to wait
for a while after pressing n to go to the next article before the
article appears. Why can’t Gnus just go ahead and fetch the article
while you are reading the previous one? Why not, indeed.
First, some caveats. There are some pitfalls to using asynchronous
article fetching, especially the way Gnus does it.
Let’s say you are reading article 1, which is short, and article 2 is
quite long, and you are not interested in reading that. Gnus does not
know this, so it goes ahead and fetches article 2. You decide to read
article 3, but since Gnus is in the process of fetching article 2, the
connection is blocked.
To avoid these situations, Gnus will open two (count ’em two)
connections to the server. Some people may think this isn’t a very nice
thing to do, but I don’t see any real alternatives. Setting up that
extra connection takes some time, so Gnus startup will be slower.
Gnus will fetch more articles than you will read. This will mean that
the link between your machine and the NNTP server will become more
loaded than if you didn’t use article pre-fetch. The server itself will
also become more loaded—both with the extra article requests, and the
extra connection.
Ok, so now you know that you shouldn’t really use this thing… unless
you really want to.
Here’s how: Set gnus-asynchronous
to t
. The rest should
happen automatically.
You can control how many articles are to be pre-fetched by setting
gnus-use-article-prefetch
. This is 30 by default, which means
that when you read an article in the group, the back end will pre-fetch
the next 30 articles. If this variable is t
, the back end will
pre-fetch all the articles it can without bound. If it is
nil
, no pre-fetching will be done.
There are probably some articles that you don’t want to pre-fetch—read
articles, for instance. The gnus-async-prefetch-article-p
variable controls whether an article is to be pre-fetched. This
function should return non-nil
when the article in question is
to be pre-fetched. The default is gnus-async-unread-p
, which
returns nil
on read articles. The function is called with an
article data structure as the only parameter.
If, for instance, you wish to pre-fetch only unread articles shorter
than 100 lines, you could say something like:
(defun my-async-short-unread-p (data)
"Return non-nil for short, unread articles."
(and (gnus-data-unread-p data)
(< (mail-header-lines (gnus-data-header data))
100)))
(setq gnus-async-prefetch-article-p 'my-async-short-unread-p)
These functions will be called many, many times, so they should
preferably be short and sweet to avoid slowing down Gnus too much.
It’s probably a good idea to byte-compile things like this.
After an article has been prefetched, this
gnus-async-post-fetch-function
will be called. The buffer will
be narrowed to the region of the article that was fetched. A useful
value would be gnus-html-prefetch-images
, which will prefetch
and store images referenced in the article, so that you don’t have to
wait for them to be fetched when you read the article. This is useful
for HTML messages that have external images.
Articles have to be removed from the asynch buffer sooner or later. The
gnus-prefetched-article-deletion-strategy
says when to remove
articles. This is a list that may contain the following elements:
read
Remove articles when they are read.
exit
Remove articles when exiting the group.
The default value is (read exit)
.
4.12 Article Caching
If you have an extremely slow NNTP connection, you may
consider turning article caching on. Each article will then be stored
locally under your home directory. As you may surmise, this could
potentially use huge amounts of disk space, as well as eat up all
your inodes so fast it will make your head swim. In vodka.
Used carefully, though, it could be just an easier way to save articles.
To turn caching on, set gnus-use-cache
to t
. By default,
all articles ticked or marked as dormant will then be copied
over to your local cache (gnus-cache-directory
). Whether this
cache is flat or hierarchical is controlled by the
gnus-use-long-file-name
variable, as usual.
When re-selecting a ticked or dormant article, it will be fetched from the
cache instead of from the server. As articles in your cache will never
expire, this might serve as a method of saving articles while still
keeping them where they belong. Just mark all articles you want to save
as dormant, and don’t worry.
When an article is marked as read, is it removed from the cache.
The entering/removal of articles from the cache is controlled by the
gnus-cache-enter-articles
and gnus-cache-remove-articles
variables. Both are lists of symbols. The first is (ticked
dormant)
by default, meaning that ticked and dormant articles will be
put in the cache. The latter is (read)
by default, meaning that
articles marked as read are removed from the cache. Possibly
symbols in these two lists are ticked
, dormant
,
unread
and read
.
So where does the massive article-fetching and storing come into the
picture? The gnus-jog-cache
command will go through all
subscribed newsgroups, request all unread articles, score them, and
store them in the cache. You should only ever, ever ever ever, use this
command if 1) your connection to the NNTP server is really, really,
really slow and 2) you have a really, really, really huge disk.
Seriously. One way to cut down on the number of articles downloaded is
to score unwanted articles down and have them marked as read. They will
not then be downloaded by this command.
It is likely that you do not want caching on all groups. For instance,
if your nnml
mail is located under your home directory, it makes no
sense to cache it somewhere else under your home directory. Unless you
feel that it’s neat to use twice as much space.
To limit the caching, you could set gnus-cacheable-groups
to a
regexp of groups to cache, ‘^nntp’ for instance, or set the
gnus-uncacheable-groups
regexp to ‘^nnml’, for instance.
Both variables are nil
by default. If a group matches both
variables, the group is not cached.
The cache stores information on what articles it contains in its active
file (gnus-cache-active-file
). If this file (or any other parts
of the cache) becomes all messed up for some reason or other, Gnus
offers two functions that will try to set things right. M-x
gnus-cache-generate-nov-databases will (re)build all the NOV
files, and gnus-cache-generate-active will (re)generate the active
file.
gnus-cache-move-cache
will move your whole
gnus-cache-directory
to some other location. You get asked to
where, isn’t that cool?
4.13 Persistent Articles
Closely related to article caching, we have persistent articles.
In fact, it’s just a different way of looking at caching, and much more
useful in my opinion.
Say you’re reading a newsgroup, and you happen on to some valuable gem
that you want to keep and treasure forever. You’d normally just save it
(using one of the many saving commands) in some file. The problem with
that is that it’s just, well, yucky. Ideally you’d prefer just having
the article remain in the group where you found it forever; untouched by
the expiry going on at the news server.
This is what a persistent article is—an article that just won’t
be deleted. It’s implemented using the normal cache functions, but
you use two explicit commands for managing persistent articles:
- * ¶
-
Make the current article persistent (gnus-cache-enter-article
).
- M-* ¶
-
Remove the current article from the persistent articles
(gnus-cache-remove-article
). This will normally delete the
article.
Both these commands understand the process/prefix convention.
To avoid having all ticked articles (and stuff) entered into the cache,
you should set gnus-use-cache
to passive
if you’re just
interested in persistent articles:
(setq gnus-use-cache 'passive)
4.14 Sticky Articles
When you select an article the current article buffer will be reused
according to the value of the variable
gnus-single-article-buffer
. If its value is non-nil
(the
default) all articles reuse the same article buffer. Else each group
has its own article buffer.
This implies that it’s not possible to have more than one article buffer
in a group at a time. But sometimes you might want to display all the
latest emails from your mother, your father, your aunt, your uncle and
your 17 cousins to coordinate the next Christmas party.
That’s where sticky articles come in handy. A sticky article buffer
basically is a normal article buffer, but it won’t be reused when you
select another article. You can make an article sticky with:
- A S ¶
-
Make the current article sticky. If a prefix arg is given, ask for a
name for this sticky article buffer.
To close a sticky article buffer you can use these commands:
- q ¶
-
Puts this sticky article buffer at the end of the list of all buffers.
- k ¶
-
Kills this sticky article buffer.
To kill all sticky article buffers you can use:
- Function: gnus-kill-sticky-article-buffers ARG ¶
Kill all sticky article buffers.
If a prefix ARG is given, ask for confirmation.
4.15 Article Backlog
If you have a slow connection, but the idea of using caching seems
unappealing to you (and it is, really), you can help the situation some
by switching on the backlog. This is where Gnus will buffer
already read articles so that it doesn’t have to re-fetch articles
you’ve already read. This only helps if you are in the habit of
re-selecting articles you’ve recently read, of course. If you never do
that, turning the backlog on will slow Gnus down a little bit, and
increase memory usage some.
If you set gnus-keep-backlog
to a number n, Gnus will store
at most n old articles in a buffer for later re-fetching. If this
variable is non-nil
and is not a number, Gnus will store
all read articles, which means that your Emacs will grow without
bound before exploding and taking your machine down with you. I put
that in there just to keep y’all on your toes.
The default value is 20.
4.16 Saving Articles
Gnus can save articles in a number of ways. Below is the documentation
for saving articles in a fairly straight-forward fashion (i.e., little
processing of the article is done before it is saved). For a different
approach (uudecoding, unsharing) you should use gnus-uu
(see Decoding Articles).
For the commands listed here, the target is a file.
A directory name (ending in ‘/’) causes the target
to be a file under that directory. If you want to
save to a group, see the B c (gnus-summary-copy-article
)
command (see Mail Group Commands).
If gnus-save-all-headers
is non-nil
, Gnus will not delete
unwanted headers before saving the article.
If the preceding variable is nil
, all headers that match the
gnus-saved-headers
regexp will be kept, while the rest will be
deleted before saving.
- O o ¶
- o
-
Save the current article using the default article saver
(gnus-summary-save-article
).
- O m ¶
-
Save the current article in a Unix mail box (mbox) file
(gnus-summary-save-article-mail
).
- O r ¶
-
Save the current article in Rmail format
(gnus-summary-save-article-rmail
). This is mbox since Emacs 23,
Babyl in older versions.
- O f ¶
-
Save the current article in plain file format
(gnus-summary-save-article-file
).
- O F ¶
-
Write the current article in plain file format, overwriting any previous
file contents (gnus-summary-write-article-file
).
- O b ¶
-
Save the current article body in plain file format
(gnus-summary-save-article-body-file
).
- O h ¶
-
Save the current article in mh folder format
(gnus-summary-save-article-folder
).
- O v ¶
-
Save the current article in a VM folder
(gnus-summary-save-article-vm
).
- O p ¶
- |
-
Save the current article in a pipe. Uhm, like, what I mean is—Pipe
the current article to a process (gnus-summary-pipe-output
).
If given a symbolic prefix (see Symbolic Prefixes), include the
complete headers in the piped output. The symbolic prefix r
is
special; it lets this command pipe a raw article including all headers.
The gnus-summary-pipe-output-default-command
variable can be set
to a string containing the default command and options (default
nil
).
- O P ¶
-
Save the current article into muttprint. That is, print it using the
external program Muttprint. The program name and options to use is controlled by the
variable gnus-summary-muttprint-program
.
(gnus-summary-muttprint
).
All these commands use the process/prefix convention
(see Process/Prefix). If you save bunches of articles using these
functions, you might get tired of being prompted for files to save each
and every article in. The prompting action is controlled by
the gnus-prompt-before-saving
variable, which is always
by
default, giving you that excessive prompting action you know and
loathe. If you set this variable to t
instead, you’ll be prompted
just once for each series of articles you save. If you like to really
have Gnus do all your thinking for you, you can even set this variable
to nil
, which means that you will never be prompted for files to
save articles in. Gnus will simply save all the articles in the default
files.
You can customize the gnus-default-article-saver
variable to make
Gnus do what you want it to. You can use any of the eight ready-made
functions below, or you can create your own.
gnus-summary-save-in-rmail
¶
-
This is the default format, that used by the Rmail package. Since Emacs
23, Rmail uses standard mbox format. Before this, it used the
Babyl format. Accordingly, this command writes mbox format since
Emacs 23, unless appending to an existing Babyl file. In older versions
of Emacs, it always uses Babyl format. Uses the function in the
gnus-rmail-save-name
variable to get a file name to save the
article in. The default is gnus-plain-save-name
.
gnus-summary-save-in-mail
¶
-
Save in a Unix mail (mbox) file. Uses the function in the
gnus-mail-save-name
variable to get a file name to save the
article in. The default is gnus-plain-save-name
.
gnus-summary-save-in-file
¶
-
Append the article straight to an ordinary file. Uses the function in
the gnus-file-save-name
variable to get a file name to save the
article in. The default is gnus-numeric-save-name
.
gnus-summary-write-to-file
¶
Write the article straight to an ordinary file. The file is
overwritten if it exists. Uses the function in the
gnus-file-save-name
variable to get a file name to save the
article in. The default is gnus-numeric-save-name
.
gnus-summary-save-body-in-file
¶
Append the article body to an ordinary file. Uses the function in the
gnus-file-save-name
variable to get a file name to save the
article in. The default is gnus-numeric-save-name
.
gnus-summary-write-body-to-file
¶
Write the article body straight to an ordinary file. The file is
overwritten if it exists. Uses the function in the
gnus-file-save-name
variable to get a file name to save the
article in. The default is gnus-numeric-save-name
.
gnus-summary-save-in-folder
¶
-
Save the article to an MH folder using rcvstore
from the MH
library. Uses the function in the gnus-folder-save-name
variable
to get a file name to save the article in. The default is
gnus-folder-save-name
, but you can also use
gnus-Folder-save-name
, which creates capitalized names.
gnus-summary-save-in-vm
¶
Save the article in a VM folder. You have to have the VM mail
reader to use this setting.
gnus-summary-save-in-pipe
¶
Pipe the article to a shell command. This function takes optional two
arguments COMMAND and RAW. Valid values for COMMAND include:
- a string
The executable command name and possibly arguments.
-
nil
You will be prompted for the command in the minibuffer.
- the symbol
default
It will be replaced with the command which the variable
gnus-summary-pipe-output-default-command
holds or the command
last used for saving.
Non-nil
value for RAW overrides :decode
and
:headers
properties (see below) and the raw article including all
headers will be piped.
The symbol of each function may have the following properties:
:decode
The value non-nil
means save decoded articles. This is
meaningful only with gnus-summary-save-in-file
,
gnus-summary-save-body-in-file
,
gnus-summary-write-to-file
,
gnus-summary-write-body-to-file
, and
gnus-summary-save-in-pipe
.
:function
The value specifies an alternative function which appends, not
overwrites, articles to a file. This implies that when saving many
articles at a time, gnus-prompt-before-saving
is bound to
t
and all articles are saved in a single file. This is
meaningful only with gnus-summary-write-to-file
and
gnus-summary-write-body-to-file
.
:headers
The value specifies the symbol of a variable of which the value
specifies headers to be saved. If it is omitted,
gnus-save-all-headers
and gnus-saved-headers
control what
headers should be saved.
All of these functions, except for the last one, will save the article
in the gnus-article-save-directory
, which is initialized from the
SAVEDIR
environment variable. This is ~/News/ by
default.
As you can see above, the functions use different functions to find a
suitable name of a file to save the article in. Below is a list of
available functions that generate names:
gnus-Numeric-save-name
¶
File names like ~/News/Alt.andrea-dworkin/45.
gnus-numeric-save-name
¶
File names like ~/News/alt.andrea-dworkin/45.
gnus-Plain-save-name
¶
File names like ~/News/Alt.andrea-dworkin.
gnus-plain-save-name
¶
File names like ~/News/alt.andrea-dworkin.
gnus-sender-save-name
¶
File names like ~/News/larsi.
You can have Gnus suggest where to save articles by plonking a regexp into
the gnus-split-methods
alist. For instance, if you would like to
save articles related to Gnus in the file gnus-stuff, and articles
related to VM in vm-stuff, you could set this variable to something
like:
(("^Subject:.*gnus\\|^Newsgroups:.*gnus" "gnus-stuff")
("^Subject:.*vm\\|^Xref:.*vm" "vm-stuff")
(my-choosing-function "../other-dir/my-stuff")
((equal gnus-newsgroup-name "mail.misc") "mail-stuff"))
We see that this is a list where each element is a list that has two
elements—the match and the file. The match can either be
a string (in which case it is used as a regexp to match on the article
head); it can be a symbol (which will be called as a function with the
group name as a parameter); or it can be a list (which will be
eval
ed). If any of these actions have a non-nil
result,
the file will be used as a default prompt. In addition, the
result of the operation itself will be used if the function or form
called returns a string or a list of strings.
You basically end up with a list of file names that might be used when
saving the current article. (All “matches” will be used.) You will
then be prompted for what you really want to use as a name, with file
name completion over the results from applying this variable.
This variable is ((gnus-article-archive-name))
by default, which
means that Gnus will look at the articles it saves for an
Archive-name
line and use that as a suggestion for the file
name.
Here’s an example function to clean up file names somewhat. If you have
lots of mail groups called things like
‘nnml:mail.whatever’, you may want to chop off the beginning of
these group names before creating the file name to save to. The
following will do just that:
(defun my-save-name (group)
(when (string-match "^nnml:mail." group)
(substring group (match-end 0))))
(setq gnus-split-methods
'((gnus-article-archive-name)
(my-save-name)))
Finally, you have the gnus-use-long-file-name
variable. If it is
nil
, all the preceding functions will replace all periods
(‘.’) in the group names with slashes (‘/’)—which means that
the functions will generate hierarchies of directories instead of having
all the files in the top level directory
(~/News/alt/andrea-dworkin instead of
~/News/alt.andrea-dworkin.) This variable is t
by default
on most systems. However, for historical reasons, this is nil
on
Xenix and usg-unix-v machines by default.
This function also affects kill and score file names. If this variable
is a list, and the list contains the element not-score
, long file
names will not be used for score files, if it contains the element
not-save
, long file names will not be used for saving, and if it
contains the element not-kill
, long file names will not be used
for kill files.
If you’d like to save articles in a hierarchy that looks something like
a spool, you could
(setq gnus-use-long-file-name '(not-save)) ; to get a hierarchy
(setq gnus-default-article-saver
'gnus-summary-save-in-file) ; no encoding
Then just save with o. You’d then read this hierarchy with
ephemeral nneething
groups—G D in the group buffer, and
the top level directory as the argument (~/News/). Then just walk
around to the groups/directories with nneething
.
4.17 Decoding Articles
Sometime users post articles (or series of articles) that have been
encoded in some way or other. Gnus can decode them for you.
All these functions use the process/prefix convention
(see Process/Prefix) for finding out what articles to work on, with
the extension that a “single article” means “a single series”. Gnus
can find out by itself what articles belong to a series, decode all the
articles and unpack/view/save the resulting file(s).
Gnus guesses what articles are in the series according to the following
simplish rule: The subjects must be (nearly) identical, except for the
last two numbers of the line. (Spaces are largely ignored, however.)
For example: If you choose a subject called ‘cat.gif (2/3)’, Gnus
will find all the articles that match the regexp ‘^cat.gif
([0-9]+/[0-9]+).*$’.
Subjects that are non-standard, like ‘cat.gif (2/3) Part 6 of a
series’, will not be properly recognized by any of the automatic viewing
commands, and you have to mark the articles manually with #.
4.17.1 Uuencoded Articles
- X u ¶
-
Uudecodes the current series (gnus-uu-decode-uu
).
- X U ¶
-
Uudecodes and saves the current series
(gnus-uu-decode-uu-and-save
).
- X v u ¶
-
Uudecodes and views the current series (gnus-uu-decode-uu-view
).
- X v U ¶
-
Uudecodes, views and saves the current series
(gnus-uu-decode-uu-and-save-view
).
Remember that these all react to the presence of articles marked with
the process mark. If, for instance, you’d like to decode and save an
entire newsgroup, you’d typically do M P a
(gnus-uu-mark-all
) and then X U
(gnus-uu-decode-uu-and-save
).
All this is very much different from how gnus-uu
worked with
GNUS 4.1, where you had explicit keystrokes for everything under
the sun. This version of gnus-uu
generally assumes that you mark
articles in some way (see Setting Process Marks) and then press
X u.
Note: When trying to decode articles that have names matching
gnus-uu-notify-files
, which is hard-coded to
‘[Cc][Ii][Nn][Dd][Yy][0-9]+.\\(gif\\|jpg\\)’, gnus-uu
will
automatically post an article on ‘comp.unix.wizards’ saying that
you have just viewed the file in question. This feature can’t be turned
off.
4.17.2 Shell Archives
Shell archives (“shar files”) used to be a popular way to distribute
sources, but it isn’t used all that much today. In any case, we have
some commands to deal with these:
- X s ¶
-
Unshars the current series (gnus-uu-decode-unshar
).
- X S ¶
-
Unshars and saves the current series (gnus-uu-decode-unshar-and-save
).
- X v s ¶
-
Unshars and views the current series (gnus-uu-decode-unshar-view
).
- X v S ¶
-
Unshars, views and saves the current series
(gnus-uu-decode-unshar-and-save-view
).
4.17.3 PostScript Files
- X p ¶
-
Unpack the current PostScript series (gnus-uu-decode-postscript
).
- X P ¶
-
Unpack and save the current PostScript series
(gnus-uu-decode-postscript-and-save
).
- X v p ¶
-
View the current PostScript series
(gnus-uu-decode-postscript-view
).
- X v P ¶
-
View and save the current PostScript series
(gnus-uu-decode-postscript-and-save-view
).
4.17.4 Other Files
- X o ¶
-
Save the current series
(gnus-uu-decode-save
).
- X b ¶
-
Unbinhex the current series (gnus-uu-decode-binhex
). This
doesn’t really work yet.
- X Y ¶
-
yEnc-decode the current series and save it (gnus-uu-decode-yenc
).
4.17.5 Decoding Variables
Adjective, not verb.
4.17.5.1 Rule Variables
Gnus uses rule variables to decide how to view a file. All these
variables are of the form
(list '(regexp1 command2)
'(regexp2 command2)
...)
gnus-uu-user-view-rules
¶
-
This variable is consulted first when viewing files. If you wish to use,
for instance, sox
to convert an .au sound file, you could
say something like:
(setq gnus-uu-user-view-rules
(list '("\\\\.au$" "sox %s -t .aiff > /dev/audio")))
gnus-uu-user-view-rules-end
¶
This variable is consulted if Gnus couldn’t make any matches from the
user and default view rules.
gnus-uu-user-archive-rules
¶
This variable can be used to say what commands should be used to unpack
archives.
4.17.5.2 Other Decode Variables
-
gnus-uu-grabbed-file-functions
All functions in this list will be called right after each file has been
successfully decoded—so that you can move or view files right away,
and don’t have to wait for all files to be decoded before you can do
anything. Ready-made functions you can put in this list are:
gnus-uu-grab-view
¶
View the file.
gnus-uu-grab-move
¶
Move the file (if you’re using a saving function.)
gnus-uu-be-dangerous
¶
Specifies what to do if unusual situations arise during decoding. If
nil
, be as conservative as possible. If t
, ignore things
that didn’t work, and overwrite existing files. Otherwise, ask each
time.
gnus-uu-ignore-files-by-name
¶
Files with name matching this regular expression won’t be viewed.
gnus-uu-ignore-files-by-type
¶
Files with a MIME type matching this variable won’t be viewed.
Note that Gnus tries to guess what type the file is based on the name.
gnus-uu
is not a MIME package (yet), so this is slightly
kludgy.
gnus-uu-tmp-dir
¶
Where gnus-uu
does its work.
gnus-uu-do-not-unpack-archives
¶
Non-nil
means that gnus-uu
won’t peek inside archives
looking for files to display.
gnus-uu-view-and-save
¶
Non-nil
means that the user will always be asked to save a file
after viewing it.
gnus-uu-ignore-default-view-rules
¶
Non-nil
means that gnus-uu
will ignore the default viewing
rules.
gnus-uu-ignore-default-archive-rules
¶
Non-nil
means that gnus-uu
will ignore the default archive
unpacking commands.
gnus-uu-kill-carriage-return
¶
Non-nil
means that gnus-uu
will strip all carriage returns
from articles.
gnus-uu-unmark-articles-not-decoded
¶
Non-nil
means that gnus-uu
will mark unsuccessfully
decoded articles as unread.
gnus-uu-correct-stripped-uucode
¶
Non-nil
means that gnus-uu
will try to fix
uuencoded files that have had trailing spaces deleted.
gnus-uu-pre-uudecode-hook
¶
Hook run before sending a message to uudecode
.
gnus-uu-view-with-metamail
¶
-
Non-nil
means that gnus-uu
will ignore the viewing
commands defined by the rule variables and just fudge a MIME
content type based on the file name. The result will be fed to
metamail
for viewing.
gnus-uu-save-in-digest
¶
Non-nil
means that gnus-uu
, when asked to save without
decoding, will save in digests. If this variable is nil
,
gnus-uu
will just save everything in a file without any
embellishments. The digesting almost conforms to RFC 1153—no easy way
to specify any meaningful volume and issue numbers were found, so I
simply dropped them.
4.17.5.3 Uuencoding and Posting
gnus-uu-post-include-before-composing
¶
Non-nil
means that gnus-uu
will ask for a file to encode
before you compose the article. If this variable is t
, you can
either include an encoded file with C-c C-i or have one included
for you when you post the article.
gnus-uu-post-length
¶
Maximum length of an article. The encoded file will be split into how
many articles it takes to post the entire file.
gnus-uu-post-threaded
¶
Non-nil
means that gnus-uu
will post the encoded file in a
thread. This may not be smart, as no other decoder I have seen is able
to follow threads when collecting uuencoded articles. (Well, I have
seen one package that does that—gnus-uu
, but somehow, I don’t
think that counts…) Default is nil
.
gnus-uu-post-separate-description
¶
Non-nil
means that the description will be posted in a separate
article. The first article will typically be numbered (0/x). If this
variable is nil
, the description the user enters will be included
at the beginning of the first article, which will be numbered (1/x).
Default is t
.
4.17.6 Viewing Files
After decoding, if the file is some sort of archive, Gnus will attempt
to unpack the archive and see if any of the files in the archive can be
viewed. For instance, if you have a gzipped tar file pics.tar.gz
containing the files pic1.jpg and pic2.gif, Gnus will
uncompress and de-tar the main file, and then view the two pictures.
This unpacking process is recursive, so if the archive contains archives
of archives, it’ll all be unpacked.
Finally, Gnus will normally insert a pseudo-article for each
extracted file into the summary buffer. If you go to these
“articles”, you will be prompted for a command to run (usually Gnus
will make a suggestion), and then the command will be run.
If gnus-view-pseudo-asynchronously
is nil
, Emacs will wait
until the viewing is done before proceeding.
If gnus-view-pseudos
is automatic
, Gnus will not insert
the pseudo-articles into the summary buffer, but view them
immediately. If this variable is not-confirm
, the user won’t even
be asked for a confirmation before viewing is done.
If gnus-view-pseudos-separately
is non-nil
, one
pseudo-article will be created for each file to be viewed. If
nil
, all files that use the same viewing command will be given as
a list of parameters to that command.
If gnus-insert-pseudo-articles
is non-nil
, insert
pseudo-articles when decoding. It is t
by default.
So; there you are, reading your pseudo-articles in your
virtual newsgroup from the virtual server; and you think:
Why isn’t anything real anymore? How did we get here?
4.18 Article Treatment
Reading through this huge manual, you may have quite forgotten that the
object of newsreaders is to actually, like, read what people have
written. Reading articles. Unfortunately, people are quite bad at
writing, so there are tons of functions and variables to make reading
these articles easier.
4.18.1 Article Highlighting
Not only do you want your article buffer to look like fruit salad, but
you want it to look like technicolor fruit salad.
- W H a ¶
-
Do much highlighting of the current article
(gnus-article-highlight
). This function highlights header, cited
text, the signature, and adds buttons to the body and the head.
- W H h ¶
-
Highlight the headers (gnus-article-highlight-headers
). The
highlighting will be done according to the gnus-header-face-alist
variable, which is a list where each element has the form
(regexp name content)
.
regexp is a regular expression for matching the
header, name is the face used for highlighting the header name
(see Faces and Fonts) and content is the face for highlighting
the header value. The first match made will be used. Note that
regexp shouldn’t have ‘^’ prepended—Gnus will add one.
- W H c ¶
-
Highlight cited text (gnus-article-highlight-citation
).
Some variables to customize the citation highlights:
-
gnus-cite-parse-max-size
If the article size in bytes is bigger than this variable (which is
25000 by default), no citation highlighting will be performed.
gnus-cite-max-prefix
¶
Maximum possible length for a citation prefix (default 20).
gnus-cite-face-list
¶
List of faces used for highlighting citations (see Faces and Fonts).
When there are citations from multiple articles in the same message,
Gnus will try to give each citation from each article its own face.
This should make it easier to see who wrote what.
gnus-supercite-regexp
¶
Regexp matching normal Supercite attribution lines.
gnus-supercite-secondary-regexp
¶
Regexp matching mangled Supercite attribution lines.
gnus-cite-minimum-match-count
¶
Minimum number of identical prefixes we have to see before we believe
that it’s a citation.
gnus-cite-attribution-prefix
¶
Regexp matching the beginning of an attribution line.
gnus-cite-attribution-suffix
¶
Regexp matching the end of an attribution line.
gnus-cite-attribution-face
¶
Face used for attribution lines. It is merged with the face for the
cited text belonging to the attribution.
gnus-cite-ignore-quoted-from
¶
If non-nil
, no citation highlighting will be performed on lines
beginning with ‘>From ’. Those lines may have been quoted by MTAs
in order not to mix up with the envelope From line. The default value
is t
.
- W H s ¶
-
Highlight the signature (gnus-article-highlight-signature
).
Everything after gnus-signature-separator
(see Article Signature) in an article will be considered a signature and will be
highlighted with gnus-signature-face
, which is italic
by
default.
See Customizing Articles, for how to highlight articles automatically.
4.18.2 Article Fontisizing
People commonly add emphasis to words in news articles by writing things
like ‘_this_’ or ‘*this*’ or ‘/this/’. Gnus can make
this look nicer by running the article through the W e
(gnus-article-emphasize
) command.
How the emphasis is computed is controlled by the
gnus-emphasis-alist
variable. This is an alist where the first
element is a regular expression to be matched. The second is a number
that says what regular expression grouping is used to find the entire
emphasized word. The third is a number that says what regexp grouping
should be displayed and highlighted. (The text between these two
groupings will be hidden.) The fourth is the face used for
highlighting.
(setq gnus-emphasis-alist
'(("_\\(\\w+\\)_" 0 1 gnus-emphasis-underline)
("\\*\\(\\w+\\)\\*" 0 1 gnus-emphasis-bold)))
By default, there are seven rules, and they use the following faces:
gnus-emphasis-bold
, gnus-emphasis-italic
,
gnus-emphasis-underline
, gnus-emphasis-bold-italic
,
gnus-emphasis-underline-italic
,
gnus-emphasis-underline-bold
, and
gnus-emphasis-underline-bold-italic
.
If you want to change these faces, you can either use M-x
customize, or you can use copy-face
. For instance, if you want
to make gnus-emphasis-italic
use a red face instead, you could
say something like:
(copy-face 'red 'gnus-emphasis-italic)
If you want to highlight arbitrary words, you can use the
gnus-group-highlight-words-alist
variable, which uses the same
syntax as gnus-emphasis-alist
. The highlight-words
group
parameter (see Group Parameters) can also be used.
See Customizing Articles, for how to fontize articles automatically.
4.18.3 Article Hiding
Or rather, hiding certain things in each article. There usually is much
too much cruft in most articles.
- W W a ¶
-
Do quite a lot of hiding on the article buffer
(gnus-article-hide). In particular, this function will hide
headers, PGP, cited text and the signature.
- W W h ¶
-
Hide headers (gnus-article-hide-headers
). See Hiding Headers.
- W W b ¶
-
Hide headers that aren’t particularly interesting
(gnus-article-hide-boring-headers
). See Hiding Headers.
- W W s ¶
-
Hide signature (gnus-article-hide-signature
). See Article Signature.
- W W l ¶
-
Strip list identifiers specified in gnus-list-identifiers
. These
are strings some mailing list servers add to the beginning of all
Subject
headers—for example, ‘[zebra 4711]’. Any leading
‘Re: ’ is skipped before stripping. gnus-list-identifiers
may not contain \\(..\\)
.
gnus-list-identifiers
¶
A regular expression that matches list identifiers to be removed from
subject. This can also be a list of regular expressions.
- W W P ¶
-
Hide PEM (privacy enhanced messages) cruft
(gnus-article-hide-pem
).
- W W B ¶
-
Strip the banner specified by the banner
group parameter
(gnus-article-strip-banner
). This is mainly used to hide those
annoying banners and/or signatures that some mailing lists and moderated
groups adds to all the messages. The way to use this function is to add
the banner
group parameter (see Group Parameters) to the
group you want banners stripped from. The parameter either be a string,
which will be interpreted as a regular expression matching text to be
removed, or the symbol signature
, meaning that the (last)
signature should be removed, or other symbol, meaning that the
corresponding regular expression in gnus-article-banner-alist
is
used.
For instance:
(setq gnus-article-banner-alist
((googleGroups .
"^\n*--~--~---------\\(.+\n\\)+")))
Regardless of a group, you can hide things like advertisements only when
the sender of an article has a certain mail address specified in
gnus-article-address-banner-alist
.
gnus-article-address-banner-alist
¶
Alist of mail addresses and banners. Each element has the form
(address . banner)
, where address is a regexp
matching a mail address in the From header, banner is one of a
symbol signature
, an item in gnus-article-banner-alist
,
a regexp and nil
. If address matches author’s mail
address, it will remove things like advertisements. For example, if a
sender has the mail address ‘hail@yoo-hoo.co.jp’ and there is a
banner something like ‘Do You Yoo-hoo!?’ in all articles he
sends, you can use the following element to remove them:
("@yoo-hoo\\.co\\.jp\\'" .
"\n_+\nDo You Yoo-hoo!\\?\n.*\n.*\n")
- W W c ¶
-
Hide citation (gnus-article-hide-citation
). Some variables for
customizing the hiding:
gnus-cited-opened-text-button-line-format
¶
gnus-cited-closed-text-button-line-format
-
Gnus adds buttons to show where the cited text has been hidden, and to
allow toggle hiding the text. The format of the variable is specified
by these format-like variable (see Formatting Variables). These
specs are valid:
- ‘b’
Starting point of the hidden text.
- ‘e’
Ending point of the hidden text.
- ‘l’
Number of characters in the hidden region.
- ‘n’
Number of lines of hidden text.
gnus-cited-lines-visible
¶
The number of lines at the beginning of the cited text to leave
shown. This can also be a cons cell with the number of lines at the top
and bottom of the text, respectively, to remain visible.
- W W C-c ¶
-
Hide citation (gnus-article-hide-citation-maybe
) depending on the
following two variables:
gnus-cite-hide-percentage
¶
If the cited text is of a bigger percentage than this variable (default
50), hide the cited text.
gnus-cite-hide-absolute
¶
The cited text must have at least this length (default 10) before it
is hidden.
- W W C ¶
-
Hide cited text in articles that aren’t roots
(gnus-article-hide-citation-in-followups
). This isn’t very
useful as an interactive command, but might be a handy function to stick
have happen automatically (see Customizing Articles).
All these “hiding” commands are toggles, but if you give a negative
prefix to these commands, they will show what they have previously
hidden. If you give a positive prefix, they will always hide.
Also see Article Highlighting for further variables for
citation customization.
See Customizing Articles, for how to hide article elements
automatically.
4.18.4 Article Washing
We call this “article washing” for a really good reason. Namely, the
A key was taken, so we had to use the W key instead.
Washing is defined by us as “changing something from something to
something else”, but normally results in something looking better.
Cleaner, perhaps.
See Customizing Articles, if you want to change how Gnus displays
articles by default.
- C-u g
This is not really washing, it’s sort of the opposite of washing. If
you type this, you see the article exactly as it exists on disk or on
the server.
- g
Force redisplaying of the current article
(gnus-summary-show-article
). This is also not really washing.
If you type this, you see the article without any previously applied
interactive Washing functions but with all default treatments
(see Customizing Articles).
- W l ¶
-
Remove page breaks from the current article
(gnus-summary-stop-page-breaking
). See Misc Article, for page
delimiters.
- W r ¶
-
Do a Caesar rotate (rot13) on the article buffer
(gnus-summary-caesar-message
).
Unreadable articles that tell you to read them with Caesar rotate or rot13.
(Typically offensive jokes and such.)
It’s commonly called “rot13” because each letter is rotated 13
positions in the alphabet, e.g., ‘B’ (letter #2) -> ‘O’ (letter
#15). It is sometimes referred to as “Caesar rotate” because Caesar
is rumored to have employed this form of, uh, somewhat weak encryption.
- W m ¶
-
Morse decode the article buffer (gnus-summary-morse-message
).
- W i ¶
-
Decode IDNA encoded domain names in the current articles. IDNA
encoded domain names looks like ‘xn--bar’. If a string remain
unencoded after running invoking this, it is likely an invalid IDNA
string (‘xn--bar’ is invalid). You must have GNU Libidn
(https://www.gnu.org/software/libidn/) installed for this command
to work.
- W t
- t ¶
-
Toggle whether to display all headers in the article buffer
(gnus-summary-toggle-header
).
- W v ¶
-
Toggle whether to display all headers in the article buffer permanently
(gnus-summary-verbose-headers
).
- W o ¶
-
Treat overstrike (gnus-article-treat-overstrike
).
- W d ¶
-
Treat “Microsoft smartquotes” according to
gnus-article-smartquotes-map
(gnus-article-treat-smartquotes
). Note that this function guesses
whether a character is a smartquote or not, so it should only be used
interactively.
Smartquotes are Microsoft’s unilateral extension to the character map in
an attempt to provide more quoting characters. If you see something
like \222
or \264
where you’re expecting some kind of
apostrophe or quotation mark, then try this wash.
- W U ¶
-
Translate many non-ASCII characters into their
ASCII equivalents (gnus-article-treat-non-ascii
).
This is mostly useful if you’re on a terminal that has a limited font
and doesn’t show accented characters, “advanced” punctuation, and the
like. For instance, ‘»’ is translated into ‘>>’, and so on.
- W Y f ¶
-
Full deuglify of broken Outlook (Express) articles: Treat
\"smartquotes\", unwrap lines, repair attribution and rearrange
citation (gnus-article-outlook-deuglify-article
).
- W Y u ¶
-
Unwrap lines that appear to be wrapped citation lines. You can control
what lines will be unwrapped by frobbing
gnus-outlook-deuglify-unwrap-min
and
gnus-outlook-deuglify-unwrap-max
, indicating the minimum and
maximum length of an unwrapped citation line.
(gnus-article-outlook-unwrap-lines
).
- W Y a ¶
-
Repair a broken attribution line.
(gnus-article-outlook-repair-attribution
).
- W Y c ¶
-
Repair broken citations by rearranging the text.
(gnus-article-outlook-rearrange-citation
).
- W w ¶
-
Do word wrap (gnus-article-fill-cited-article
).
You can give the command a numerical prefix to specify the width to use
when filling.
- W Q ¶
-
Fill long lines (gnus-article-fill-long-lines
).
You can give the command a numerical prefix to specify the width to use
when filling.
- W C ¶
-
Capitalize the first word in each sentence
(gnus-article-capitalize-sentences
).
- W c ¶
-
Translate CRLF pairs (i.e., ‘^M’s on the end of the lines) into LF
(this takes care of DOS line endings), and then translate any remaining
CRs into LF (this takes care of Mac line endings)
(gnus-article-remove-cr
).
- W q ¶
-
Treat quoted-printable (gnus-article-de-quoted-unreadable
).
Quoted-Printable is one common MIME encoding employed when
sending non-ASCII (i.e., 8-bit) articles. It typically
makes strings like ‘déjà vu’ look like ‘d=E9j=E0 vu’,
which doesn’t look very readable to me. Note that this is usually
done automatically by Gnus if the message in question has a
Content-Transfer-Encoding
header that says that this encoding
has been done. If a prefix is given, a charset will be asked for.
- W 6 ¶
-
Treat base64 (gnus-article-de-base64-unreadable
). Base64 is
one common MIME encoding employed when sending
non-ASCII (i.e., 8-bit) articles. Note that this is
usually done automatically by Gnus if the message in question has a
Content-Transfer-Encoding
header that says that this encoding
has been done. If a prefix is given, a charset will be asked for.
- W Z ¶
-
Treat HZ or HZP (gnus-article-decode-HZ
). HZ (or HZP) is one
common encoding employed when sending Chinese articles. It typically
makes strings look like ‘~{<:Ky2;S{#,NpJ)l6HK!#~}’.
- W A ¶
-
Translate ANSI SGR control sequences into overlays or
extents (gnus-article-treat-ansi-sequences
). ANSI
sequences are used in some Chinese hierarchies for highlighting.
- W u ¶
-
Remove newlines from within URLs. Some mailers insert newlines into
outgoing email messages to keep lines short. This reformatting can
split long URLs onto multiple lines. Repair those URLs by removing
the newlines (gnus-article-unsplit-urls
).
- W h ¶
-
Treat HTML (gnus-article-wash-html
). Note that this is
usually done automatically by Gnus if the message in question has a
Content-Type
header that says that the message is HTML.
If a prefix is given, a charset will be asked for. If it is a number,
the charset defined in gnus-summary-show-article-charset-alist
(see Scrolling the Article) will be used.
The default is to use the function specified by
mm-text-html-renderer
(see Display
Customization in The Emacs MIME Manual) to convert the
HTML. Pre-defined functions you can use include:
shr
Use Gnus simple html renderer.
gnus-w3m
Use Gnus rendered based on w3m.
w3m
Use emacs-w3m.
w3m-standalone
Use w3m.
links
Use CHAP Links.
lynx
Use Lynx.
html2text
Use html2text—a simple HTML converter included with Gnus.
- W D F ¶
-
Toggle proportional fonts for HTML articles. This temporarily
changes the shr-use-fonts
variable in the current article buffer.
- W b ¶
-
Add clickable buttons to the article (gnus-article-add-buttons
).
See Article Buttons.
- W B ¶
-
Add clickable buttons to the article headers
(gnus-article-add-buttons-to-head
).
- W p ¶
-
Verify a signed control message
(gnus-article-verify-x-pgp-sig
). Control messages such as
newgroup
and checkgroups
are usually signed by the
hierarchy maintainer. You need to add the PGP public key of
the maintainer to your keyring to verify the
message.1
- W s ¶
-
Verify a signed (PGP, PGP/MIME or
S/MIME) message
(gnus-summary-force-verify-and-decrypt
). See Security.
- W a ¶
-
Strip headers like the X-No-Archive
header from the beginning of
article bodies (gnus-article-strip-headers-in-body
).
- W E l ¶
-
Remove all blank lines from the beginning of the article
(gnus-article-strip-leading-blank-lines
).
- W E m ¶
-
Replace all blank lines with empty lines and then all multiple empty
lines with a single empty line.
(gnus-article-strip-multiple-blank-lines
).
- W E t ¶
-
Remove all blank lines at the end of the article
(gnus-article-remove-trailing-blank-lines
).
- W E a ¶
-
Do all the three commands above
(gnus-article-strip-blank-lines
).
- W E A ¶
-
Remove all blank lines
(gnus-article-strip-all-blank-lines
).
- W E s ¶
-
Remove all white space from the beginning of all lines of the article
body (gnus-article-strip-leading-space
).
- W E e ¶
-
Remove all white space from the end of all lines of the article
body (gnus-article-strip-trailing-space
).
See Customizing Articles, for how to wash articles automatically.
4.18.5 Article Header
These commands perform various transformations of article header.
- W G u ¶
-
Unfold folded header lines (gnus-article-treat-unfold-headers
).
- W G n ¶
-
Fold the Newsgroups
and Followup-To
headers
(gnus-article-treat-fold-newsgroups
).
- W G f ¶
-
Fold all the message headers
(gnus-article-treat-fold-headers
).
- W E w ¶
-
Remove excessive whitespace from all headers
(gnus-article-remove-leading-whitespace
).
4.18.6 Article Buttons
People often include references to other stuff in articles, and it would
be nice if Gnus could just fetch whatever it is that people talk about
with the minimum of fuzz when you hit RET or use the middle mouse
button on these references.
Gnus adds buttons to certain standard references by default:
Well-formed URLs, mail addresses, Message-IDs, Info links, man pages and
Emacs or Gnus related references. This is controlled by two variables,
one that handles article bodies and one that handles article heads:
gnus-button-alist
¶
This is an alist where each entry has this form:
(regexp button-par use-p function data-par)
- regexp
All text that match this regular expression (case insensitive) will be
considered an external reference. Here’s a typical regexp that matches
embedded URLs: ‘<URL:\\([^\n\r>]*\\)>’. This can also be a
variable containing a regexp, useful variables to use include
gnus-button-url-regexp
and gnus-button-mid-or-mail-regexp
.
- button-par
Gnus has to know which parts of the matches is to be highlighted. This
is a number that says what sub-expression of the regexp is to be
highlighted. If you want it all highlighted, you use 0 here.
- use-p
This form will be eval
ed, and if the result is non-nil
,
this is considered a match. This is useful if you want extra sifting to
avoid false matches. Often variables named
gnus-button-*-level
are used here, See Article button levels, but any other form may be used too.
- function
This function will be called when you click on this button.
- data-par
As with button-par, this is a sub-expression number, but this one
says which part of the match is to be sent as data to function.
So the full entry for buttonizing URLs is then
("<URL:\\([^\n\r>]*\\)>" 0 t gnus-button-url 1)
This is just like the other alist, except that it is applied to the
article head only, and that each entry has an additional element that is
used to say what headers to apply the buttonize coding to:
(header regexp button-par use-p function data-par)
header is a regular expression.
4.18.7 Article button levels
The higher the value of the variables gnus-button-*-level
,
the more buttons will appear. If the level is zero, no corresponding
buttons are displayed. With the default value (which is 5) you should
already see quite a lot of buttons. With higher levels, you will see
more buttons, but you may also get more false positives. To avoid them,
you can set the variables gnus-button-*-level
local to
specific groups (see Group Parameters). Here’s an example for the
variable gnus-parameters
:
;; increase gnus-button-*-level
in some groups:
(setq gnus-parameters
'(("\\<\\(emacs\\|gnus\\)\\>" (gnus-button-emacs-level 10))
("\\<unix\\>" (gnus-button-man-level 10))
("\\<tex\\>" (gnus-button-tex-level 10))))
gnus-button-browse-level
¶
Controls the display of references to message IDs, mail addresses and
news URLs. Related variables and functions include
gnus-button-url-regexp
, browse-url
, and
browse-url-browser-function
.
gnus-button-emacs-level
¶
Controls the display of Emacs or Gnus references. Related functions are
gnus-button-handle-custom
,
gnus-button-handle-describe-function
,
gnus-button-handle-describe-variable
,
gnus-button-handle-symbol
,
gnus-button-handle-describe-key
,
gnus-button-handle-apropos
,
gnus-button-handle-apropos-command
,
gnus-button-handle-apropos-variable
,
gnus-button-handle-apropos-documentation
, and
gnus-button-handle-library
.
gnus-button-man-level
¶
Controls the display of references to (Unix) man pages.
See gnus-button-man-handler
.
gnus-button-message-level
¶
Controls the display of message IDs, mail addresses and news URLs.
Related variables and functions include
gnus-button-mid-or-mail-regexp
,
gnus-button-prefer-mid-or-mail
,
gnus-button-mid-or-mail-heuristic
, and
gnus-button-mid-or-mail-heuristic-alist
.
4.18.8 Article Date
The date is most likely generated in some obscure timezone you’ve never
heard of, so it’s quite nice to be able to find out what the time was
when the article was sent.
- W T u ¶
-
Display the date in UT (aka. GMT, aka ZULU)
(gnus-article-date-ut
).
- W T i ¶
-
Display the date in international format, aka. ISO 8601
(gnus-article-date-iso8601
).
- W T l ¶
-
Display the date in the local timezone (gnus-article-date-local
).
- W T p ¶
-
Display the date in a format that’s easily pronounceable in English
(gnus-article-date-english
).
- W T s ¶
-
Display the date using a user-defined format
(gnus-article-date-user
). The format is specified by the
gnus-article-time-format
variable, and is a string that’s passed
to format-time-string
. See the documentation of that variable
for a list of possible format specs.
- W T e ¶
-
Say how much time has elapsed between the article was posted and now
(gnus-article-date-lapsed
). It looks something like:
Date: 6 weeks, 4 days, 1 hour, 3 minutes, 8 seconds ago
To make this line updated continually, set the
gnus-article-update-date-headers
variable to the frequency in
seconds (the default is nil
).
- W T o ¶
-
Display the original date (gnus-article-date-original
). This can
be useful if you normally use some other conversion function and are
worried that it might be doing something totally wrong. Say, claiming
that the article was posted in 1854. Although something like that is
totally impossible. Don’t you trust me? *titter*
See Customizing Articles, for how to display the date in your
preferred format automatically.
4.18.9 Article Display
These commands add various frivolous display gimmicks to the article
buffer in Emacs versions that support them.
X-Face
headers are small black-and-white images supplied by the
message headers (see X-Face).
Face
headers are small colored images supplied by the message
headers (see Face).
Smileys are those little ‘:-)’ symbols that people like to litter
their messages with (see Smileys).
Picons, on the other hand, reside on your own system, and Gnus will
try to match the headers to what you have (see Picons).
Gravatars reside on-line and are fetched from
https://en.gravatar.com/ (see Gravatars).
All these functions are toggles—if the elements already exist,
they’ll be removed.
- W D x ¶
-
Display an X-Face
in the From
header.
(gnus-article-display-x-face
).
- W D d ¶
-
Display a Face
in the From
header.
(gnus-article-display-face
).
- W D s ¶
-
Display smileys (gnus-treat-smiley
).
- W D f ¶
-
Piconify the From
header (gnus-treat-from-picon
).
- W D m ¶
-
Piconify all mail headers (i.e., Cc
, To
)
(gnus-treat-mail-picon
).
- W D n ¶
-
Piconify all news headers (i.e., Newsgroups
and
Followup-To
) (gnus-treat-newsgroups-picon
).
- W D g ¶
-
Gravatarify the From
header (gnus-treat-from-gravatar
).
- W D h ¶
-
Gravatarify all mail headers (i.e., Cc
, To
)
(gnus-treat-from-gravatar
).
- W D D ¶
-
Remove all images from the article buffer
(gnus-article-remove-images
).
- W D W ¶
-
If you’re reading an HTML article rendered with
gnus-article-html
, then you can insert any blocked images in
the buffer with this command.
(gnus-html-show-images
).
4.18.10 Article Signature
Each article is divided into two parts—the head and the body. The
body can be divided into a signature part and a text part. The variable
that says what is to be considered a signature is
gnus-signature-separator
. This is normally the standard
‘^-- $’ as mandated by RFC 5536. However, many people use
non-standard signature separators, so this variable can also be a list
of regular expressions to be tested, one by one. (Searches are done
from the end of the body towards the beginning.) One likely value is:
(setq gnus-signature-separator
'("^-- $" ; The standard
"^-- *$" ; A common mangling
"^-------*$" ; Many people just use a looong
; line of dashes. Shame!
"^ *--------*$" ; Double-shame!
"^________*$" ; Underscores are also popular
"^========*$")) ; Pervert!
The more permissive you are, the more likely it is that you’ll get false
positives.
gnus-signature-limit
provides a limit to what is considered a
signature when displaying articles.
- If it is an integer, no signature may be longer (in characters) than
that integer.
- If it is a floating point number, no signature may be longer (in lines)
than that number.
- If it is a function, the function will be called without any parameters,
and if it returns
nil
, there is no signature in the buffer.
- If it is a string, it will be used as a regexp. If it matches, the text
in question is not a signature.
This variable can also be a list where the elements may be of the types
listed above. Here’s an example:
(setq gnus-signature-limit
'(200.0 "^---*Forwarded article"))
This means that if there are more than 200 lines after the signature
separator, or the text after the signature separator is matched by
the regular expression ‘^---*Forwarded article’, then it isn’t a
signature after all.
4.18.11 Article Miscellanea
- A t ¶
-
Translate the article from one language to another
(gnus-article-babel
).
4.19 MIME Commands
The following commands all understand the numerical prefix. For
instance, 3 K v means “view the third MIME part”.
- b ¶
- K v
-
View the MIME part.
- K o ¶
Save the MIME part.
- K O ¶
Prompt for a file name, then save the MIME part and strip it
from the article. The stripped MIME object will be referred
via the message/external-body MIME type.
- K r ¶
Replace the MIME part with an external body.
- K d ¶
Delete the MIME part and add some information about the
removed part.
- K c ¶
Copy the MIME part.
- K e ¶
View the MIME part externally.
- K i ¶
View the MIME part internally.
- K | ¶
Pipe the MIME part to an external command.
The rest of these MIME commands do not use the numerical prefix in
the same manner:
- K H ¶
-
View ‘text/html’ parts of the current article with a WWW browser.
Inline images embedded in a message using the cid
scheme, as they
are generally considered to be safe, will be processed properly. The
message header is added to the beginning of every HTML part
unless the prefix argument is given.
Warning: Spammers use links to images (using the http
scheme) in
HTML articles to verify whether you have read the message. As
this command passes the HTML content to the browser without
eliminating these “web bugs” you should only use it for mails from
trusted senders.
This command creates temporary files to pass HTML contents
including images if any to the browser, and deletes them when exiting
the group (if you want).
- K b ¶
Make all the MIME parts have buttons in front of them. This is
mostly useful if you wish to save (or perform other actions) on inlined
parts.
- W M h ¶
-
Display MIME part buttons in the end of the header of an
article (gnus-mime-buttonize-attachments-in-header
). This
command toggles the display. Note that buttons to be added to the
header are only the ones that aren’t inlined in the body. If you want
those buttons always to be displayed, set
gnus-mime-display-attachment-buttons-in-header
to non-nil
.
The default is t
. To change the appearance of buttons, customize
gnus-header-face-alist
.
- K m ¶
-
Some multipart messages are transmitted with missing or faulty headers.
This command will attempt to “repair” these messages so that they can
be viewed in a more pleasant manner
(gnus-summary-repair-multipart
).
- X m ¶
-
Save all parts matching a MIME type to a directory
(gnus-summary-save-parts
). Understands the process/prefix
convention (see Process/Prefix).
- M-t ¶
-
Toggle the buttonized display of the article buffer
(gnus-summary-toggle-display-buttonized
).
- W M w ¶
-
Decode RFC 2047-encoded words in the article headers
(gnus-article-decode-mime-words
).
- W M c ¶
-
Decode encoded article bodies as well as charsets
(gnus-article-decode-charset
).
This command looks in the Content-Type
header to determine the
charset. If there is no such header in the article, you can give it a
prefix, which will prompt for the charset to decode as. In regional
groups where people post using some common encoding (but do not
include MIME headers), you can set the charset
group/topic
parameter to the required charset (see Group Parameters).
- W M v ¶
-
View all the MIME parts in the current article
(gnus-mime-view-all-parts
).
Relevant variables:
gnus-ignored-mime-types
¶
This is a list of regexps. MIME types that match a regexp from
this list will be completely ignored by Gnus. The default value is
nil
.
To have all Vcards be ignored, you’d say something like this:
(setq gnus-ignored-mime-types
'("text/x-vcard"))
gnus-article-loose-mime
¶
If non-nil
, Gnus won’t require the ‘MIME-Version’ header
before interpreting the message as a MIME message. This helps
when reading messages from certain broken mail user agents. The
default is t
.
gnus-article-emulate-mime
¶
-
There are other, non-MIME encoding methods used. The most common
is ‘uuencode’, but yEncode is also getting to be popular. If
this variable is non-nil
, Gnus will look in message bodies to
see if it finds these encodings, and if so, it’ll run them through the
Gnus MIME machinery. The default is t
. Only
single-part yEnc encoded attachments can be decoded. There’s no support
for encoding in Gnus.
gnus-unbuttonized-mime-types
¶
This is a list of regexps. MIME types that match a regexp from
this list won’t have MIME buttons inserted unless they aren’t
displayed or this variable is overridden by
gnus-buttonized-mime-types
. The default value is
(".*/.*")
. This variable is only used when
gnus-inhibit-mime-unbuttonizing
is nil
.
gnus-buttonized-mime-types
¶
This is a list of regexps. MIME types that match a regexp from
this list will have MIME buttons inserted unless they aren’t
displayed. This variable overrides
gnus-unbuttonized-mime-types
. The default value is nil
.
This variable is only used when gnus-inhibit-mime-unbuttonizing
is nil
.
E.g., to see security buttons but no other buttons, you could set this
variable to ("multipart/signed")
and leave
gnus-unbuttonized-mime-types
at the default value.
You could also add "multipart/alternative"
to this list to
display radio buttons that allow you to choose one of two media types
those mails include. See also mm-discouraged-alternatives
(see Display Customization in The
Emacs MIME Manual).
gnus-inhibit-mime-unbuttonizing
¶
If this is non-nil
, then all MIME parts get buttons. The
default value is nil
.
gnus-article-mime-part-function
¶
For each MIME part, this function will be called with the MIME
handle as the parameter. The function is meant to be used to allow
users to gather information from the article (e.g., add Vcard info to
the bbdb database) or to do actions based on parts (e.g., automatically
save all jpegs into some directory).
Here’s an example function the does the latter:
(defun my-save-all-jpeg-parts (handle)
(when (equal (car (mm-handle-type handle)) "image/jpeg")
(with-temp-buffer
(insert (mm-get-part handle))
(write-region (point-min) (point-max)
(read-file-name "Save jpeg to: ")))))
(setq gnus-article-mime-part-function
'my-save-all-jpeg-parts)
gnus-mime-multipart-functions
Alist of MIME multipart types and functions to handle them.
gnus-mime-display-multipart-alternative-as-mixed
Display "multipart/alternative" parts as "multipart/mixed".
gnus-mime-display-multipart-related-as-mixed
Display "multipart/related" parts as "multipart/mixed".
If displaying ‘text/html’ is discouraged, see
mm-discouraged-alternatives
, images or other material inside a
"multipart/related" part might be overlooked when this variable is
nil
. Display Customization in Emacs-Mime Manual.
gnus-mime-display-multipart-as-mixed
Display "multipart" parts as "multipart/mixed". If t
, it
overrides nil
values of
gnus-mime-display-multipart-alternative-as-mixed
and
gnus-mime-display-multipart-related-as-mixed
.
mm-file-name-rewrite-functions
List of functions used for rewriting file names of MIME parts.
Each function takes a file name as input and returns a file name.
Ready-made functions include
mm-file-name-delete-whitespace
,
mm-file-name-trim-whitespace
,
mm-file-name-collapse-whitespace
, and
mm-file-name-replace-whitespace
. The later uses the value of
the variable mm-file-name-replace-whitespace
to replace each
whitespace character in a file name with that string; default value
is "_"
(a single underscore).
The standard functions capitalize
, downcase
,
upcase
, and upcase-initials
may be useful, too.
Everybody knows that whitespace characters in file names are evil,
except those who don’t know. If you receive lots of attachments from
such unenlightened users, you can make live easier by adding
(setq mm-file-name-rewrite-functions
'(mm-file-name-trim-whitespace
mm-file-name-collapse-whitespace
mm-file-name-replace-whitespace))
to your ~/.gnus.el file.
4.20 Charsets
People use different charsets, and we have MIME to let us know what
charsets they use. Or rather, we wish we had. Many people use
newsreaders and mailers that do not understand or use MIME, and
just send out messages without saying what character sets they use. To
help a bit with this, some local news hierarchies have policies that say
what character set is the default. For instance, the ‘fj’
hierarchy uses iso-2022-jp
.
This knowledge is encoded in the gnus-group-charset-alist
variable, which is an alist of regexps (use the first item to match full
group names) and default charsets to be used when reading these groups.
In addition, some people do use soi-disant MIME-aware agents that
aren’t. These blithely mark messages as being in iso-8859-1
even if they really are in koi-8
. To help here, the
gnus-newsgroup-ignored-charsets
variable can be used. The
charsets that are listed here will be ignored. The variable can be
set on a group-by-group basis using the group parameters (see Group Parameters). The default value is (unknown-8bit x-unknown)
,
which includes values some agents insist on having in there.
When posting, gnus-group-posting-charset-alist
is used to
determine which charsets should not be encoded using the MIME
encodings. For instance, some hierarchies discourage using
quoted-printable header encoding.
This variable is an alist of regexps and permitted unencoded charsets
for posting. Each element of the alist has the form (
test
header body-list)
, where:
- test
is either a regular expression matching the newsgroup header or a
variable to query,
- header
is the charset which may be left unencoded in the header (nil
means encode all charsets),
- body-list
is a list of charsets which may be encoded using 8bit content-transfer
encoding in the body, or one of the special values nil
(always
encode using quoted-printable) or t
(always use 8bit).
See Encoding Customization in The Emacs MIME Manual, for additional variables that control which
MIME charsets are used when sending messages.
Other charset tricks that may be useful, although not Gnus-specific:
If there are several MIME charsets that encode the same Emacs
charset, you can choose what charset to use by saying the following:
(put-charset-property 'cyrillic-iso8859-5
'preferred-coding-system 'koi8-r)
This means that Russian will be encoded using koi8-r
instead of
the default iso-8859-5
MIME charset.
If you want to read messages in koi8-u
, you can cheat and say
(define-coding-system-alias 'koi8-u 'koi8-r)
This will almost do the right thing.
And finally, to read charsets like windows-1251
, you can say
something like
(codepage-setup 1251)
(define-coding-system-alias 'windows-1251 'cp1251)
4.21 Article Commands
- A P ¶
-
Generate and print a PostScript image of the article buffer
(gnus-summary-print-article
). gnus-ps-print-hook
will
be run just before printing the buffer. An alternative way to print
article is to use Muttprint (see Saving Articles).
- A C ¶
-
If <backend>-fetch-partial-articles
is non-nil
, Gnus will
fetch partial articles, if the backend it fetches them from supports
it. Currently only nnimap
does. If you’re looking at a
partial article, and want to see the complete article instead, then
the A C command (gnus-summary-show-complete-article
) will
do so.
- w ¶
- A w
-
Scan the article buffer for links, and offer them to the user for
browsing with browse-url
. With a prefix argument, browse with
browse-url-secondary-browser-function
instead.
4.22 Summary Sorting
You can have the summary buffer sorted in various ways, even though I
can’t really see why you’d want that.
- C-c C-s C-n ¶
-
Sort by article number (gnus-summary-sort-by-number
).
- C-c C-s C-m C-n ¶
-
Sort by most recent article number
(gnus-summary-sort-by-most-recent-number
).
- C-c C-s C-a ¶
-
Sort by author (gnus-summary-sort-by-author
).
- C-c C-s C-t ¶
-
Sort by recipient (gnus-summary-sort-by-recipient
).
- C-c C-s C-s ¶
-
Sort by subject (gnus-summary-sort-by-subject
).
- C-c C-s C-d ¶
-
Sort by date (gnus-summary-sort-by-date
).
- C-c C-s C-m C-d ¶
-
Sort by most recent date (gnus-summary-sort-by-most-recent-date
).
- C-c C-s C-l ¶
-
Sort by lines (gnus-summary-sort-by-lines
).
- C-c C-s C-c ¶
-
Sort by article length (gnus-summary-sort-by-chars
).
- C-c C-s C-m C-m ¶
-
Sort by article “readedness” marks (gnus-summary-sort-by-marks
).
- C-c C-s C-i ¶
-
Sort by score (gnus-summary-sort-by-score
).
- C-c C-s C-u ¶
-
Sort by newsgroups (gnus-summary-sort-by-newsgroups
).
- C-c C-s C-x ¶
-
Prompts for extra header to sort by (gnus-summary-sort-by-extra
).
An error will be raised if no sort functions for the header are defined.
- C-c C-s C-r ¶
-
Randomize (gnus-summary-sort-by-random
).
- C-c C-s C-o ¶
-
Sort using the default sorting method
(gnus-summary-sort-by-original
).
These functions will work both when you use threading and when you don’t
use threading. In the latter case, all summary lines will be sorted,
line by line. In the former case, sorting will be done on a
root-by-root basis, which might not be what you were looking for. To
toggle whether to use threading, type T T (see Thread Commands).
If a prefix argument if given, the sort order is reversed.
4.23 Finding the Parent
- ^ ¶
-
If you’d like to read the parent of the current article, and it is not
displayed in the summary buffer, you might still be able to. That is,
if the current group is fetched by NNTP, the parent hasn’t expired
and the References
in the current article are not mangled, you
can just press ^ or A r
(gnus-summary-refer-parent-article
). If everything goes well,
you’ll get the parent. If the parent is already displayed in the
summary buffer, point will just move to this article.
If given a positive numerical prefix, fetch that many articles back into
the ancestry. If given a negative numerical prefix, fetch just that
ancestor. So if you say 3 ^, Gnus will fetch the parent, the
grandparent and the great-grandparent of the current article. If you say
-3 ^, Gnus will only fetch the great-grandparent of the current
article.
- A R (Summary) ¶
-
Fetch all articles mentioned in the References
header of the
article (gnus-summary-refer-references
).
- A T (Summary) ¶
-
Display the full thread where the current article appears
(gnus-summary-refer-thread
). By default this command looks for
articles only in the current group. Some backends (currently only
nnimap
) know how to find articles in the thread directly. In
other cases each header in the current group must be fetched and
examined, so it usually takes a while. If you do it often, you may
consider setting gnus-fetch-old-headers
to invisible
(see Filling In Threads). This won’t have any visible effects
normally, but it’ll make this command work a whole lot faster. Of
course, it’ll make group entry somewhat slow.
If gnus-refer-thread-use-search
is non-nil then those backends
that know how to find threads directly will search not just in the
current group but all groups on the same server.
The gnus-refer-thread-limit
variable says how many old (i.e.,
articles before the first displayed in the current group) headers to
fetch when doing this command. The default is 200. If t
, all
the available headers will be fetched. This variable can be overridden
by giving the A T command a numerical prefix.
In most cases gnus-refer-thread
adds any articles it finds to
the current summary buffer. (When gnus-refer-thread-use-search
is true and the initial referral starts from a summary buffer for a
non-virtual group this may not be possible. In this case a new
summary buffer is created holding a virtual group with the result of
the thread search.) If gnus-refer-thread-limit-to-thread
is
non-nil then the summary buffer will be limited to articles in the
thread.
- M-^ (Summary) ¶
-
You can also ask Gnus for an arbitrary article, no matter what group it
belongs to. M-^ (gnus-summary-refer-article
) will ask you
for a Message-ID
, which is one of those long, hard-to-read
thingies that look something like ‘<38o6up$6f2@hymir.ifi.uio.no>’.
You have to get it all exactly right. No fuzzy searches, I’m afraid.
Gnus looks for the Message-ID
in the headers that have already
been fetched, but also tries all the select methods specified by
gnus-refer-article-method
if it is not found.
If the group you are reading is located on a back end that does not
support fetching by Message-ID
very well (like nnspool
),
you can set gnus-refer-article-method
to an NNTP method. It
would, perhaps, be best if the NNTP server you consult is the one
updating the spool you are reading from, but that’s not really
necessary.
It can also be a list of select methods, as well as the special symbol
current
, which means to use the current select method. If it
is a list, Gnus will try all the methods in the list until it finds a
match.
Here’s an example setting that will first try the current method, and
then ask Google if that fails:
(setq gnus-refer-article-method
'(current
(nnweb "google" (nnweb-type google))))
Most of the mail back ends support fetching by Message-ID
, but
do not do a particularly excellent job at it. That is, nnmbox
,
nnbabyl
, nnmaildir
, nnml
, are able to locate
articles from any groups, while nnfolder
, and nnimap
are
only able to locate articles that have been posted to the current
group. nnmh
does not support this at all.
Fortunately, the special nnregistry
back end is able to locate
articles in any groups, regardless of their back end (see fetching by Message-ID
using the
registry).
4.24 Alternative Approaches
Different people like to read news using different methods. This being
Gnus, we offer a small selection of minor modes for the summary buffers.
4.24.1 Pick and Read
Some newsreaders (like nn
and, uhm, Netnews
on VM/CMS) use
a two-phased reading interface. The user first marks in a summary
buffer the articles she wants to read. Then she starts reading the
articles with just an article buffer displayed.
Gnus provides a summary buffer minor mode that allows
this—gnus-pick-mode
. This basically means that a few process
mark commands become one-keystroke commands to allow easy marking, and
it provides one additional command for switching to the summary buffer.
Here are the available keystrokes when using pick mode:
- . ¶
-
Pick the article or thread on the current line or unpick it if is
already picked (gnus-pick-article-or-thread
). If the variable
gnus-thread-hide-subtree
is true, then this key selects the
entire thread when used at the first article of the thread. Otherwise,
it selects just the article. If given a numerical prefix, go to that
thread or article and pick it. (The line number is normally displayed
at the beginning of the summary pick lines.) If
gnus-process-mark-toggle
is nil
, this key will pick an
article or thread.
- SPC ¶
-
Scroll the summary buffer up one page (gnus-pick-next-page
). If
at the end of the buffer, start reading the picked articles.
- u ¶
-
Unpick the thread or article
(gnus-pick-unmark-article-or-thread
). If the variable
gnus-thread-hide-subtree
is true, then this key unpicks the
thread if used at the first article of the thread. Otherwise it unpicks
just the article. You can give this key a numerical prefix to unpick
the thread or article at that line.
- RET ¶
-
Start reading the picked articles (gnus-pick-start-reading
). If
given a prefix, mark all unpicked articles as read first. If
gnus-pick-display-summary
is non-nil
, the summary buffer
will still be visible when you are reading.
All the normal summary mode commands are still available in the
pick-mode, with the exception of u. However ! is available
which is mapped to the same function
gnus-summary-tick-article-forward
.
If this sounds like a good idea to you, you could say:
(add-hook 'gnus-summary-mode-hook 'gnus-pick-mode)
gnus-pick-mode-hook
is run in pick minor mode buffers.
If gnus-mark-unpicked-articles-as-read
is non-nil
, mark
all unpicked articles as read. The default is nil
.
The summary line format in pick mode is slightly different from the
standard format. At the beginning of each line the line number is
displayed. The pick mode line format is controlled by the
gnus-summary-pick-line-format
variable (see Formatting Variables). It accepts the same format specs that
gnus-summary-line-format
does (see Summary Buffer Lines).
4.24.2 Binary Groups
If you spend much time in binary groups, you may grow tired of hitting
X u, n, RET all the time. M-x gnus-binary-mode
is a minor mode for summary buffers that makes all ordinary Gnus article
selection functions uudecode series of articles and display the result
instead of just displaying the articles the normal way.
The only way, in fact, to see the actual articles is the g
command, when you have turned on this mode
(gnus-binary-show-article
).
gnus-binary-mode-hook
is called in binary minor mode buffers.
4.25 Tree Display
If you don’t like the normal Gnus summary display, you might try setting
gnus-use-trees
to t
. This will create (by default) an
additional tree buffer. You can execute all summary mode commands
in the tree buffer.
There are a few variables to customize the tree display, of course:
gnus-tree-mode-hook
¶
A hook called in all tree mode buffers.
gnus-tree-mode-line-format
¶
A format string for the mode bar in the tree mode buffers (see Mode Line Formatting). The default is ‘Gnus: %%b %S %Z’. For a list
of valid specs, see Summary Buffer Mode Line.
gnus-selected-tree-face
¶
Face used for highlighting the selected article in the tree buffer. The
default is modeline
.
gnus-tree-line-format
¶
A format string for the tree nodes. The name is a bit of a misnomer,
though—it doesn’t define a line, but just the node. The default value
is ‘%(%[%3,3n%]%)’, which displays the first three characters of
the name of the poster. It is vital that all nodes are of the same
length, so you must use ‘%4,4n’-like specifiers.
Valid specs are:
- ‘n’
The name of the poster.
- ‘f’
The From
header.
- ‘N’
The number of the article.
- ‘[’
The opening bracket.
- ‘]’
The closing bracket.
- ‘s’
The subject.
See Formatting Variables.
Variables related to the display are:
gnus-tree-brackets
¶
This is used for differentiating between “real” articles and
“sparse” articles. The format is
((real-open . real-close)
(sparse-open . sparse-close)
(dummy-open . dummy-close))
and the default is ((?[ . ?]) (?( . ?)) (?{ . ?}) (?< . ?>))
.
gnus-tree-parent-child-edges
¶
This is a list that contains the characters used for connecting parent
nodes to their children. The default is (?- ?\\ ?|)
.
gnus-tree-minimize-window
¶
If this variable is non-nil
, Gnus will try to keep the tree
buffer as small as possible to allow more room for the other Gnus
windows. If this variable is a number, the tree buffer will never be
higher than that number. The default is t
. Note that if you
have several windows displayed side-by-side in a frame and the tree
buffer is one of these, minimizing the tree window will also resize all
other windows displayed next to it.
You may also wish to add the following hook to keep the window minimized
at all times:
(add-hook 'gnus-configure-windows-hook
'gnus-tree-perhaps-minimize)
gnus-generate-tree-function
¶
-
The function that actually generates the thread tree. Two predefined
functions are available: gnus-generate-horizontal-tree
and
gnus-generate-vertical-tree
(which is the default).
Here’s an example from a horizontal tree buffer:
{***}-(***)-[odd]-[Gun]
| \[Jan]
| \[odd]-[Eri]
| \(***)-[Eri]
| \[odd]-[Paa]
\[Bjo]
\[Gun]
\[Gun]-[Jor]
Here’s the same thread displayed in a vertical tree buffer:
{***}
|--------------------------\-----\-----\
(***) [Bjo] [Gun] [Gun]
|--\-----\-----\ |
[odd] [Jan] [odd] (***) [Jor]
| | |--\
[Gun] [Eri] [Eri] [odd]
|
[Paa]
If you’re using horizontal trees, it might be nice to display the trees
side-by-side with the summary buffer. You could add something like the
following to your ~/.gnus.el file:
(setq gnus-use-trees t
gnus-generate-tree-function 'gnus-generate-horizontal-tree
gnus-tree-minimize-window nil)
(gnus-add-configuration
'(article
(vertical 1.0
(horizontal 0.25
(summary 0.75 point)
(tree 1.0))
(article 1.0))))
See Window Layout.
4.26 Mail Group Commands
Some commands only make sense in mail groups. If these commands are
invalid in the current group, they will raise a hell and let you know.
All these commands (except the expiry and edit commands) use the
process/prefix convention (see Process/Prefix).
- B e ¶
-
Run all expirable articles in the current group through the expiry
process (gnus-summary-expire-articles
). That is, delete all
expirable articles in the group that have been around for a while.
(see Expiring Mail).
- B C-M-e ¶
-
Delete all the expirable articles in the group
(gnus-summary-expire-articles-now
). This means that all
articles eligible for expiry in the current group will
disappear forever into that big /dev/null in the sky.
- B DEL ¶
-
Delete the mail article. This is “delete” as in “delete it from your
disk forever and ever, never to return again.” Use with caution.
(gnus-summary-delete-article
).
- B m ¶
-
Move the article from one mail group to another
(gnus-summary-move-article
). Marks will be preserved if
gnus-preserve-marks
is non-nil
(which is the default).
- B c ¶
-
Copy the article from one group (mail group or not) to a mail group
(gnus-summary-copy-article
). Marks will be preserved if
gnus-preserve-marks
is non-nil
(which is the default).
- B B ¶
-
Crosspost the current article to some other group
(gnus-summary-crosspost-article
). This will create a new copy of
the article in the other group, and the Xref headers of the article will
be properly updated.
- B i ¶
-
Import an arbitrary file into the current mail newsgroup
(gnus-summary-import-article
). You will be prompted for a file
name, a From
header and a Subject
header.
- B I ¶
-
Create an empty article in the current mail newsgroups
(gnus-summary-create-article
). You will be prompted for a
From
header and a Subject
header.
- B r ¶
-
Respool the mail article (gnus-summary-respool-article
).
gnus-summary-respool-default-method
will be used as the default
select method when respooling. This variable is nil
by default,
which means that the current group select method will be used instead.
Marks will be preserved if gnus-preserve-marks
is non-nil
(which is the default).
- B w ¶
- e
-
Edit the current article (gnus-summary-edit-article
). To finish
editing and make the changes permanent, type C-c C-c
(gnus-summary-edit-article-done
). If you give a prefix to the
C-c C-c command, Gnus won’t re-highlight the article.
- B q ¶
-
If you want to re-spool an article, you might be curious as to what group
the article will end up in before you do the re-spooling. This command
will tell you (gnus-summary-respool-query
).
- B t ¶
-
Similarly, this command will display all fancy splitting patterns used
when respooling, if any (gnus-summary-respool-trace
).
- B p ¶
-
Some people have a tendency to send you “courtesy” copies when they
follow up to articles you have posted. These usually have a
Newsgroups
header in them, but not always. This command
(gnus-summary-article-posted-p
) will try to fetch the current
article from your news server (or rather, from
gnus-refer-article-method
or gnus-select-method
) and will
report back whether it found the article or not. Even if it says that
it didn’t find the article, it may have been posted anyway—mail
propagation is much faster than news propagation, and the news copy may
just not have arrived yet.
- K E ¶
-
Encrypt the body of an article (gnus-article-encrypt-body
).
The body is encrypted with the encryption protocol specified by the
variable gnus-article-encrypt-protocol
.
If you move (or copy) articles regularly, you might wish to have Gnus
suggest where to put the articles. gnus-move-split-methods
is a
variable that uses the same syntax as gnus-split-methods
(see Saving Articles). You may customize that variable to create
suggestions you find reasonable. (Note that
gnus-move-split-methods
uses group names where
gnus-split-methods
uses file names.)
(setq gnus-move-split-methods
'(("^From:.*Lars Magne" "nnml:junk")
("^Subject:.*gnus" "nnfolder:important")
(".*" "nnml:misc")))
4.27 Various Summary Stuff
-
gnus-summary-display-while-building
If non-nil
, show and update the summary buffer as it’s being
built. If t
, update the buffer after every line is inserted.
If the value is an integer, n, update the display every n
lines. The default is nil
.
gnus-summary-display-arrow
If non-nil
, display an arrow in the fringe to indicate the
current article.
gnus-summary-mode-hook
This hook is called when creating a summary mode buffer.
gnus-summary-generate-hook
This is called as the last thing before doing the threading and the
generation of the summary buffer. It’s quite convenient for customizing
the threading variables based on what data the newsgroup has. This hook
is called from the summary buffer after most summary buffer variables
have been set.
gnus-summary-prepare-hook
It is called after the summary buffer has been generated. You might use
it to, for instance, highlight lines or modify the look of the buffer in
some other ungodly manner. I don’t care.
gnus-summary-prepared-hook
A hook called as the very last thing after the summary buffer has been
generated.
gnus-summary-ignore-duplicates
When Gnus discovers two articles that have the same Message-ID
,
it has to do something drastic. No articles are allowed to have the
same Message-ID
, but this may happen when reading mail from some
sources. Gnus allows you to customize what happens with this variable.
If it is nil
(which is the default), Gnus will rename the
Message-ID
(for display purposes only) and display the article as
any other article. If this variable is t
, it won’t display the
article—it’ll be as if it never existed.
gnus-alter-articles-to-read-function
This function, which takes two parameters (the group name and the list
of articles to be selected), is called to allow the user to alter the
list of articles to be selected.
For instance, the following function adds the list of cached articles to
the list in one particular group:
(defun my-add-cached-articles (group articles)
(if (string= group "some.group")
(append gnus-newsgroup-cached articles)
articles))
gnus-newsgroup-variables
A list of newsgroup (summary buffer) local variables, or cons of
variables and their default expressions to be evalled (when the default
values are not nil
), that should be made global while the summary
buffer is active.
Note: The default expressions will be evaluated (using function
eval
) before assignment to the local variable rather than just
assigned to it. If the default expression is the symbol global
,
that symbol will not be evaluated but the global value of the local
variable will be used instead.
These variables can be used to set variables in the group parameters
while still allowing them to affect operations done in other
buffers. For example:
(setq gnus-newsgroup-variables
'(message-use-followup-to
(gnus-visible-headers .
"^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^To:")))
Also see Group Parameters.
4.27.2 Searching for Articles
- M-s M-s ¶
-
Search through all subsequent (raw) articles for a regexp
(gnus-summary-search-article-forward
).
- M-s M-r ¶
-
Search through all previous (raw) articles for a regexp
(gnus-summary-search-article-backward
).
- M-S ¶
-
Repeat the previous search forwards
(gnus-summary-repeat-search-article-forward
).
- M-R ¶
-
Repeat the previous search backwards
(gnus-summary-repeat-search-article-backward
).
- & ¶
-
This command will prompt you for a header, a regular expression to match
on this field, and a command to be executed if the match is made
(gnus-summary-execute-command
). If the header is an empty
string, the match is done on the entire article. If given a prefix,
search backward instead.
For instance, & RET some.*string RET # will put the
process mark on all articles that have heads or bodies that match
‘some.*string’.
- M-& ¶
-
Perform any operation on all articles that have been marked with
the process mark (gnus-summary-universal-argument
).
4.27.3 Summary Generation Commands
- Y g ¶
-
Regenerate the current summary buffer (gnus-summary-prepare
).
- Y c ¶
-
Pull all cached articles (for the current group) into the summary buffer
(gnus-summary-insert-cached-articles
).
- Y d ¶
-
Pull all dormant articles (for the current group) into the summary buffer
(gnus-summary-insert-dormant-articles
).
- Y t ¶
-
Pull all ticked articles (for the current group) into the summary buffer
(gnus-summary-insert-ticked-articles
).
4.27.4 Really Various Summary Commands
- A D ¶
- C-d
-
If the current article is a collection of other articles (for instance,
a digest), you might use this command to enter a group based on that
article (gnus-summary-enter-digest-group
). Gnus will try to
guess what article type is currently displayed unless you give a prefix
to this command, which forces a “digest” interpretation. Basically,
whenever you see a message that is a collection of other messages of
some format, you C-d and read these messages in a more convenient
fashion.
The variable gnus-auto-select-on-ephemeral-exit
controls what
article should be selected after exiting a digest group. Valid values
include:
next
Select the next article.
next-unread
Select the next unread article.
next-noselect
Move the cursor to the next article. This is the default.
next-unread-noselect
Move the cursor to the next unread article.
If it has any other value or there is no next (unread) article, the
article selected before entering to the digest group will appear.
- C-M-d ¶
-
This command is very similar to the one above, but lets you gather
several documents into one biiig group
(gnus-summary-read-document
). It does this by opening several
nndoc
groups for each document, and then opening an
nnvirtual
group on top of these nndoc
groups. This
command understands the process/prefix convention
(see Process/Prefix).
- C-t ¶
-
Toggle truncation of summary lines
(gnus-summary-toggle-truncation
). This will probably confuse the
line centering function in the summary buffer, so it’s not a good idea
to have truncation switched off while reading articles.
- = ¶
-
Expand the summary buffer window (gnus-summary-expand-window
).
If given a prefix, force an article
window configuration.
- C-M-e ¶
-
Edit the group parameters (see Group Parameters) of the current
group (gnus-summary-edit-parameters
).
- C-M-a ¶
-
Customize the group parameters (see Group Parameters) of the current
group (gnus-summary-customize-parameters
).
4.28 Exiting the Summary Buffer
Exiting from the summary buffer will normally update all info on the
group and return you to the group buffer.
- Z Z ¶
- Z Q
- q
-
Exit the current group and update all information on the group
(gnus-summary-exit
). gnus-summary-prepare-exit-hook
is
called before doing much of the exiting, which calls
gnus-summary-expire-articles
by default.
gnus-summary-exit-hook
is called after finishing the exit
process. gnus-group-no-more-groups-hook
is run when returning to
group mode having no more (unread) groups.
- Z E ¶
- Q
-
Exit the current group without updating any information on the group
(gnus-summary-exit-no-update
).
- Z c ¶
- c
-
Mark all unticked articles in the group as read and then exit
(gnus-summary-catchup-and-exit
).
- Z C ¶
-
Mark all articles, even the ticked ones, as read and then exit
(gnus-summary-catchup-all-and-exit
).
- Z n ¶
-
Mark all articles as read and go to the next group
(gnus-summary-catchup-and-goto-next-group
).
- Z p ¶
-
Mark all articles as read and go to the previous group
(gnus-summary-catchup-and-goto-prev-group
).
- Z R ¶
- C-x C-s
-
Exit this group, and then enter it again
(gnus-summary-reselect-current-group
). If given a prefix, select
all articles, both read and unread.
- Z G ¶
- M-g
-
Exit the group, check for new articles in the group, and select the
group (gnus-summary-rescan-group
). If given a prefix, select all
articles, both read and unread.
- Z N ¶
-
Exit the group and go to the next group
(gnus-summary-next-group
).
- Z P ¶
-
Exit the group and go to the previous group
(gnus-summary-prev-group
).
- Z s ¶
-
Save the current number of read/marked articles in the dribble buffer
and then save the dribble buffer (gnus-summary-save-newsrc
). If
given a prefix, also save the .newsrc file(s). Using this
command will make exit without updating (the Q command) worthless.
gnus-exit-group-hook
is called when you exit the current group
with an “updating” exit. For instance Q
(gnus-summary-exit-no-update
) does not call this hook.
If you’re in the habit of exiting groups, and then changing your mind
about it, you might set gnus-kill-summary-on-exit
to nil
.
If you do that, Gnus won’t kill the summary buffer when you exit it.
(Quelle surprise!) Instead it will change the name of the buffer to
something like *Dead Summary ... * and install a minor mode
called gnus-dead-summary-mode
. Now, if you switch back to this
buffer, you’ll find that all keys are mapped to a function called
gnus-summary-wake-up-the-dead
. So tapping any keys in a dead
summary buffer will result in a live, normal summary buffer.
There will never be more than one dead summary buffer at any one time.
The data on the current group will be updated (which articles you have
read, which articles you have replied to, etc.) when you exit the
summary buffer. If the gnus-use-cross-reference
variable is
t
(which is the default), articles that are cross-referenced to
this group and are marked as read, will also be marked as read in the
other subscribed groups they were cross-posted to. If this variable is
neither nil
nor t
, the article will be marked as read in
both subscribed and unsubscribed groups (see Crosspost Handling).
4.29 Crosspost Handling
Marking cross-posted articles as read ensures that you’ll never have to
read the same article more than once. Unless, of course, somebody has
posted it to several groups separately. Posting the same article to
several groups (not cross-posting) is called spamming, and you are
by law required to send nasty-grams to anyone who perpetrates such a
heinous crime.
Remember: Cross-posting is kinda ok, but posting the same article
separately to several groups is not. Massive cross-posting (aka.
velveeta) is to be avoided at all costs, and you can even use the
gnus-summary-mail-crosspost-complaint
command to complain about
excessive crossposting (see Summary Mail Commands).
One thing that may cause Gnus to not do the cross-posting thing
correctly is if you use an NNTP server that supports XOVER
(which is very nice, because it speeds things up considerably) which
does not include the Xref
header in its NOV lines. This is
Evil, but all too common, alas, alack. Gnus tries to Do The Right Thing
even with XOVER by registering the Xref
lines of all
articles you actually read, but if you kill the articles, or just mark
them as read without reading them, Gnus will not get a chance to snoop
the Xref
lines out of these articles, and will be unable to use
the cross reference mechanism.
To check whether your NNTP server includes the Xref
header
in its overview files, try ‘telnet your.nntp.server nntp’,
‘MODE READER’ on inn
servers, and then say ‘LIST
overview.fmt’. This may not work, but if it does, and the last line you
get does not read ‘Xref:full’, then you should shout and whine at
your news admin until she includes the Xref
header in the
overview files.
If you want Gnus to get the Xref
s right all the time, you have to
set nntp-nov-is-evil
to t
, which slows things down
considerably. Also see Slow/Expensive Connection.
C’est la vie.
For an alternative approach, see Duplicate Suppression.
4.30 Duplicate Suppression
By default, Gnus tries to make sure that you don’t have to read the same
article more than once by utilizing the crossposting mechanism
(see Crosspost Handling). However, that simple and efficient
approach may not work satisfactory for some users for various
reasons.
- The NNTP server may fail to generate the
Xref
header. This
is evil and not very common.
- The NNTP server may fail to include the
Xref
header in the
.overview data bases. This is evil and all too common, alas.
- You may be reading the same group (or several related groups) from
different NNTP servers.
- You may be getting mail that duplicates articles posted to groups.
I’m sure there are other situations where Xref
handling fails as
well, but these four are the most common situations.
If, and only if, Xref
handling fails for you, then you may
consider switching on duplicate suppression. If you do so, Gnus
will remember the Message-ID
s of all articles you have read or
otherwise marked as read, and then, as if by magic, mark them as read
all subsequent times you see them—in all groups. Using this
mechanism is quite likely to be somewhat inefficient, but not overly
so. It’s certainly preferable to reading the same articles more than
once.
Duplicate suppression is not a very subtle instrument. It’s more like a
sledge hammer than anything else. It works in a very simple
fashion—if you have marked an article as read, it adds this Message-ID
to a cache. The next time it sees this Message-ID, it will mark the
article as read with the ‘M’ mark. It doesn’t care what group it
saw the article in.
gnus-suppress-duplicates
¶
If non-nil
, suppress duplicates.
gnus-save-duplicate-list
¶
If non-nil
, save the list of duplicates to a file. This will
make startup and shutdown take longer, so the default is nil
.
However, this means that only duplicate articles read in a single Gnus
session are suppressed.
gnus-duplicate-list-length
¶
This variable says how many Message-ID
s to keep in the duplicate
suppression list. The default is 10000.
gnus-duplicate-file
¶
The name of the file to store the duplicate suppression list in. The
default is ~/News/suppression.
If you have a tendency to stop and start Gnus often, setting
gnus-save-duplicate-list
to t
is probably a good idea. If
you leave Gnus running for weeks on end, you may have it nil
. On
the other hand, saving the list makes startup and shutdown much slower,
so that means that if you stop and start Gnus often, you should set
gnus-save-duplicate-list
to nil
. Uhm. I’ll leave this up
to you to figure out, I think.
4.31 Security
Gnus is able to verify signed messages or decrypt encrypted messages.
The formats that are supported are PGP, PGP/MIME
and S/MIME, however you need some external programs to get
things to work:
- To handle PGP and PGP/MIME messages, you have to
install an OpenPGP implementation such as GnuPG. The Lisp interface
to GnuPG included with Emacs is called EasyPG (see EasyPG in EasyPG Assistant user’s manual), but PGG (see PGG in PGG Manual), and Mailcrypt are also supported.
- To handle S/MIME message, you need to install OpenSSL. OpenSSL 0.9.6
or newer is recommended.
The variables that control security functionality on reading/composing
messages include:
mm-verify-option
¶
Option of verifying signed parts. never
, not verify;
always
, always verify; known
, only verify known
protocols. Otherwise, ask user.
mm-decrypt-option
¶
Option of decrypting encrypted parts. never
, no decryption;
always
, always decrypt; known
, only decrypt known
protocols. Otherwise, ask user.
mm-sign-option
¶
Option of creating signed parts. nil
, use default signing
keys; guided
, ask user to select signing keys from the menu.
mm-encrypt-option
¶
Option of creating encrypted parts. nil
, use the first
public-key matching the ‘From:’ header as the recipient;
guided
, ask user to select recipient keys from the menu.
mml1991-use
¶
Symbol indicating elisp interface to OpenPGP implementation for
PGP messages. The default is epg
, but pgg
,
and mailcrypt
are also supported although
deprecated. By default, Gnus uses the first available interface in
this order.
mml2015-use
¶
Symbol indicating elisp interface to OpenPGP implementation for
PGP/MIME messages. The default is epg
, but
pgg
, and mailcrypt
are also supported
although deprecated. By default, Gnus uses the first available
interface in this order.
By default the buttons that display security information are not
shown, because they clutter reading the actual e-mail. You can type
K b manually to display the information. Use the
gnus-buttonized-mime-types
and
gnus-unbuttonized-mime-types
variables to control this
permanently. MIME Commands for further details, and hints on
how to customize these variables to always display security
information.
Snarfing OpenPGP keys (i.e., importing keys from articles into your
key ring) is not supported explicitly through a menu item or command,
rather Gnus do detect and label keys as ‘application/pgp-keys’,
allowing you to specify whatever action you think is appropriate
through the usual MIME infrastructure. You can use a
~/.mailcap entry (see mailcap in The
Emacs MIME Manual) such as the following to import keys using GNU
Privacy Guard when you click on the MIME button
(see Using MIME).
application/pgp-keys; gpg --import --interactive --verbose; needsterminal
This happens to also be the default action defined in
mailcap-mime-data
.
More information on how to set things for sending outgoing signed and
encrypted messages up can be found in the message manual
(see Security in Message Manual).
4.32 Mailing List
Gnus understands some mailing list fields of RFC 2369. To enable it,
add a to-list
group parameter (see Group Parameters),
possibly using A M (gnus-mailing-list-insinuate
) in the
summary buffer.
That enables the following commands to the summary buffer:
- C-c C-n h ¶
-
Send a message to fetch mailing list help, if List-Help field exists.
- C-c C-n s ¶
-
Send a message to subscribe the mailing list, if List-Subscribe field exists.
- C-c C-n u ¶
-
Send a message to unsubscribe the mailing list, if List-Unsubscribe
field exists.
- C-c C-n p ¶
-
Post to the mailing list, if List-Post field exists.
- C-c C-n o ¶
-
Send a message to the mailing list owner, if List-Owner field exists.
- C-c C-n a ¶
-
Browse the mailing list archive, if List-Archive field exists.
5 Article Buffer
The articles are displayed in the article buffer, of which there is only
one. All the summary buffers share the same article buffer unless you
tell Gnus otherwise.
5.2 Using MIME
Mime is a standard for waving your hands through the air, aimlessly,
while people stand around yawning.
MIME, however, is a standard for encoding your articles, aimlessly,
while all newsreaders die of fear.
MIME may specify what character set the article uses, the encoding
of the characters, and it also makes it possible to embed pictures and
other naughty stuff in innocent-looking articles.
Gnus pushes MIME articles through gnus-display-mime-function
to display the MIME parts. This is gnus-display-mime
by
default, which creates a bundle of clickable buttons that can be used to
display, save and manipulate the MIME objects.
The following commands are available when you have placed point over a
MIME button:
-
- RET (Article)
-
- BUTTON-2 (Article)
Toggle displaying of the MIME object
(gnus-article-press-button
). If built-in viewers can not display
the object, Gnus resorts to external viewers in the mailcap
files. If a viewer has the ‘copiousoutput’ specification, the
object is displayed inline.
- M-RET (Article)
-
- v (Article)
Prompt for a method, and then view the MIME object using this
method (gnus-mime-view-part
).
- t (Article) ¶
View the MIME object as if it were a different MIME media type
(gnus-mime-view-part-as-type
).
- C (Article) ¶
Prompt for a charset, and then view the MIME object using this
charset (gnus-mime-view-part-as-charset
).
- o (Article) ¶
Prompt for a file name, and then save the MIME object
(gnus-mime-save-part
).
- C-o (Article) ¶
Prompt for a file name, then save the MIME object and strip it from
the article. Then proceed to article editing, where a reasonable
suggestion is being made on how the altered article should look
like. The stripped MIME object will be referred via the
message/external-body MIME type.
(gnus-mime-save-part-and-strip
).
- r (Article) ¶
Prompt for a file name, replace the MIME object with an
external body referring to the file via the message/external-body
MIME type. (gnus-mime-replace-part
).
- d (Article) ¶
Delete the MIME object from the article and replace it with some
information about the removed MIME object
(gnus-mime-delete-part
).
- c (Article) ¶
Copy the MIME object to a fresh buffer and display this buffer
(gnus-mime-copy-part
). If given a prefix, copy the raw contents
without decoding. If given a numerical prefix, you can do semi-manual
charset stuff (see gnus-summary-show-article-charset-alist
in
Scrolling the Article). Compressed files like .gz and
.bz2 are automatically decompressed if
auto-compression-mode
is enabled (see Accessing Compressed Files in The Emacs Editor).
- p (Article) ¶
Print the MIME object (gnus-mime-print-part
). This
command respects the ‘print=’ specifications in the
.mailcap file.
- i (Article) ¶
Insert the contents of the MIME object into the buffer
(gnus-mime-inline-part
) as ‘text/plain’. If given a prefix, insert
the raw contents without decoding. If given a numerical prefix, you can
do semi-manual charset stuff (see
gnus-summary-show-article-charset-alist
in Scrolling the Article). Compressed files like .gz and .bz2 are
automatically decompressed depending on jka-compr
regardless of
auto-compression-mode
(see Accessing
Compressed Files in The Emacs Editor).
- E (Article) ¶
View the MIME object with an internal viewer. If no internal
viewer is available, use an external viewer
(gnus-mime-view-part-internally
).
- e (Article) ¶
View the MIME object with an external viewer.
(gnus-mime-view-part-externally
).
- | (Article) ¶
Output the MIME object to a process (gnus-mime-pipe-part
).
- . (Article) ¶
Interactively run an action on the MIME object
(gnus-mime-action-on-part
).
Gnus will display some MIME objects automatically. The way Gnus
determines which parts to do this with is described in the Emacs
MIME manual.
It might be best to just use the toggling functions from the article
buffer to avoid getting nasty surprises. (For instance, you enter the
group ‘alt.sing-a-long’ and, before you know it, MIME has
decoded the sound file in the article and some horrible sing-a-long song
comes screaming out your speakers, and you can’t find the volume button,
because there isn’t one, and people are starting to look at you, and you
try to stop the program, but you can’t, and you can’t find the program
to control the volume, and everybody else in the room suddenly decides
to look at you disdainfully, and you’ll feel rather stupid.)
Any similarity to real events and people is purely coincidental. Ahem.
Also see MIME Commands.
5.3 HTML
Gnus can display HTML articles nicely formatted in the
article buffer. There are many methods for doing that, but two of
them are kind of default methods.
If your Emacs copy has been built with libxml2 support, then Gnus uses
Emacs’ built-in, plain elisp Simple HTML Renderer shr
2 which is also used by Emacs’
browser EWW (see EWW in The Emacs Manual).
If your Emacs copy lacks libxml2 support but you have w3m
installed on your system, Gnus uses that to render HTML mail
and display the results in the article buffer (gnus-w3m
).
For a complete overview, consult See Display
Customization in The Emacs MIME Manual. This section only
describes the default method.
mm-text-html-renderer
¶
If set to shr
, Gnus uses its own simple HTML
renderer. If set to gnus-w3m
, it uses w3m
.
gnus-blocked-images
¶
External images that have URLs that match this regexp won’t
be fetched and displayed. For instance, to block all URLs
that have the string “ads” in them, do the following:
(setq gnus-blocked-images "ads")
This can also be a function to be evaluated. If so, it will be
called with the group name as the parameter. The default value is
gnus-block-private-groups
, which will return ‘"."’ for
anything that isn’t a newsgroup. This means that no external images
will be fetched as a result of reading mail, so that nobody can use
web bugs (and the like) to track whether you’ve read email.
If you have specific private groups that you want to have treated as
if they were public groups, you can add the name of that group to the
gnus-global-groups
list.
Also see Misc Article for gnus-inhibit-images
.
gnus-html-cache-directory
¶
Gnus will download and cache images according to how
gnus-blocked-images
is set. These images will be stored in
this directory.
gnus-html-cache-size
¶
When gnus-html-cache-size
bytes have been used in that
directory, the oldest files will be deleted. The default is 500MB.
gnus-html-frame-width
¶
The width to use when rendering HTML. The default is 70.
gnus-max-image-proportion
¶
How big pictures displayed are in relation to the window they’re in.
A value of 0.7 (the default) means that they are allowed to take up
70% of the width and height of the window. If they are larger than
this, and Emacs supports it, then the images will be rescaled down to
fit these criteria.
gnus-article-show-cursor
¶
If non-nil
, display the cursor in the article buffer even when
the article buffer isn’t the current buffer.
To use this, make sure that you have w3m
and curl
installed. If you have, then Gnus should display HTML
automatically.
5.4 Customizing Articles
A slew of functions for customizing how the articles are to look like
exist. You can call these functions interactively
(see Article Washing), or you can have them
called automatically when you select the articles.
To have them called automatically, you should set the corresponding
“treatment” variable. For instance, to have headers hidden, you’d set
gnus-treat-hide-headers
. Below is a list of variables that can
be set, but first we discuss the values these variables can have.
Note: Some values, while valid, make little sense. Check the list below
for sensible values.
-
nil
: Don’t do this treatment.
-
t
: Do this treatment on all body parts.
-
head
: Do the treatment on the headers.
-
first
: Do this treatment on the first body part.
-
last
: Do this treatment on the last body part.
- An integer: Do this treatment on all body parts that have a length less
than this number.
- A list of strings: Do this treatment on all body parts that are in
articles that are read in groups that have names that match one of the
regexps in the list.
- A list where the first element is not a string:
The list is evaluated recursively. The first element of the list is a
predicate. The following predicates are recognized: or
,
and
, not
and typep
. Here’s an example:
(or last
(typep "text/x-vcard"))
- A function: the function is called with no arguments and should return
nil
or non-nil
. The current article is available in the
buffer named by gnus-article-buffer
.
You may have noticed that the word part is used here. This refers
to the fact that some messages are MIME multipart articles that may
be divided into several parts. Articles that are not multiparts are
considered to contain just a single part.
Are the treatments applied to all sorts of multipart parts? Yes, if you
want to, but by default, only ‘text/plain’ parts are given the
treatment. This is controlled by the gnus-article-treat-types
variable, which is a list of regular expressions that are matched to the
type of the part. This variable is ignored if the value of the
controlling variable is a predicate list, as described above.
The following treatment options are available. The easiest way to
customize this is to examine the gnus-article-treat
customization
group. Values in parenthesis are suggested sensible values. Others are
possible but those listed are probably sufficient for most people.
gnus-treat-buttonize (t, integer)
gnus-treat-buttonize-head (head)
-
See Article Buttons.
gnus-treat-capitalize-sentences (t, integer)
gnus-treat-overstrike (t, integer)
gnus-treat-strip-cr (t, integer)
gnus-treat-strip-headers-in-body (t, integer)
gnus-treat-strip-leading-blank-lines (t, first, integer)
gnus-treat-strip-multiple-blank-lines (t, integer)
gnus-treat-strip-pem (t, last, integer)
gnus-treat-strip-trailing-blank-lines (t, last, integer)
gnus-treat-unsplit-urls (t, integer)
gnus-treat-wash-html (t, integer)
-
See Article Washing.
gnus-treat-date (head)
-
This will transform/add date headers according to the
gnus-article-date-headers
variable. This is a list of Date
headers to display. The formats available are:
ut
Universal time, aka GMT, aka ZULU.
local
The user’s local time zone.
english
A semi-readable English sentence.
lapsed
The time elapsed since the message was posted.
combined-lapsed
Both the original date header and a (shortened) elapsed time.
combined-local-lapsed
Both the time in the user’s local time zone a (shortened) elapsed
time.
original
The original date header.
iso8601
ISO8601 format, i.e., “2010-11-23T22:05:21”.
user-defined
A format done according to the gnus-article-time-format
variable.
See Article Date.
gnus-treat-from-picon (head)
gnus-treat-mail-picon (head)
gnus-treat-newsgroups-picon (head)
-
See Picons.
gnus-treat-from-gravatar (head)
gnus-treat-mail-gravatar (head)
-
See Gravatars.
gnus-treat-display-smileys (t, integer)
gnus-treat-body-boundary (head)
-
Adds a delimiter between header and body, the string used as delimiter
is controlled by gnus-body-boundary-delimiter
.
See Smileys.
gnus-treat-display-x-face (head)
-
See X-Face.
gnus-treat-display-face (head)
-
See Face.
gnus-treat-emphasize (t, head, integer)
¶
gnus-treat-fill-article (t, integer)
¶
gnus-treat-hide-boring-headers (head)
¶
gnus-treat-hide-citation (t, integer)
¶
gnus-treat-hide-headers (head)
¶
gnus-treat-hide-signature (t, last)
¶
gnus-treat-strip-banner (t, last)
¶
gnus-treat-strip-list-identifiers (head)
-
See Article Hiding.
gnus-treat-highlight-headers (head)
¶
gnus-treat-highlight-signature (t, last, integer)
-
See Article Highlighting.
gnus-treat-ansi-sequences (t)
¶
gnus-treat-x-pgp-sig (head)
-
gnus-treat-fold-headers (head)
¶
gnus-treat-fold-newsgroups (head)
¶
gnus-treat-leading-whitespace (head)
-
See Article Header.
You can, of course, write your own functions to be called from
gnus-part-display-hook
. The functions are called narrowed to the
part, and you can do anything you like, pretty much. There is no
information that you have to keep in the buffer—you can change
everything.
5.5 Article Keymap
Most of the keystrokes in the summary buffer can also be used in the
article buffer. They should behave as if you typed them in the summary
buffer, which means that you don’t actually have to have a summary
buffer displayed while reading. You can do it all from the article
buffer.
The key v is reserved for users. You can bind it to some
command or better use it as a prefix key.
A few additional keystrokes are available:
- SPC ¶
-
Scroll forwards one page (gnus-article-next-page
).
This is exactly the same as h SPC h.
- DEL ¶
-
Scroll backwards one page (gnus-article-prev-page
).
This is exactly the same as h DEL h.
- C-c ^ ¶
-
If point is in the neighborhood of a Message-ID
and you press
C-c ^, Gnus will try to get that article from the server
(gnus-article-refer-article
).
- C-c C-m ¶
-
Send a reply to the address near point (gnus-article-mail
). If
given a prefix, include the mail.
- s ¶
-
Reconfigure the buffers so that the summary buffer becomes visible
(gnus-article-show-summary
).
- ? ¶
-
Give a very brief description of the available keystrokes
(gnus-article-describe-briefly
).
- TAB ¶
-
Go to the next button, if any (gnus-article-next-button
). This
only makes sense if you have buttonizing turned on.
- M-TAB ¶
-
Go to the previous button, if any (gnus-article-prev-button
).
- R ¶
-
Send a reply to the current article and yank the current article
(gnus-article-reply-with-original
). If the region is active,
only yank the text in the region.
- S W ¶
-
Send a wide reply to the current article and yank the current article
(gnus-article-wide-reply-with-original
). If the region is
active, only yank the text in the region.
- F ¶
-
Send a followup to the current article and yank the current article
(gnus-article-followup-with-original
). If the region is active,
only yank the text in the region.
5.6 Misc Article
gnus-single-article-buffer
¶
-
If non-nil
, use the same article buffer for all the groups.
(This is the default.) If nil
, each group will have its own
article buffer.
gnus-widen-article-window
¶
If non-nil
, selecting the article buffer with the h
command will “widen” the article window to take the entire frame.
gnus-article-decode-hook
¶
Hook used to decode MIME articles. The default value is
(article-decode-charset article-decode-encoded-words)
gnus-article-prepare-hook
This hook is called right after the article has been inserted into the
article buffer. It is mainly intended for functions that do something
depending on the contents; it should probably not be used for changing
the contents of the article buffer.
gnus-article-mode-hook
¶
Hook called in article mode buffers.
gnus-article-mode-syntax-table
¶
Syntax table used in article buffers. It is initialized from
text-mode-syntax-table
.
gnus-article-over-scroll
If non-nil
, allow scrolling the article buffer even when there
no more new text to scroll in. The default is nil
.
gnus-article-mode-line-format
This variable is a format string along the same lines as
gnus-summary-mode-line-format
(see Summary Buffer Mode Line). It accepts the same format specifications as that variable,
with two extensions:
- ‘w’
The wash status of the article. This is a short string with one
character for each possible article wash operation that may have been
performed. The characters and their meaning:
- ‘c’
Displayed when cited text may be hidden in the article buffer.
- ‘h’
Displayed when headers are hidden in the article buffer.
- ‘p’
Displayed when article is digitally signed or encrypted, and Gnus has
hidden the security headers. (N.B. does not tell anything about
security status, i.e., good or bad signature.)
- ‘s’
Displayed when the signature has been hidden in the Article buffer.
- ‘o’
Displayed when Gnus has treated overstrike characters in the article buffer.
- ‘e’
Displayed when Gnus has treated emphasized strings in the article buffer.
- ‘m’
The number of MIME parts in the article.
gnus-break-pages
Controls whether page breaking is to take place. If this variable
is non-nil
, the articles will be divided into pages whenever a
page delimiter appears in the article. If this variable is nil
,
paging will not be done.
gnus-page-delimiter
¶
This is the delimiter mentioned above. By default, it is ‘^L’
(formfeed).
gnus-use-idna
This variable controls whether Gnus performs IDNA decoding of
internationalized domain names inside ‘From’, ‘To’ and
‘Cc’ headers. See IDNA in The Message Manual,
for how to compose such messages. This requires
GNU Libidn, and this
variable is only enabled if you have installed it.
gnus-inhibit-images
If this is non-nil
, inhibit displaying of images inline in the
article body. It is effective to images that are in articles as
MIME parts, and images in HTML articles rendered
when mm-text-html-renderer
(see Display Customization in The Emacs MIME Manual) is
shr
or gnus-w3m
.
6 Composing Messages
All commands for posting and mailing will put you in a message buffer
where you can edit the article all you like, before you send the
article by pressing C-c C-c. See Overview in Message Manual. Where the message will be posted/mailed to depends
on your setup (see Posting Server).
Also see Canceling Articles for information on how to
remove articles you shouldn’t have posted.
6.1 Mail
Variables for customizing outgoing mail:
List of regexps to match headers included in digested messages. The
headers will be included in the sequence they are matched. If
nil
include all headers.
gnus-add-to-list
¶
If non-nil
, add a to-list
group parameter to mail groups
that have none when you do a a.
gnus-confirm-mail-reply-to-news
¶
If non-nil
, Gnus will ask you for a confirmation when you are
about to reply to news articles by mail. If it is nil
, nothing
interferes in what you want to do. This can also be a function
receiving the group name as the only parameter which should return
non-nil
if a confirmation is needed, or a regular expression
matching group names, where confirmation should be asked for.
If you find yourself never wanting to reply to mail, but occasionally
press R anyway, this variable might be for you.
gnus-confirm-treat-mail-like-news
¶
If non-nil
, Gnus also requests confirmation according to
gnus-confirm-mail-reply-to-news
when replying to mail. This is
useful for treating mailing lists like newsgroups.
6.2 Posting Server
When you press those magical C-c C-c keys to ship off your latest
(extremely intelligent, of course) article, where does it go?
Thank you for asking. I hate you.
It can be quite complicated.
When posting news, Message usually invokes message-send-news
(see News Variables in Message Manual).
Normally, Gnus will post using the same select method as you’re
reading from (which might be convenient if you’re reading lots of
groups from different private servers). However. If the server
you’re reading from doesn’t allow posting, just reading, you probably
want to use some other server to post your (extremely intelligent and
fabulously interesting) articles. You can then set the
gnus-post-method
to some other method:
(setq gnus-post-method '(nnspool ""))
Now, if you’ve done this, and then this server rejects your article, or
this server is down, what do you do then? To override this variable you
can use a non-zero prefix to the C-c C-c command to force using
the “current” server, to get back the default behavior, for posting.
If you give a zero prefix (i.e., C-u 0 C-c C-c) to that command,
Gnus will prompt you for what method to use for posting.
You can also set gnus-post-method
to a list of select methods.
If that’s the case, Gnus will always prompt you for what method to use
for posting.
Finally, if you want to always post using the native select method,
you can set this variable to native
.
When sending mail, Message invokes the function specified by the
variable message-send-mail-function
. Gnus tries to set it to a
value suitable for your system.
See Mail Variables in Message manual, for more
information.
6.3 POP before SMTP
Does your ISP use POP-before-SMTP
authentication? This authentication method simply requires you to
contact the POP server before sending email. To do that,
put the following lines in your ~/.gnus.el file:
(add-hook 'message-send-mail-hook 'mail-source-touch-pop)
The mail-source-touch-pop
function does POP
authentication according to the value of mail-sources
without
fetching mails, just before sending a mail. See Mail Sources.
If you have two or more POP mail servers set in
mail-sources
, you may want to specify one of them to
mail-source-primary-source
as the POP mail server to be
used for the POP-before-SMTP authentication. If it
is your primary POP mail server (i.e., you are fetching mails
mainly from that server), you can set it permanently as follows:
(setq mail-source-primary-source
'(pop :server "pop3.mail.server"
:password "secret"))
Otherwise, bind it dynamically only when performing the
POP-before-SMTP authentication as follows:
(add-hook 'message-send-mail-hook
(lambda ()
(let ((mail-source-primary-source
'(pop :server "pop3.mail.server"
:password "secret")))
(mail-source-touch-pop))))
6.4 Mail and Post
Here’s a list of variables relevant to both mailing and
posting:
gnus-mailing-list-groups
¶
-
If your news server offers groups that are really mailing lists
gatewayed to the NNTP server, you can read those groups without
problems, but you can’t post/followup to them without some difficulty.
One solution is to add a to-address
to the group parameters
(see Group Parameters). An easier thing to do is set the
gnus-mailing-list-groups
to a regexp that matches the groups that
really are mailing lists. Then, at least, followups to the mailing
lists will work most of the time. Posting to these groups (a) is
still a pain, though.
gnus-user-agent
¶
-
This variable controls which information should be exposed in the
User-Agent header. It can be a list of symbols or a string. Valid
symbols are gnus
(show Gnus version) and emacs
(show
Emacs version). In addition to the Emacs version, you can add
config
(show system configuration) or type
(show system
type). If you set it to a string, be sure to use a valid format, see
RFC 2616.
You may want to do spell-checking on messages that you send out. Or, if
you don’t want to spell-check by hand, you could add automatic
spell-checking via the ispell
package:
(add-hook 'message-send-hook 'ispell-message)
If you want to change the ispell
dictionary based on what group
you’re in, you could say something like the following:
(add-hook 'gnus-select-group-hook
(lambda ()
(cond
((string-match
"^de\\." (gnus-group-real-name gnus-newsgroup-name))
(ispell-change-dictionary "deutsch"))
(t
(ispell-change-dictionary "english")))))
Modify to suit your needs.
If gnus-message-highlight-citation
is t
, different levels of
citations are highlighted like in Gnus article buffers also in message
mode buffers.
6.5 Archived Messages
Gnus provides a few different methods for storing the mail and news you
send. The default method is to use the archive virtual server to
store the messages. If you want to disable this completely, the
gnus-message-archive-group
variable should be nil
. The
default is "sent.%Y-%m"
, which gives you one archive group per month.
For archiving interesting messages in a group you read, see the
B c (gnus-summary-copy-article
) command (see Mail Group Commands).
gnus-message-archive-method
says what virtual server Gnus is to
use to store sent messages. The default is "archive"
, and when
actually being used it is expanded into:
(nnfolder "archive"
(nnfolder-directory "~/Mail/archive")
(nnfolder-active-file "~/Mail/archive/active")
(nnfolder-get-new-mail nil)
(nnfolder-inhibit-expiry t))
Note: a server like this is saved in the ~/.newsrc.eld file first
so that it may be used as a real method of the server which is named
"archive"
(that is, for the case where
gnus-message-archive-method
is set to "archive"
) ever
since. If it once has been saved, it will never be updated by default
even if you change the value of gnus-message-archive-method
afterward. Therefore, the server "archive"
doesn’t necessarily
mean the nnfolder
server like this at all times. If you want the
saved method to reflect always the value of
gnus-message-archive-method
, set the
gnus-update-message-archive-method
variable to a non-nil
value. The default value of this variable is nil
.
You can, however, use any mail select method (nnml
,
nnmbox
, etc.). nnfolder
is a quite likable select method
for doing this sort of thing, though. If you don’t like the default
directory chosen, you could say something like:
(setq gnus-message-archive-method
'(nnfolder "archive"
(nnfolder-inhibit-expiry t)
(nnfolder-active-file "~/News/sent-mail/active")
(nnfolder-directory "~/News/sent-mail/")))
Gnus will insert Gcc
headers in all outgoing messages that point
to one or more group(s) on that server. Which group to use is
determined by the gnus-message-archive-group
variable.
This variable can be used to do the following:
- a string
Messages will be saved in that group.
Note that you can include a select method in the group name, then the
message will not be stored in the select method given by
gnus-message-archive-method
, but in the select method specified
by the group name, instead. Suppose gnus-message-archive-method
has the default value shown above. Then setting
gnus-message-archive-group
to "foo"
means that outgoing
messages are stored in ‘nnfolder+archive:foo’, but if you use the
value "nnml:foo"
, then outgoing messages will be stored in
‘nnml:foo’.
- a list of strings
Messages will be saved in all those groups.
- an alist of regexps, functions and forms
When a key “matches”, the result is used.
nil
No message archiving will take place.
Let’s illustrate:
Just saving to a single group called ‘MisK’:
(setq gnus-message-archive-group "MisK")
Saving to two groups, ‘MisK’ and ‘safe’:
(setq gnus-message-archive-group '("MisK" "safe"))
Save to different groups based on what group you are in:
(setq gnus-message-archive-group
'(("^alt" "sent-to-alt")
("mail" "sent-to-mail")
(".*" "sent-to-misc")))
More complex stuff:
(setq gnus-message-archive-group
'((if (message-news-p)
"misc-news"
"misc-mail")))
How about storing all news messages in one file, but storing all mail
messages in one file per month:
(setq gnus-message-archive-group
'((if (message-news-p)
"misc-news"
(concat "mail." (format-time-string "%Y-%m")))))
Now, when you send a message off, it will be stored in the appropriate
group. (If you want to disable storing for just one particular message,
you can just remove the Gcc
header that has been inserted.) The
archive group will appear in the group buffer the next time you start
Gnus, or the next time you press F in the group buffer. You can
enter it and read the articles in it just like you’d read any other
group. If the group gets really big and annoying, you can simply rename
if (using G r in the group buffer) to something
nice—‘misc-mail-september-1995’, or whatever. New messages will
continue to be stored in the old (now empty) group.
gnus-gcc-mark-as-read
¶
If non-nil
, automatically mark Gcc
articles as read.
gnus-gcc-externalize-attachments
¶
If nil
, attach files as normal parts in Gcc copies; if a regexp
and matches the Gcc group name, attach files as external parts; if it is
all
, attach local files as external parts; if it is other
non-nil
, the behavior is the same as all
, but it may be
changed in the future.
gnus-gcc-self-resent-messages
¶
Like the gcc-self
group parameter, applied only for unmodified
messages that gnus-summary-resend-message
(see Summary Mail Commands) resends. Non-nil
value of this variable takes
precedence over any existing Gcc
header.
If this is none
, no Gcc
copy will be made. If this is
t
, messages resent will be Gcc
copied to the current
group. If this is a string, it specifies a group to which resent
messages will be Gcc
copied. If this is nil
, Gcc
will be done according to existing Gcc
header(s), if any. If
this is no-gcc-self
, that is the default, resent messages will be
Gcc
copied to groups that existing Gcc
header specifies,
except for the current group.
gnus-gcc-pre-body-encode-hook
¶
-
gnus-gcc-post-body-encode-hook
-
These hooks are run before/after encoding the message body of the Gcc
copy of a sent message. The current buffer (when the hook is run)
contains the message including the message header. Changes made to
the message will only affect the Gcc copy, but not the original
message. You can use these hooks to edit the copy (and influence
subsequent transformations), e.g., remove MML secure tags
(see Signing and encrypting).
6.6 Posting Styles
All them variables, they make my head swim.
So what if you want a different Organization
and signature based
on what groups you post to? And you post both from your home machine
and your work machine, and you want different From
lines, and so
on?
One way to do stuff like that is to write clever hooks that change the
variables you need to have changed. That’s a bit boring, so somebody
came up with the bright idea of letting the user specify these things in
a handy alist. Here’s an example of a gnus-posting-styles
variable:
((".*"
(signature "Peace and happiness")
(organization "What me?"))
("^comp"
(signature "Death to everybody"))
("comp.emacs.i-love-it"
(organization "Emacs is it")))
As you might surmise from this example, this alist consists of several
styles. Each style will be applicable if the first element
“matches”, in some form or other. The entire alist will be iterated
over, from the beginning towards the end, and each match will be
applied, which means that attributes in later styles that match override
the same attributes in earlier matching styles. So
‘comp.programming.literate’ will have the ‘Death to everybody’
signature and the ‘What me?’ Organization
header.
The first element in each style is called the match
. If it’s a
string, then Gnus will try to regexp match it against the group name.
If it is the form (header match regexp)
, then Gnus
will look in the original article for a header whose name is
match and compare that regexp. match and
regexp are strings. (The original article is the one you are
replying or following up to. If you are not composing a reply or a
followup, then there is nothing to match against.) If the
match
is a function symbol, that function will be called with
no arguments. If it’s a variable symbol, then the variable will be
referenced. If it’s a list, then that list will be eval
ed. In
any case, if this returns a non-nil
value, then the style is
said to match.
Each style may contain an arbitrary amount of attributes. Each
attribute consists of a (name value)
pair. In
addition, you can also use the (name :file value)
form or the (name :value value)
form. Where
:file
signifies value represents a file name and its
contents should be used as the attribute value, :value
signifies
value does not represent a file name explicitly. The attribute
name can be one of:
-
signature
-
signature-file
-
x-face-file
-
address
, overriding user-mail-address
-
name
, overriding (user-full-name)
-
body
Note that the signature-file
attribute honors the variable
message-signature-directory
.
The attribute name can also be a string or a symbol. In that case,
this will be used as a header name, and the value will be inserted in
the headers of the article; if the value is nil
, the header
name will be removed. If the attribute name is eval
, the form
is evaluated, and the result is thrown away.
The attribute value can be a string, a function with zero arguments
(the return value will be used), a variable (its value will be used)
or a list (it will be eval
ed and the return value will be
used). The functions and sexps are called/eval
ed in the
message buffer that is being set up.
In the case of a string value, if the match
is a regular
expression, or if it takes the form (header match
regexp)
, a ‘gnus-match-substitute-replacement’ is proceed
on the value to replace the positional parameters ‘\n’ by
the corresponding parenthetical matches (see Replacing the Text that Matched in The Emacs Lisp Reference
Manual.)
If you wish to check whether the message you are about to compose is
meant to be a news article or a mail message, you can check the values
of the message-news-p
and message-mail-p
functions.
So here’s a new example:
(setq gnus-posting-styles
'((".*"
(signature-file "~/.signature")
(name "User Name")
(x-face-file "~/.xface")
(x-url (getenv "WWW_HOME"))
(organization "People's Front Against MWM"))
("^rec.humor"
(signature my-funny-signature-randomizer))
((equal (system-name) "gnarly") ;; A form
(signature my-quote-randomizer))
(message-news-p ;; A function symbol
(signature my-news-signature))
(window-system ;; A value symbol
("X-Window-System" (format "%s" window-system)))
;; If I’m replying to Larsi, set the Organization header.
((header "from" "larsi.*org")
(Organization "Somewhere, Inc."))
;; Reply to a message from the same subaddress the message
;; was sent to.
((header "x-original-to" "me\\(\\+.+\\)@example.org")
(address "me\\1@example.org"))
((posting-from-work-p) ;; A user defined function
(signature-file "~/.work-signature")
(address "user@bar.foo")
(body "You are fired.\n\nSincerely, your boss.")
("X-Message-SMTP-Method" "smtp smtp.example.org 587")
(organization "Important Work, Inc"))
("nnml:.*"
(From (with-current-buffer gnus-article-buffer
(message-fetch-field "to"))))
("^nn.+:"
(signature-file "~/.mail-signature"))))
The ‘nnml:.*’ rule means that you use the To
address as the
From
address in all your outgoing replies, which might be handy
if you fill many roles.
You may also use message-alternative-emails
instead.
See Message Headers in Message Manual.
Of particular interest in the “work-mail” style is the
‘X-Message-SMTP-Method’ header. It specifies how to send the
outgoing email. You may want to sent certain emails through certain
SMTP servers due to company policies, for instance.
See Message Variables in Message Manual.
6.7 Drafts
If you are writing a message (mail or news) and suddenly remember that
you have a steak in the oven (or some pesto in the food processor, you
craaazy vegetarians), you’ll probably wish there was a method to save
the message you are writing so that you can continue editing it some
other day, and send it when you feel its finished.
Well, don’t worry about it. Whenever you start composing a message of
some sort using the Gnus mail and post commands, the buffer you get will
automatically associate to an article in a special draft group.
If you save the buffer the normal way (C-x C-s, for instance), the
article will be saved there. (Auto-save files also go to the draft
group.)
The draft group is a special group (which is implemented as an
nndraft
group, if you absolutely have to know) called
‘nndraft:drafts’. The variable nndraft-directory
says where
nndraft
is to store its files. What makes this group special is
that you can’t tick any articles in it or mark any articles as
read—all articles in the group are permanently unread.
If the group doesn’t exist, it will be created and you’ll be subscribed
to it. The only way to make it disappear from the Group buffer is to
unsubscribe it. The special properties of the draft group comes from
a group property (see Group Parameters), and if lost the group
behaves like any other group. This means the commands below will not
be available. To restore the special properties of the group, the
simplest way is to kill the group, using C-k, and restart
Gnus. The group is automatically created again with the
correct parameters. The content of the group is not lost.
When you want to continue editing the article, you simply enter the
draft group and push D e (gnus-draft-edit-message
) to do
that. You will be placed in a buffer where you left off.
Rejected articles will also be put in this draft group (see Rejected Articles).
If you have lots of rejected messages you want to post (or mail) without
doing further editing, you can use the D s command
(gnus-draft-send-message
). This command understands the
process/prefix convention (see Process/Prefix). The D S
command (gnus-draft-send-all-messages
) will ship off all messages
in the buffer.
If you have some messages that you wish not to send, you can use the
D t (gnus-draft-toggle-sending
) command to mark the message
as unsendable. This is a toggling command.
Finally, if you want to delete a draft, use the normal B DEL
command (see Mail Group Commands).
6.8 Rejected Articles
Sometimes a news server will reject an article. Perhaps the server
doesn’t like your face. Perhaps it just feels miserable. Perhaps
there be demons. Perhaps you have included too much cited text.
Perhaps the disk is full. Perhaps the server is down.
These situations are, of course, totally beyond the control of Gnus.
(Gnus, of course, loves the way you look, always feels great, has angels
fluttering around inside of it, doesn’t care about how much cited text
you include, never runs full and never goes down.) So Gnus saves these
articles until some later time when the server feels better.
The rejected articles will automatically be put in a special draft group
(see Drafts). When the server comes back up again, you’d then
typically enter that group and send all the articles off.
6.9 Signing and encrypting
Gnus can digitally sign and encrypt your messages, using vanilla
PGP format or PGP/MIME or S/MIME. For
decoding such messages, see the mm-verify-option
and
mm-decrypt-option
options (see Security).
Often, you would like to sign replies to people who send you signed
messages. Even more often, you might want to encrypt messages which
are in reply to encrypted messages. Gnus offers
gnus-message-replysign
to enable the former, and
gnus-message-replyencrypt
for the latter. In addition, setting
gnus-message-replysignencrypted
(on by default) will sign
automatically encrypted messages.
Instructing MML to perform security operations on a
MIME part is done using the C-c C-m s key map for
signing and the C-c C-m c key map for encryption, as follows.
- C-c C-m s s ¶
-
Digitally sign current message using S/MIME.
- C-c C-m s o ¶
-
Digitally sign current message using PGP.
- C-c C-m s p ¶
-
Digitally sign current message using PGP/MIME.
- C-c C-m c s ¶
-
Digitally encrypt current message using S/MIME.
- C-c C-m c o ¶
-
Digitally encrypt current message using PGP.
- C-c C-m c p ¶
-
Digitally encrypt current message using PGP/MIME.
- C-c C-m C-n ¶
-
Remove security related MML tags from message.
See Security in Message Manual, for more information.
7 Select Methods
A foreign group is a group not read by the usual (or
default) means. It could be, for instance, a group from a different
NNTP server, it could be a virtual group, or it could be your own
personal mail group.
A foreign group (or any group, really) is specified by a name and
a select method. To take the latter first, a select method is a
list where the first element says what back end to use (e.g., nntp
,
nnspool
, nnml
) and the second element is the server
name. There may be additional elements in the select method, where the
value may have special meaning for the back end in question.
One could say that a select method defines a virtual server—so
we do just that (see Server Buffer).
The name of the group is the name the back end will recognize the
group as.
For instance, the group ‘soc.motss’ on the NNTP server
‘some.where.edu’ will have the name ‘soc.motss’ and select
method (nntp "some.where.edu")
. Gnus will call this group
‘nntp+some.where.edu:soc.motss’, even though the nntp
back end just knows this group as ‘soc.motss’.
The different methods all have their peculiarities, of course.
7.1 Server Buffer
Traditionally, a server is a machine or a piece of software that
one connects to, and then requests information from. Gnus does not
connect directly to any real servers, but does all transactions through
one back end or other. But that’s just putting one layer more between
the actual media and Gnus, so we might just as well say that each
back end represents a virtual server.
For instance, the nntp
back end may be used to connect to several
different actual NNTP servers, or, perhaps, to many different ports
on the same actual NNTP server. You tell Gnus which back end to
use, and what parameters to set by specifying a select method.
These select method specifications can sometimes become quite
complicated—say, for instance, that you want to read from the
NNTP server ‘news.funet.fi’ on port number 13, which
hangs if queried for NOV headers and has a buggy select. Ahem.
Anyway, if you had to specify that for each group that used this
server, that would be too much work, so Gnus offers a way of naming
select methods, which is what you do in the server buffer.
To enter the server buffer, use the ^
(gnus-group-enter-server-mode
) command in the group buffer.
gnus-server-mode-hook
is run when creating the server buffer.
7.1.2 Server Commands
The following keybinding are available in the server buffer. Be aware
that some of the commands will only work on servers that you’ve added
through this interface (with a), not with servers you’ve defined
in your init files.
- v ¶
-
The key v is reserved for users. You can bind it to some
command or better use it as a prefix key.
- a ¶
-
Add a new server (gnus-server-add-server
).
- e ¶
-
Edit a server (gnus-server-edit-server
).
- S ¶
-
Show the definition of a server (gnus-server-show-server
).
- SPC ¶
-
Browse the current server (gnus-server-read-server
).
- q ¶
-
Return to the group buffer (gnus-server-exit
).
- k ¶
-
Kill the current server (gnus-server-kill-server
).
- y ¶
-
Yank the previously killed server (gnus-server-yank-server
).
- c ¶
-
Copy the current server (gnus-server-copy-server
).
- l ¶
-
List all servers (gnus-server-list-servers
).
- s ¶
-
Request that the server scan its sources for new articles
(gnus-server-scan-server
). This is mainly sensible with mail
servers.
- g ¶
-
Request that the server regenerate all its data structures
(gnus-server-regenerate-server
). This can be useful if you have
a mail back end that has gotten out of sync.
- z ¶
-
Compact all groups in the server under point
(gnus-server-compact-server
). Currently implemented only in
nnml (see Mail Spool). This removes gaps between article numbers,
hence getting a correct total article count.
Some more commands for closing, disabling, and re-opening servers are
listed in Unavailable Servers.
7.1.3 Example Methods
Most select methods are pretty simple and self-explanatory:
Reading directly from the spool is even simpler:
As you can see, the first element in a select method is the name of the
back end, and the second is the address, or name, if you
will.
After these two elements, there may be an arbitrary number of
(variable form)
pairs.
To go back to the first example—imagine that you want to read from
port 15 on that machine. This is what the select method should
look like then:
(nntp "news.funet.fi" (nntp-port-number 15))
You should read the documentation to each back end to find out what
variables are relevant, but here’s an nnmh
example:
nnmh
is a mail back end that reads a spool-like structure. Say
you have two structures that you wish to access: One is your private
mail spool, and the other is a public one. Here’s the possible spec for
your private mail:
(nnmh "private" (nnmh-directory "~/private/mail/"))
(This server is then called ‘private’, but you may have guessed
that.)
Here’s the method for a public spool:
(nnmh "public"
(nnmh-directory "/usr/information/spool/")
(nnmh-get-new-mail nil))
If you are behind a firewall and only have access to the NNTP
server from the firewall machine, you can instruct Gnus to rlogin
on the firewall machine and connect with
netcat from there to the
NNTP server.
Doing this can be rather fiddly, but your virtual server definition
should probably look something like this:
(nntp "firewall"
(nntp-open-connection-function nntp-open-via-rlogin-and-netcat)
(nntp-via-address "the.firewall.machine")
(nntp-address "the.real.nntp.host"))
If you want to use the wonderful ssh
program to provide a
compressed connection over the modem line, you could add the following
configuration to the example above:
(nntp-via-rlogin-command "ssh")
See also nntp-via-rlogin-command-switches
. Here’s an example for
an indirect connection:
(setq gnus-select-method
'(nntp "indirect"
(nntp-address "news.server.example")
(nntp-via-user-name "intermediate_user_name")
(nntp-via-address "intermediate.host.example")
(nntp-via-rlogin-command "ssh")
(nntp-via-rlogin-command-switches ("-C"))
(nntp-open-connection-function nntp-open-via-rlogin-and-netcat)))
This means that you have to have set up ssh-agent
correctly to
provide automatic authorization, of course.
If you’re behind a firewall, but have direct access to the outside world
through a wrapper command like "runsocks", you could open a socksified
netcat connection to the news server as follows:
(nntp "outside"
(nntp-pre-command "runsocks")
(nntp-open-connection-function nntp-open-netcat-stream)
(nntp-address "the.news.server"))
7.1.4 Creating a Virtual Server
If you’re saving lots of articles in the cache by using persistent
articles, you may want to create a virtual server to read the cache.
First you need to add a new server. The a command does that. It
would probably be best to use nnml
to read the cache. You
could also use nnspool
or nnmh
, though.
Type a nnml RET cache RET.
You should now have a brand new nnml
virtual server called
‘cache’. You now need to edit it to have the right definitions.
Type e to edit the server. You’ll be entered into a buffer that
will contain the following:
Change that to:
(nnml "cache"
(nnml-directory "~/News/cache/")
(nnml-active-file "~/News/cache/active"))
Type C-c C-c to return to the server buffer. If you now press
RET over this virtual server, you should be entered into a browse
buffer, and you should be able to enter any of the groups displayed.
7.1.5 Server Variables
One sticky point when defining variables (both on back ends and in Emacs
in general) is that some variables are typically initialized from other
variables when the definition of the variables is being loaded. If you
change the “base” variable after the variables have been loaded, you
won’t change the “derived” variables.
This typically affects directory and file variables. For instance,
nnml-directory
is ~/Mail/ by default, and all nnml
directory variables are initialized from that variable, so
nnml-active-file
will be ~/Mail/active. If you define a
new virtual nnml
server, it will not suffice to set just
nnml-directory
—you have to explicitly set all the file
variables to be what you want them to be. For a complete list of
variables for each back end, see each back end’s section later in this
manual, but here’s an example nnml
definition:
(nnml "public"
(nnml-directory "~/my-mail/")
(nnml-active-file "~/my-mail/active")
(nnml-newsgroups-file "~/my-mail/newsgroups"))
Server variables are often called server parameters.
7.1.6 Servers and Methods
Wherever you would normally use a select method
(e.g., gnus-secondary-select-method
, in the group select method,
when browsing a foreign server) you can use a virtual server name
instead. This could potentially save lots of typing. And it’s nice all
over.
7.1.7 Unavailable Servers
If a server seems to be unreachable, Gnus will mark that server as
denied
. That means that any subsequent attempt to make contact
with that server will just be ignored. “It can’t be opened,” Gnus
will tell you, without making the least effort to see whether that is
actually the case or not.
That might seem quite naughty, but it does make sense most of the time.
Let’s say you have 10 groups subscribed to on server
‘nephelococcygia.com’. This server is located somewhere quite far
away from you and the machine is quite slow, so it takes 1 minute just
to find out that it refuses connection to you today. If Gnus were to
attempt to do that 10 times, you’d be quite annoyed, so Gnus won’t
attempt to do that. Once it has gotten a single “connection refused”,
it will regard that server as “down”.
So, what happens if the machine was only feeling unwell temporarily?
How do you test to see whether the machine has come up again?
You jump to the server buffer (see Server Buffer) and poke it
with the following commands:
- O ¶
-
Try to establish connection to the server on the current line
(gnus-server-open-server
).
- C ¶
-
Close the connection (if any) to the server
(gnus-server-close-server
).
- D ¶
-
Mark the current server as unreachable
(gnus-server-deny-server
). This will effectively disable the
server.
- M-o ¶
-
Open the connections to all servers in the buffer
(gnus-server-open-all-servers
).
- M-c ¶
-
Close the connections to all servers in the buffer
(gnus-server-close-all-servers
).
- R ¶
-
Remove all marks to whether Gnus was denied connection from any servers
(gnus-server-remove-denials
).
- c ¶
-
Copy a server and give it a new name
(gnus-server-copy-server
). This can be useful if you have a
complex method definition, and want to use the same definition towards
a different (physical) server.
- L ¶
-
Set server status to offline (gnus-server-offline-server
).
7.2 Getting News
A newsreader is normally used for reading news. Gnus currently provides
only two methods of getting news—it can read from an NNTP server,
or it can read from a local spool.
7.2.1 NNTP
Subscribing to a foreign group from an NNTP server is rather easy.
You just specify nntp
as method and the address of the NNTP
server as the, uhm, address.
If the NNTP server is located at a non-standard port, setting the
third element of the select method to this port number should allow you
to connect to the right port. You’ll have to edit the group info for
that (see Foreign Groups).
The name of the foreign group can be the same as a native group. In
fact, you can subscribe to the same group from as many different servers
you feel like. There will be no name collisions.
The following variables can be used to create a virtual nntp
server:
nntp-server-opened-hook
¶
-
is run after a connection has been made. It can be used to send
commands to the NNTP server after it has been contacted. By
default it sends the command MODE READER
to the server with the
nntp-send-mode-reader
function. This function should always be
present in this hook.
nntp-authinfo-function
¶
-
This function will be used to send ‘AUTHINFO’ to the NNTP
server. The default function is nntp-send-authinfo
, which looks
through your ~/.authinfo for applicable entries. If none
are found, it will prompt you for a login name and a password. The
format of the ~/.authinfo file is (almost) the same as the
ftp
~/.netrc file, which is defined in the ftp
manual page, but here are the salient facts:
- The file contains one or more line, each of which define one server.
- Each line may contain an arbitrary number of token/value pairs.
The valid tokens include ‘machine’, ‘login’, ‘password’,
‘default’. In addition Gnus introduces two new tokens, not present
in the original .netrc/ftp
syntax, namely ‘port’ and
‘force’. (This is the only way the .authinfo file format
deviates from the .netrc file format.) ‘port’ is used to
indicate what port on the server the credentials apply to and
‘force’ is explained below.
Here’s an example file:
machine news.uio.no login larsi password geheimnis
machine nntp.ifi.uio.no login larsi force yes
The token/value pairs may appear in any order; ‘machine’ doesn’t
have to be first, for instance.
In this example, both login name and password have been supplied for the
former server, while the latter has only the login name listed, and the
user will be prompted for the password. The latter also has the
‘force’ tag, which means that the authinfo will be sent to the
nntp server upon connection; the default (i.e., when there is not
‘force’ tag) is to not send authinfo to the nntp server
until the nntp server asks for it.
You can also add ‘default’ lines that will apply to all servers
that don’t have matching ‘machine’ lines.
This will force sending ‘AUTHINFO’ commands to all servers not
previously mentioned.
Remember to not leave the ~/.authinfo file world-readable.
nntp-server-action-alist
¶
This is a list of regexps to match on server types and actions to be
taken when matches are made. For instance, if you want Gnus to beep
every time you connect to innd, you could say something like:
(setq nntp-server-action-alist
'(("innd" (ding))))
You probably don’t want to do that, though.
The default value is
'(("nntpd 1\\.5\\.11t"
(remove-hook 'nntp-server-opened-hook
'nntp-send-mode-reader)))
This ensures that Gnus doesn’t send the MODE READER
command to
nntpd 1.5.11t, since that command chokes that server, I’ve been told.
nntp-maximum-request
¶
If the NNTP server doesn’t support NOV headers, this back end
will collect headers by sending a series of head
commands. To
speed things up, the back end sends lots of these commands without
waiting for reply, and then reads all the replies. This is controlled
by the nntp-maximum-request
variable, and is 400 by default. If
your network is buggy, you should set this to 1.
nntp-connection-timeout
¶
If you have lots of foreign nntp
groups that you connect to
regularly, you’re sure to have problems with NNTP servers not
responding properly, or being too loaded to reply within reasonable
time. This is can lead to awkward problems, which can be helped
somewhat by setting nntp-connection-timeout
. This is an integer
that says how many seconds the nntp
back end should wait for a
connection before giving up. If it is nil
, which is the default,
no timeouts are done.
nntp-nov-is-evil
¶
If the NNTP server does not support NOV, you could set this
variable to t
, but nntp
usually checks automatically whether NOV
can be used.
nntp-xover-commands
¶
-
List of strings used as commands to fetch NOV lines from a
server. The default value of this variable is ("XOVER"
"XOVERVIEW")
.
nntp-nov-gap
¶
nntp
normally sends just one big request for NOV lines to
the server. The server responds with one huge list of lines. However,
if you have read articles 2–5000 in the group, and only want to read
article 1 and 5001, that means that nntp
will fetch 4999 NOV
lines that you will not need. This variable says how
big a gap between two consecutive articles is allowed to be before the
XOVER
request is split into several request. Note that if your
network is fast, setting this variable to a really small number means
that fetching will probably be slower. If this variable is nil
,
nntp
will never split requests. The default is 5.
nntp-xref-number-is-evil
¶
When Gnus refers to an article having the Message-ID
that a user
specifies or having the Message-ID
of the parent article of the
current one (see Finding the Parent), Gnus sends a HEAD
command to the NNTP server to know where it is, and the server
returns the data containing the pairs of a group and an article number
in the Xref
header. Gnus normally uses the article number to
refer to the article if the data shows that that article is in the
current group, while it uses the Message-ID
otherwise. However,
some news servers, e.g., ones running Diablo, run multiple engines
having the same articles but article numbers are not kept synchronized
between them. In that case, the article number that appears in the
Xref
header varies by which engine is chosen, so you cannot refer
to the parent article that is in the current group, for instance. If
you connect to such a server, set this variable to a non-nil
value, and Gnus never uses article numbers. For example:
(setq gnus-select-method
'(nntp "newszilla"
(nntp-address "newszilla.example.com")
(nntp-xref-number-is-evil t)
…))
The default value of this server variable is nil
.
nntp-prepare-server-hook
¶
A hook run before attempting to connect to an NNTP server.
nntp-record-commands
¶
If non-nil
, nntp
will log all commands it sends to the
NNTP server (along with a timestamp) in the *nntp-log*
buffer. This is useful if you are debugging a Gnus/NNTP connection
that doesn’t seem to work.
nntp-open-connection-function
¶
It is possible to customize how the connection to the nntp server will
be opened. If you specify an nntp-open-connection-function
parameter, Gnus will use that function to establish the connection.
Seven pre-made functions are supplied. These functions can be grouped
in two categories: direct connection functions (four pre-made), and
indirect ones (three pre-made).
nntp-never-echoes-commands
¶
Non-nil
means the nntp server never echoes commands. It is
reported that some nntps server doesn’t echo commands. So, you may want
to set this to non-nil
in the method for such a server setting
nntp-open-connection-function
to nntp-open-ssl-stream
for
example. The default value is nil
. Note that the
nntp-open-connection-functions-never-echo-commands
variable
overrides the nil
value of this variable.
nntp-open-connection-functions-never-echo-commands
¶
List of functions that never echo commands. Add or set a function which
you set to nntp-open-connection-function
to this list if it does
not echo commands. Note that a non-nil
value of the
nntp-never-echoes-commands
variable overrides this variable. The
default value is (nntp-open-network-stream)
.
nntp-prepare-post-hook
¶
A hook run just before posting an article. If there is no
Message-ID
header in the article and the news server provides the
recommended ID, it will be added to the article before running this
hook. It is useful to make Cancel-Lock
headers even if you
inhibit Gnus to add a Message-ID
header, you could say:
(add-hook 'nntp-prepare-post-hook 'canlock-insert-header)
Note that not all servers support the recommended ID. This works for
INN versions 2.3.0 and later, for instance.
nntp-server-list-active-group
If nil
, then always use ‘GROUP’ instead of ‘LIST
ACTIVE’. This is usually slower, but on misconfigured servers that
don’t update their active files often, this can help.
7.2.1.1 Direct Functions
These functions are called direct because they open a direct connection
between your machine and the NNTP server. The behavior of these
functions is also affected by commonly understood variables
(see Common Variables).
-
nntp-open-network-stream
This is the default, and simply connects to some port or other on the
remote system. If both Emacs and the server supports it, the
connection will be upgraded to an encrypted STARTTLS
connection automatically.
network-only
The same as the above, but don’t do automatic STARTTLS upgrades.
nntp-open-tls-stream
Opens a connection to a server over a secure channel. To use
this you must have GnuTLS
installed. You then define a server as follows:
;; "nntps" is port 563 and is predefined in our /etc/services
;; however, ‘gnutls-cli -p’ doesn’t like named ports.
;;
(nntp "snews.bar.com"
(nntp-open-connection-function nntp-open-tls-stream)
(nntp-port-number 563)
(nntp-address "snews.bar.com"))
nntp-open-ssl-stream
Opens a connection to a server over a secure channel. To use
this you must have OpenSSL
installed. You then define a server as follows:
;; "snews" is port 563 and is predefined in our /etc/services
;; however, ‘openssl s_client -port’ doesn’t like named ports.
;;
(nntp "snews.bar.com"
(nntp-open-connection-function nntp-open-ssl-stream)
(nntp-port-number 563)
(nntp-address "snews.bar.com"))
nntp-open-netcat-stream
Opens a connection to an NNTP server using the netcat
program. You might wonder why this function exists, since we have
the default nntp-open-network-stream
which would do the job. (One
of) the reason(s) is that if you are behind a firewall but have direct
connections to the outside world thanks to a command wrapper like
runsocks
, you can use it like this:
(nntp "socksified"
(nntp-pre-command "runsocks")
(nntp-open-connection-function nntp-open-netcat-stream)
(nntp-address "the.news.server"))
With the default method, you would need to wrap your whole Emacs
session, which is not a good idea.
nntp-open-telnet-stream
Like nntp-open-netcat-stream
, but uses telnet
rather than
netcat
. telnet
is a bit less robust because of things
like line-end-conversion, but sometimes netcat is simply
not available. The previous example would turn into:
(nntp "socksified"
(nntp-pre-command "runsocks")
(nntp-open-connection-function nntp-open-telnet-stream)
(nntp-address "the.news.server")
(nntp-end-of-line "\n"))
7.2.1.2 Indirect Functions
These functions are called indirect because they connect to an
intermediate host before actually connecting to the NNTP server.
All of these functions and related variables are also said to belong to
the “via” family of connection: they’re all prefixed with “via” to make
things cleaner. The behavior of these functions is also affected by
commonly understood variables (see Common Variables).
nntp-open-via-rlogin-and-netcat
¶
Does an ‘rlogin’ on a remote system, and then uses netcat
to connect
to the real NNTP server from there. This is useful for instance if
you need to connect to a firewall machine first.
nntp-open-via-rlogin-and-netcat
-specific variables:
nntp-via-rlogin-command
¶
Command used to log in on the intermediate host. The default is
‘rsh’, but ‘ssh’ is a popular alternative.
nntp-via-rlogin-command-switches
¶
List of strings to be used as the switches to
nntp-via-rlogin-command
. The default is nil
. If you use
‘ssh’ for nntp-via-rlogin-command
, you may set this to
‘("-C")’ in order to compress all data connections.
nntp-open-via-rlogin-and-telnet
¶
Does essentially the same, but uses telnet
instead of ‘netcat’
to connect to the real NNTP server from the intermediate host.
telnet
is a bit less robust because of things like
line-end-conversion, but sometimes netcat
is simply not available.
nntp-open-via-rlogin-and-telnet
-specific variables:
nntp-telnet-command
¶
Command used to connect to the real NNTP server from the
intermediate host. The default is ‘telnet’.
nntp-telnet-switches
¶
List of strings to be used as the switches to the
nntp-telnet-command
command. The default is ("-8")
.
nntp-via-rlogin-command
¶
Command used to log in on the intermediate host. The default is
‘rsh’, but ‘ssh’ is a popular alternative.
nntp-via-rlogin-command-switches
¶
List of strings to be used as the switches to
nntp-via-rlogin-command
. If you use ‘ssh’, you may need to set
this to ‘("-t" "-e" "none")’ or ‘("-C" "-t" "-e" "none")’ if
the telnet command requires a pseudo-tty allocation on an intermediate
host. The default is nil
.
Note that you may want to change the value for nntp-end-of-line
to ‘\n’ (see Common Variables).
nntp-open-via-telnet-and-telnet
¶
Does essentially the same, but uses ‘telnet’ instead of
‘rlogin’ to connect to the intermediate host.
nntp-open-via-telnet-and-telnet
-specific variables:
nntp-via-telnet-command
¶
Command used to telnet
the intermediate host. The default is
‘telnet’.
nntp-via-telnet-switches
¶
List of strings to be used as the switches to the
nntp-via-telnet-command
command. The default is ‘("-8")’.
nntp-via-user-password
¶
Password to use when logging in on the intermediate host.
nntp-via-envuser
¶
If non-nil
, the intermediate telnet
session (client and
server both) will support the ENVIRON
option and not prompt for
login name. This works for Solaris telnet
, for instance.
nntp-via-shell-prompt
¶
Regexp matching the shell prompt on the intermediate host. The default
is ‘bash\\|\$ *\r?$\\|> *\r?’.
Note that you may want to change the value for nntp-end-of-line
to ‘\n’ (see Common Variables).
Here are some additional variables that are understood by all the above
functions:
nntp-via-user-name
¶
User name to use when connecting to the intermediate host.
nntp-via-address
¶
Address of the intermediate host to connect to.
7.2.1.3 Common Variables
The following variables affect the behavior of all, or several of the
pre-made connection functions. When not specified, all functions are
affected (the values of the following variables will be used as the
default if each virtual nntp
server doesn’t specify those server
variables individually).
nntp-pre-command
¶
A command wrapper to use when connecting through a non native
connection function (all except nntp-open-network-stream
,
nntp-open-tls-stream
, and nntp-open-ssl-stream
). This is
where you would put a ‘SOCKS’ wrapper for instance.
nntp-address
¶
The address of the NNTP server.
nntp-port-number
¶
Port number to connect to the NNTP server. The default is
‘nntp’. If you use NNTP over
TLS/SSL, you may want to use integer ports rather
than named ports (i.e., use ‘563’ instead of ‘snews’ or
‘nntps’), because external TLS/SSL tools may
not work with named ports.
nntp-end-of-line
¶
String to use as end-of-line marker when talking to the NNTP
server. This is ‘\r\n’ by default, but should be ‘\n’ when
using a non native telnet connection function.
nntp-netcat-command
¶
Command to use when connecting to the NNTP server through
‘netcat’. This is not for an intermediate host. This is
just for the real NNTP server. The default is
‘nc’.
nntp-netcat-switches
¶
A list of switches to pass to nntp-netcat-command
. The default
is ‘()’.
7.2.2 News Spool
Subscribing to a foreign group from the local spool is extremely easy,
and might be useful, for instance, to speed up reading groups that
contain very big articles—‘alt.binaries.pictures.furniture’, for
instance.
Anyway, you just specify nnspool
as the method and ""
(or
anything else) as the address.
If you have access to a local spool, you should probably use that as the
native select method (see Finding the News). It is normally faster
than using an nntp
select method, but might not be. It depends.
You just have to try to find out what’s best at your site.
nnspool-inews-program
¶
Program used to post an article.
nnspool-inews-switches
¶
Parameters given to the inews program when posting an article.
nnspool-spool-directory
¶
Where nnspool
looks for the articles. This is normally
/usr/spool/news/.
nnspool-nov-directory
¶
Where nnspool
will look for NOV files. This is normally
/usr/spool/news/over.view/.
nnspool-lib-dir
¶
Where the news lib dir is (/usr/lib/news/ by default).
nnspool-active-file
¶
The name of the active file.
nnspool-newsgroups-file
¶
The name of the group descriptions file.
nnspool-history-file
¶
The name of the news history file.
nnspool-active-times-file
¶
The name of the active date file.
nnspool-nov-is-evil
¶
If non-nil
, nnspool
won’t try to use any NOV files
that it finds.
nnspool-sift-nov-with-sed
¶
-
If non-nil
, which is the default, use sed
to get the
relevant portion from the overview file. If nil
,
nnspool
will load the entire file into a buffer and process it
there.
7.3 Using IMAP
The most popular mail backend is probably nnimap
, which
provides access to IMAP servers. IMAP servers
store mail remotely, so the client doesn’t store anything locally.
This means that it’s a convenient choice when you’re reading your mail
from different locations, or with different user agents.
7.3.1 Connecting to an IMAP Server
Connecting to an IMAP can be very easy. Type B in the
group buffer, or (if your primary interest is reading email), say
something like:
(setq gnus-select-method
'(nnimap "imap.gmail.com"))
You’ll be prompted for a user name and password. If you grow tired of
that, then add the following to your ~/.authinfo file:
machine imap.gmail.com login <username> password <password> port imap
That should basically be it for most users.
7.3.2 Customizing the IMAP Connection
Here’s an example method that’s more complex:
(nnimap "imap.gmail.com"
(nnimap-inbox "INBOX")
(nnimap-split-methods default)
(nnimap-expunge t)
(nnimap-stream ssl))
nnimap-address
The address of the server, like ‘imap.gmail.com’.
nnimap-server-port
If the server uses a non-standard port, that can be specified here. A
typical port would be "imap"
or "imaps"
.
nnimap-stream
How nnimap
should connect to the server. Possible values are:
undecided
This is the default, and this first tries the ssl
setting, and
then tries the network
setting.
ssl
This uses standard TLS/SSL connections.
network
Non-encrypted and unsafe straight socket connection, but will upgrade
to encrypted STARTTLS if both Emacs and the server
supports it.
starttls
Encrypted STARTTLS over the normal IMAP port.
shell
If you need to tunnel via other systems to connect to the server, you
can use this option, and customize nnimap-shell-program
to be
what you need.
plain
Non-encrypted and unsafe straight socket connection.
STARTTLS will not be used even if it is available.
nnimap-authenticator
Some IMAP servers allow anonymous logins. In that case,
this should be set to anonymous
. If this variable isn’t set,
the normal login methods will be used. If you wish to specify a
specific login method to be used, you can set this variable to either
login
(the traditional IMAP login method),
plain
, cram-md5
or xoauth2
. (The latter method
requires using the oauth2.el library.)
nnimap-expunge
When to expunge deleted messages. If never
, deleted articles
are marked with the IMAP \\Delete
flag but not automatically
expunged. If immediately
, deleted articles are immediately expunged
(this requires the server to support the UID EXPUNGE command). If
on-exit
, deleted articles are flagged, and all flagged articles are
expunged when the group is closed.
For backwards compatibility, this variable may also be set to t
or nil. If the server supports UID EXPUNGE, both t and nil are
equivalent to immediately
. If the server does not support UID
EXPUNGE nil is equivalent to never
, while t will immediately
expunge ALL articles that are currently flagged as deleted
(i.e., potentially not only the article that was just deleted).
nnimap-streaming
Virtually all IMAP server support fast streaming of data.
If you have problems connecting to the server, try setting this to
nil
.
nnimap-fetch-partial-articles
If non-nil
, fetch partial articles from the server. If set to
a string, then it’s interpreted as a regexp, and parts that have
matching types will be fetched. For instance, ‘"text/"’ will
fetch all textual parts, while leaving the rest on the server.
nnimap-record-commands
If non-nil
, record all IMAP commands in the
‘"*imap log*"’ buffer.
nnimap-use-namespaces
If non-nil
, omit the IMAP namespace prefix in nnimap group
names. If your IMAP mailboxes are called something like ‘INBOX’
and ‘INBOX.Lists.emacs’, but you’d like the nnimap group names to
be ‘INBOX’ and ‘Lists.emacs’, you should enable this option.
nnimap-keepalive-intervals
By default, nnimap will send occasional ‘NOOP’ (keepalive)
commands to the server, to keep the connection alive. This option
governs how often that happens. It is a cons of two integers,
representing seconds: first how often to run the keepalive check, and
the second how many seconds of user inactivity are required to
actually send the command. The default, (900 . 300)
, means run
the check every fifteen minutes and, if the user has been inactive for
five minutes, send the keepalive command. Set to nil
to
disable keepalive commands altogether.
7.3.3 Client-Side IMAP Splitting
Many people prefer to do the sorting/splitting of mail into their mail
boxes on the IMAP server. That way they don’t have to
download the mail they’re not all that interested in.
If you do want to do client-side mail splitting, then the following
variables are relevant:
nnimap-inbox
This is the IMAP mail box that will be scanned for new
mail. This can also be a list of mail box names.
nnimap-split-methods
Uses the same syntax as nnmail-split-methods
(see Splitting Mail), except the symbol default
, which means that it should
use the value of the nnmail-split-methods
variable.
nnimap-split-fancy
Uses the same syntax as nnmail-split-fancy
.
nnimap-unsplittable-articles
List of flag symbols to ignore when doing splitting. That is,
articles that have these flags won’t be considered when splitting.
The default is ‘(%Deleted %Seen)’.
By default, the nnimap back end only retrieves the message headers;
the option nnimap-split-download-body
(which is a regular
customization option, not a server variable) tells it to retrieve the
message bodies as well. We don’t set this by default because it will
slow IMAP down, and that is not an appropriate decision to
make on behalf of the user.
Here’s a complete example nnimap
backend with a client-side
“fancy” splitting method:
(nnimap "imap.example.com"
(nnimap-inbox "INBOX")
(nnimap-split-fancy
(| ("MailScanner-SpamCheck" "spam" "spam.detected")
(to "foo@bar.com" "foo")
"undecided")))
7.3.4 Support for IMAP Extensions
If you’re using Google’s Gmail, you may want to see your Gmail labels
when reading your mail. Gnus can give you this information if you ask
for ‘X-GM-LABELS’ in the variable gnus-extra-headers
. For
example:
(setq gnus-extra-headers
'(To Newsgroups X-GM-LABELS))
This will result in Gnus storing your labels in message header
structures for later use. The content is always a parenthesized
(possible empty) list.
7.4 Getting Mail
Reading mail with a newsreader—isn’t that just plain WeIrD? But of
course.
7.4.1 Mail in a Newsreader
If you are used to traditional mail readers, but have decided to switch
to reading mail with Gnus, you may find yourself experiencing something
of a culture shock.
Gnus does not behave like traditional mail readers. If you want to make
it behave that way, you can, but it’s an uphill battle.
Gnus, by default, handles all its groups using the same approach. This
approach is very newsreaderly—you enter a group, see the new/unread
messages, and when you read the messages, they get marked as read, and
you don’t see them any more. (Unless you explicitly ask for them.)
In particular, you do not do anything explicitly to delete messages.
Does this mean that all the messages that have been marked as read are
deleted? How awful!
But, no, it means that old messages are expired according to some
scheme or other. For news messages, the expire process is controlled by
the news administrator; for mail, the expire process is controlled by
you. The expire process for mail is covered in depth in Expiring Mail.
What many Gnus users find, after using it a while for both news and
mail, is that the transport mechanism has very little to do with how
they want to treat a message.
Many people subscribe to several mailing lists. These are transported
via SMTP, and are therefore mail. But we might go for weeks without
answering, or even reading these messages very carefully. We may not
need to save them because if we should need to read one again, they are
archived somewhere else.
Some people have local news groups which have only a handful of readers.
These are transported via NNTP, and are therefore news. But we may need
to read and answer a large fraction of the messages very carefully in
order to do our work. And there may not be an archive, so we may need
to save the interesting messages the same way we would personal mail.
The important distinction turns out to be not the transport mechanism,
but other factors such as how interested we are in the subject matter,
or how easy it is to retrieve the message if we need to read it again.
Gnus provides many options for sorting mail into “groups” which behave
like newsgroups, and for treating each group (whether mail or news)
differently.
Some users never get comfortable using the Gnus (ahem) paradigm and wish
that Gnus should grow up and be a male, er, mail reader. It is possible
to whip Gnus into a more mailreaderly being, but, as said before, it’s
not easy. People who prefer proper mail readers should try VM
instead, which is an excellent, and proper, mail reader.
I don’t mean to scare anybody off, but I want to make it clear that you
may be required to learn a new way of thinking about messages. After
you’ve been subjected to The Gnus Way, you will come to love it. I can
guarantee it. (At least the guy who sold me the Emacs Subliminal
Brain-Washing Functions that I’ve put into Gnus did guarantee it. You
Will Be Assimilated. You Love Gnus. You Love The Gnus Mail Way.
You Do.)
7.4.2 Getting Started Reading Mail
It’s quite easy to use Gnus to read your new mail. You just plonk the
mail back end of your choice into gnus-secondary-select-methods
,
and things will happen automatically.
For instance, if you want to use nnml
(which is a “one file per
mail” back end), you could put the following in your ~/.gnus.el file:
(setq gnus-secondary-select-methods '((nnml "")))
Now, the next time you start Gnus, this back end will be queried for new
articles, and it will move all the messages in your spool file to its
directory, which is ~/Mail/ by default. The new group that will
be created (‘mail.misc’) will be subscribed, and you can read it
like any other group.
You will probably want to split the mail into several groups, though:
(setq nnmail-split-methods
'(("junk" "^From:.*Lars Ingebrigtsen")
("crazy" "^Subject:.*die\\|^Organization:.*flabby")
("other" "")))
This will result in three new nnml
mail groups being created:
‘nnml:junk’, ‘nnml:crazy’, and ‘nnml:other’. All the
mail that doesn’t fit into the first two groups will be placed in the
last group.
This should be sufficient for reading mail with Gnus. You might want to
give the other sections in this part of the manual a perusal, though.
Especially see Choosing a Mail Back End and see Expiring Mail.
7.4.3 Splitting Mail
The nnmail-split-methods
variable says how the incoming mail is
to be split into groups.
(setq nnmail-split-methods
'(("mail.junk" "^From:.*Lars Ingebrigtsen")
("mail.crazy" "^Subject:.*die\\|^Organization:.*flabby")
("mail.other" "")))
This variable is a list of lists, where the first element of each of
these lists is the name of the mail group (they do not have to be called
something beginning with ‘mail’, by the way), and the second
element is a regular expression used on the header of each mail to
determine if it belongs in this mail group. The first string may
contain ‘\\1’ forms, like the ones used by replace-match
to
insert sub-expressions from the matched text. For instance:
("list.\\1" "From:.* \\(.*\\)-list@majordomo.com")
In that case, nnmail-split-lowercase-expanded
controls whether
the inserted text should be made lowercase. See Fancy Mail Splitting.
The second element can also be a function. In that case, it will be
called narrowed to the headers with the first element of the rule as the
argument. It should return a non-nil
value if it thinks that the
mail belongs in that group.
The last of these groups should always be a general one, and the regular
expression should always be ‘""’ so that it matches any mails
that haven’t been matched by any of the other regexps. (These rules are
processed from the beginning of the alist toward the end. The first rule
to make a match will “win”, unless you have crossposting enabled. In
that case, all matching rules will “win”.) If no rule matched, the mail
will end up in the ‘bogus’ group. When new groups are created by
splitting mail, you may want to run gnus-group-find-new-groups
to
see the new groups. This also applies to the ‘bogus’ group.
If you like to tinker with this yourself, you can set this variable to a
function of your choice. This function will be called without any
arguments in a buffer narrowed to the headers of an incoming mail
message. The function should return a list of group names that it
thinks should carry this mail message.
This variable can also be a fancy split method. For the syntax,
see Fancy Mail Splitting.
Note that the mail back ends are free to maul the poor, innocent,
incoming headers all they want to. They all add Lines
headers;
some add X-Gnus-Group
headers; most rename the Unix mbox
FromSPC
line to something else.
The mail back ends all support cross-posting. If several regexps match,
the mail will be “cross-posted” to all those groups.
nnmail-crosspost
says whether to use this mechanism or not. Note
that no articles are crossposted to the general (‘""’) group.
nnmh
and nnml
makes crossposts by creating hard links to
the crossposted articles. However, not all file systems support hard
links. If that’s the case for you, set
nnmail-crosspost-link-function
to copy-file
. (This
variable is add-name-to-file
by default.)
If you wish to see where the previous mail split put the messages, you
can use the M-x nnmail-split-history command. If you wish to see
where re-spooling messages would put the messages, you can use
gnus-summary-respool-trace
and related commands (see Mail Group Commands).
Header lines longer than the value of
nnmail-split-header-length-limit
are excluded from the split
function.
By default, splitting does not decode headers, so you can not match on
non-ASCII strings. But it is useful if you want to match
articles based on the raw header data. To enable it, set the
nnmail-mail-splitting-decodes
variable to a non-nil
value.
In addition, the value of the nnmail-mail-splitting-charset
variable is used for decoding non-MIME encoded string when
nnmail-mail-splitting-decodes
is non-nil
. The default
value is nil
which means not to decode non-MIME encoded
string. A suitable value for you will be undecided
or be the
charset used normally in mails you are interested in.
By default, splitting is performed on all incoming messages. If you
specify a directory
entry for the variable mail-sources
(see Mail Source Specifiers), however, then splitting does
not happen by default. You can set the variable
nnmail-resplit-incoming
to a non-nil
value to make
splitting happen even in this case. (This variable has no effect on
other kinds of entries.)
Gnus gives you all the opportunity you could possibly want for shooting
yourself in the foot. Let’s say you create a group that will contain
all the mail you get from your boss. And then you accidentally
unsubscribe from the group. Gnus will still put all the mail from your
boss in the unsubscribed group, and so, when your boss mails you “Have
that report ready by Monday or you’re fired!”, you’ll never see it and,
come Tuesday, you’ll still believe that you’re gainfully employed while
you really should be out collecting empty bottles to save up for next
month’s rent money.
7.4.4 Mail Sources
Mail can be gotten from many different sources—the mail spool, from
a POP mail server, from a procmail directory, or from a
maildir, for instance.
7.4.4.1 Mail Source Specifiers
You tell Gnus how to fetch mail by setting mail-sources
(see Fetching Mail) to a mail source specifier.
Here’s an example:
(pop :server "pop3.mailserver.com" :user "myname")
As can be observed, a mail source specifier is a list where the first
element is a mail source type, followed by an arbitrary number of
keywords. Keywords that are not explicitly specified are given
default values.
The mail-sources
is global for all mail groups. You can specify
an additional mail source for a particular group by including the
group
mail specifier in mail-sources
, and setting a
mail-source
group parameter (see Group Parameters) specifying
a single mail source. When this is used, mail-sources
is
typically just ((group))
; the mail-source
parameter for a
group might look like this:
(mail-source . (file :path "home/user/spools/foo.spool"))
This means that the group’s (and only this group’s) messages will be
fetched from the spool file ‘/user/spools/foo.spool’.
The following mail source types are available:
file
Get mail from a single file; typically from the mail spool.
Keywords:
:path
The file name. Defaults to the value of the MAIL
environment variable or the value of rmail-spool-directory
(usually something like /usr/mail/spool/user-name).
:prescript
:postscript
Script run before/after fetching mail.
An example file mail source:
(file :path "/usr/spool/mail/user-name")
Or using the default file name:
If the mail spool file is not located on the local machine, it’s best
to use POP or IMAP or the like to fetch the mail.
You can not use ange-ftp file names here—it has no way to lock the
mail spool while moving the mail.
If it’s impossible to set up a proper server, you can use ssh instead.
(setq mail-sources
'((file :prescript "ssh host bin/getmail >%t")))
The ‘getmail’ script would look something like the following:
#!/bin/sh
# getmail - move mail from spool to stdout
# flu@iki.fi
MOVEMAIL=/usr/lib/emacs/20.3/i386-redhat-linux/movemail
TMP=$HOME/Mail/tmp
rm -f $TMP; $MOVEMAIL $MAIL $TMP >/dev/null && cat $TMP
Alter this script to fit the ‘movemail’ and temporary
file you want to use.
directory
¶
Get mail from several files in a directory. This is typically used
when you have procmail split the incoming mail into several files.
That is, there is a one-to-one correspondence between files in that
directory and groups, so that mail from the file foo.bar.spool
will be put in the group foo.bar
. (You can change the suffix
to be used instead of .spool
.) Setting
nnmail-scan-directory-mail-source-once
to non-nil
forces
Gnus to scan the mail source only once. This is particularly useful
if you want to scan mail groups at a specified level.
There is also the variable nnmail-resplit-incoming
, if you set
that to a non-nil
value, then the normal splitting process is
applied to all the files from the directory, Splitting Mail.
Keywords:
:path
The name of the directory where the files are. There is no default
value.
:suffix
Only files ending with this suffix are used. The default is
‘.spool’.
:predicate
Only files that have this predicate return non-nil
are returned.
The default is identity
. This is used as an additional
filter—only files that have the right suffix and satisfy this
predicate are considered.
:prescript
:postscript
Script run before/after fetching mail.
An example directory mail source:
(directory :path "/home/user-name/procmail-dir/"
:suffix ".prcml")
pop
Get mail from a POP server.
Keywords:
:server
The name of the POP server. The default is taken from the
MAILHOST
environment variable.
:port
The port number of the POP server. This can be a number (e.g.,
‘:port 1234’) or a string (e.g., ‘:port "pop3"’). If it is a
string, it should be a service name as listed in /etc/services on
Unix systems. The default is ‘"pop3"’. On some systems you might
need to specify it as ‘"pop-3"’ instead.
:user
The user name to give to the POP server. The default is the login
name.
:password
The password to give to the POP server. If not specified,
the user is prompted.
:program
The program to use to fetch mail from the POP server. This
should be a format
-like string. Here’s an example:
The valid format specifier characters are:
- ‘t’
The name of the file the mail is to be moved to. This must always be
included in this string.
- ‘s’
The name of the server.
- ‘P’
The port number of the server.
- ‘u’
The user name to use.
- ‘p’
The password to use.
The values used for these specs are taken from the values you give the
corresponding keywords.
:prescript
A script to be run before fetching the mail. The syntax is the same as
the :program
keyword. This can also be a function to be run.
One popular way to use this is to set up an SSH tunnel to access the
POP server. Here’s an example:
(pop :server "127.0.0.1"
:port 1234
:user "foo"
:password "secret"
:prescript
"nohup ssh -f -L 1234:pop.server:110 remote.host sleep 3600 &")
:postscript
A script to be run after fetching the mail. The syntax is the same as
the :program
keyword. This can also be a function to be run.
:function
The function to use to fetch mail from the POP server. The
function is called with one parameter—the name of the file where the
mail should be moved to.
:authentication
This can be either the symbol password
or the symbol apop
and says what authentication scheme to use. The default is
password
.
:leave
Non-nil
if the mail is to be left on the POP server
after fetching. Only the built-in pop3-movemail
program (the
default) supports this keyword.
If this is a number, leave mails on the server for this many days since
you first checked new mails. In that case, mails once fetched will
never be fetched again by the UIDL control. If this is
nil
(the default), mails will be deleted on the server right
after fetching. If this is neither nil
nor a number, all mails
will be left on the server, and you will end up getting the same mails
again and again.
The pop3-uidl-file
variable specifies the file to which the
UIDL data are locally stored. The default value is
~/.pop3-uidl.
Note that POP servers maintain no state information between
sessions, so what the client believes is there and what is actually
there may not match up. If they do not, then you may get duplicate
mails or the whole thing can fall apart and leave you with a corrupt
mailbox.
If the :program
and :function
keywords aren’t specified,
pop3-movemail
will be used.
Here are some examples for getting mail from a POP server.
Fetch from the default POP server, using the default user
name, and default fetcher:
Fetch from a named server with a named user and password:
(pop :server "my.pop.server"
:user "user-name" :password "secret")
Leave mails on the server for 14 days:
(pop :server "my.pop.server"
:user "user-name" :password "secret"
:leave 14)
Use ‘movemail’ to move the mail:
(pop :program "movemail po:%u %t %p")
maildir
Get mail from a maildir. This is a type of mailbox that is supported by
at least qmail and postfix, where each file in a special directory
contains exactly one mail.
Keywords:
:path
The name of the directory where the mails are stored. The default is
taken from the MAILDIR
environment variable or
~/Maildir/.
:subdirs
The subdirectories of the Maildir. The default is
‘("new" "cur")’.
You can also get mails from remote hosts (because maildirs don’t suffer
from locking problems).
Two example maildir mail sources:
(maildir :path "/home/user-name/Maildir/"
:subdirs ("cur" "new"))
(maildir :path "/user@remotehost.org:~/Maildir/"
:subdirs ("new"))
imap
Get mail from a IMAP server. If you don’t want to use
IMAP as intended, as a network mail reading protocol (i.e.,
with nnimap), for some reason or other, Gnus let you treat it similar
to a POP server and fetches articles from a given
IMAP mailbox. See Using IMAP, for more information.
Keywords:
:server
The name of the IMAP server. The default is taken from the
MAILHOST
environment variable.
:port
The port number of the IMAP server. The default is ‘143’, or
‘993’ for TLS/SSL connections.
:user
The user name to give to the IMAP server. The default is the login
name.
:password
The password to give to the IMAP server. If not specified, the user is
prompted.
:stream
What stream to use for connecting to the server, this is one of the
symbols in imap-stream-alist
. Right now, this means
‘gssapi’, ‘kerberos4’, ‘starttls’, ‘tls’,
‘ssl’, ‘shell’ or the default ‘network’.
:authentication
Which authenticator to use for authenticating to the server, this is
one of the symbols in imap-authenticator-alist
. Right now,
this means ‘gssapi’, ‘kerberos4’, ‘digest-md5’,
‘cram-md5’, ‘anonymous’ or the default ‘login’.
:program
When using the ‘shell’ :stream, the contents of this variable is
mapped into the imap-shell-program
variable. This should be a
format
-like string (or list of strings). Here’s an example:
Make sure nothing is interfering with the output of the program, e.g.,
don’t forget to redirect the error output to the void. The valid format
specifier characters are:
- ‘s’
The name of the server.
- ‘l’
User name from imap-default-user
.
- ‘p’
The port number of the server.
The values used for these specs are taken from the values you give the
corresponding keywords.
:mailbox
The name of the mailbox to get mail from. The default is ‘INBOX’
which normally is the mailbox which receives incoming mail. Instead of
a single mailbox, this can be a list of mailboxes to fetch mail from.
:predicate
The predicate used to find articles to fetch. The default, ‘UNSEEN
UNDELETED’, is probably the best choice for most people, but if you
sometimes peek in your mailbox with a IMAP client and mark some
articles as read (or; SEEN) you might want to set this to ‘1:*’.
Then all articles in the mailbox is fetched, no matter what. For a
complete list of predicates, see RFC 2060 section 6.4.4.
:fetchflag
How to flag fetched articles on the server, the default ‘\Deleted’
will mark them as deleted, an alternative would be ‘\Seen’ which
would simply mark them as read. These are the two most likely choices,
but more flags are defined in RFC 2060 section 2.3.2.
:dontexpunge
If non-nil
, don’t remove all articles marked as deleted in the
mailbox after finishing the fetch.
An example IMAP mail source:
(imap :server "mail.mycorp.com"
:stream kerberos4
:fetchflag "\\Seen")
group
Get the actual mail source from the mail-source
group parameter,
See Group Parameters.
- Common Keywords
Common keywords can be used in any type of mail source.
Keywords:
:plugged
If non-nil
, fetch the mail even when Gnus is unplugged. If you
use directory source to get mail, you can specify it as in this
example:
(setq mail-sources
'((directory :path "/home/pavel/.Spool/"
:suffix ""
:plugged t)))
Gnus will then fetch your mail even when you are unplugged. This is
useful when you use local mail and news.
7.4.4.2 Function Interface
Some of the above keywords specify a Lisp function to be executed.
For each keyword :foo
, the Lisp variable foo
is bound to
the value of the keyword while the function is executing. For example,
consider the following mail-source setting:
(setq mail-sources '((pop :user "jrl"
:server "pophost" :function fetchfunc)))
While the function fetchfunc
is executing, the symbol user
is bound to "jrl"
, and the symbol server
is bound to
"pophost"
. The symbols port
, password
,
program
, prescript
, postscript
, function
,
and authentication
are also bound (to their default values).
See above for a list of keywords for each type of mail source.
7.4.4.3 Mail Source Customization
The following is a list of variables that influence how the mail is
fetched. You would normally not need to set or change any of these
variables.
mail-source-crash-box
¶
File where mail will be stored while processing it. The default is
~/.emacs-mail-crash-box.
mail-source-delete-incoming
¶
If non-nil
, delete incoming files after handling them. If
t
, delete the files immediately, if nil
, never delete any
files. If a positive number, delete files older than number of days
(the deletion will only happen when receiving new mail). You may also
set mail-source-delete-incoming
to nil
and call
mail-source-delete-old-incoming
from a hook or interactively.
mail-source-delete-incoming
defaults to 10
in alpha Gnusae
and 2
in released Gnusae. See Gnus Development.
mail-source-delete-old-incoming-confirm
¶
If non-nil
, ask for confirmation before deleting old incoming
files. This variable only applies when
mail-source-delete-incoming
is a positive number.
mail-source-ignore-errors
¶
If non-nil
, ignore errors when reading mail from a mail source.
mail-source-directory
¶
Directory where incoming mail source files (if any) will be stored. The
default is ~/Mail/. At present, the only thing this is used for
is to say where the incoming files will be stored if the variable
mail-source-delete-incoming
is nil
or a number.
mail-source-incoming-file-prefix
¶
Prefix for file name for storing incoming mail. The default is
Incoming, in which case files will end up with names like
Incoming30630D_ or Incoming298602ZD. This is really only
relevant if mail-source-delete-incoming
is nil
or a
number.
mail-source-default-file-modes
¶
All new mail files will get this file mode. The default is #o600
.
mail-source-movemail-program
¶
If non-nil
, name of program for fetching new mail. If
nil
, movemail
in exec-directory
.
7.4.4.4 Fetching Mail
The way to actually tell Gnus where to get new mail from is to set
mail-sources
to a list of mail source specifiers
(see Mail Source Specifiers).
If this variable is nil
, the mail back ends will never attempt to
fetch mail by themselves.
If you want to fetch mail both from your local spool as well as a
POP mail server, you’d say something like:
(setq mail-sources
'((file)
(pop :server "pop3.mail.server"
:password "secret")))
Or, if you don’t want to use any of the keyword defaults:
(setq mail-sources
'((file :path "/var/spool/mail/user-name")
(pop :server "pop3.mail.server"
:user "user-name"
:port "pop3"
:password "secret")))
When you use a mail back end, Gnus will slurp all your mail from your
inbox and plonk it down in your home directory. Gnus doesn’t move any
mail if you’re not using a mail back end—you have to do a lot of magic
invocations first. At the time when you have finished drawing the
pentagram, lightened the candles, and sacrificed the goat, you really
shouldn’t be too surprised when Gnus moves your mail.
7.4.5 Mail Back End Variables
These variables are (for the most part) pertinent to all the various
mail back ends.
-
nnmail-read-incoming-hook
The mail back ends all call this hook after reading new mail. You can
use this hook to notify any mail watch programs, if you want to.
nnmail-split-hook
¶
-
Hook run in the buffer where the mail headers of each message is kept
just before the splitting based on these headers is done. The hook is
free to modify the buffer contents in any way it sees fit—the buffer
is discarded after the splitting has been done, and no changes performed
in the buffer will show up in any files.
gnus-article-decode-encoded-words
is one likely function to add
to this hook.
nnmail-pre-get-new-mail-hook
nnmail-post-get-new-mail-hook
These are two useful hooks executed when treating new incoming
mail—nnmail-pre-get-new-mail-hook
(is called just before
starting to handle the new mail) and
nnmail-post-get-new-mail-hook
(is called when the mail handling
is done). Here’s and example of using these two hooks to change the
default file modes the new mail files get:
(add-hook 'nnmail-pre-get-new-mail-hook
(lambda () (set-default-file-modes #o700)))
(add-hook 'nnmail-post-get-new-mail-hook
(lambda () (set-default-file-modes #o775)))
nnmail-use-long-file-names
¶
If non-nil
, the mail back ends will use long file and directory
names. Groups like ‘mail.misc’ will end up in directories
(assuming use of nnml
back end) or files (assuming use of
nnfolder
back end) like mail.misc. If it is nil
,
the same group will end up in mail/misc.
nnmail-delete-file-function
¶
-
Function called to delete files. It is delete-file
by default.
nnmail-cache-accepted-message-ids
¶
If non-nil
, put the Message-ID
s of articles imported into
the back end (via Gcc
, for instance) into the mail duplication
discovery cache. The default is nil
.
nnmail-cache-ignore-groups
¶
This can be a regular expression or a list of regular expressions.
Group names that match any of the regular expressions will never be
recorded in the Message-ID
cache.
This can be useful, for example, when using Fancy Splitting
(see Fancy Mail Splitting) together with the function
nnmail-split-fancy-with-parent
.
7.4.6 Fancy Mail Splitting
If the rather simple, standard method for specifying how to split mail
doesn’t allow you to do what you want, you can set
nnmail-split-methods
to nnmail-split-fancy
. Then you can
play with the nnmail-split-fancy
variable.
Let’s look at an example value of this variable first:
;; Messages from the mailer daemon are not crossposted to any of
;; the ordinary groups. Warnings are put in a separate group
;; from real errors.
(| ("from" mail (| ("subject" "warn.*" "mail.warning")
"mail.misc"))
;; Non-error messages are crossposted to all relevant
;; groups, but we don’t crosspost between the group for the
;; (ding) list and the group for other (ding) related mail.
(& (| (any "ding@ifi\\.uio\\.no" "ding.list")
("subject" "ding" "ding.misc"))
;; Other mailing lists…
(any "procmail@informatik\\.rwth-aachen\\.de" "procmail.list")
(any "SmartList@informatik\\.rwth-aachen\\.de" "SmartList.list")
;; Both lists below have the same suffix, so prevent
;; cross-posting to mkpkg.list of messages posted only to
;; the bugs- list, but allow cross-posting when the
;; message was really cross-posted.
(any "bugs-mypackage@somewhere" "mypkg.bugs")
(any "mypackage@somewhere" - "bugs-mypackage" "mypkg.list")
;; People…
(any "larsi@ifi\\.uio\\.no" "people.Lars_Magne_Ingebrigtsen"))
;; Unmatched mail goes to the catch all group.
"misc.misc")
This variable has the format of a split. A split is a
(possibly) recursive structure where each split may contain other
splits. Here are the possible split syntaxes:
group
If the split is a string, that will be taken as a group name. Normal
regexp match expansion will be done. See below for examples.
(field value [- restrict […] ] split [invert-partial])
The split can be a list containing at least three elements. If the
first element field (a regexp matching a header) contains
value (also a regexp) then store the message as specified by
split.
If restrict (yet another regexp) matches some string after
field and before the end of the matched value, the
split is ignored. If none of the restrict clauses match,
split is processed.
The last element invert-partial is optional. If it is
non-nil
, the match-partial-words behavior controlled by the
variable nnmail-split-fancy-match-partial-words
(see below) is
be inverted. (New in Gnus 5.10.7)
(| split …)
If the split is a list, and the first element is |
(vertical
bar), then process each split until one of them matches. A
split is said to match if it will cause the mail message to be
stored in one or more groups.
(& split …)
If the split is a list, and the first element is &
, then
process all splits in the list.
junk
If the split is the symbol junk
, then don’t save (i.e., delete)
this message. Use with extreme caution.
(: function arg1 arg2 …)
If the split is a list, and the first element is ‘:’, then the
second element will be called as a function with args given as
arguments. The function should return a split.
For instance, the following function could be used to split based on the
body of the messages:
(defun split-on-body ()
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(when (re-search-forward "Some.*string" nil t)
"string.group"))))
The buffer is narrowed to the header of the message in question when
function is run. That’s why (widen)
needs to be called
after save-excursion
and save-restriction
in the example
above. Also note that with the nnimap backend, message bodies will
not be downloaded by default. You need to set
nnimap-split-download-body
to t
to do that
(see Client-Side IMAP Splitting).
(! func split)
If the split is a list, and the first element is !
, then
split will be processed, and func will be called as a
function with the result of split as argument. func
should return a split.
nil
If the split is nil
, it is ignored.
In these splits, field must match a complete field name.
Normally, value in these splits must match a complete word
according to the fundamental mode syntax table. In other words, all
value’s will be implicitly surrounded by \<...\>
markers,
which are word delimiters. Therefore, if you use the following split,
for example,
messages sent from ‘joedavis@foo.org’ will normally not be filed
in ‘joemail’. If you want to alter this behavior, you can use any
of the following three ways:
-
You can set the
nnmail-split-fancy-match-partial-words
variable
to non-nil
in order to ignore word boundaries and instead the
match becomes more like a grep. This variable controls whether partial
words are matched during fancy splitting. The default value is
nil
.
Note that it influences all value’s in your split rules.
- value beginning with
.*
ignores word boundaries in front of
a word. Similarly, if value ends with .*
, word boundaries
in the rear of a word will be ignored. For example, the value
"@example\\.com"
does not match ‘foo@example.com’ but
".*@example\\.com"
does.
- You can set the invert-partial flag in your split rules of the
‘(field value …)’ types, aforementioned in this
section. If the flag is set, word boundaries on both sides of a word
are ignored even if
nnmail-split-fancy-match-partial-words
is
nil
. Contrarily, if the flag is set, word boundaries are not
ignored even if nnmail-split-fancy-match-partial-words
is
non-nil
. (New in Gnus 5.10.7)
field and value can also be Lisp symbols, in that case
they are expanded as specified by the variable
nnmail-split-abbrev-alist
. This is an alist of cons cells,
where the CAR of a cell contains the key, and the CDR
contains the associated value. Predefined entries in
nnmail-split-abbrev-alist
include:
from
Matches the ‘From’, ‘Sender’ and ‘Resent-From’ fields.
to
Matches the ‘To’, ‘Cc’, ‘Apparently-To’,
‘Resent-To’ and ‘Resent-Cc’ fields.
any
Is the union of the from
and to
entries.
list
Matches the ‘List-ID’, ‘List-Post’, ‘X-Mailing-List’,
‘X-BeenThere’ and ‘X-Loop’ fields.
nnmail-split-fancy-syntax-table
is the syntax table in effect
when all this splitting is performed.
If you want to have Gnus create groups dynamically based on some
information in the headers (i.e., do replace-match
-like
substitutions in the group names), you can say things like:
(any "debian-\\b\\(\\w+\\)@lists.debian.org" "mail.debian.\\1")
In this example, messages sent to ‘debian-foo@lists.debian.org’
will be filed in ‘mail.debian.foo’.
If the string contains the element ‘\\&’, then the previously
matched string will be substituted. Similarly, the elements ‘\\1’
up to ‘\\9’ will be substituted with the text matched by the
groupings 1 through 9.
Where nnmail-split-lowercase-expanded
controls whether the
lowercase of the matched string should be used for the substitution.
Setting it as non-nil
is useful to avoid the creation of multiple
groups when users send to an address using different case
(i.e., mailing-list@domain vs Mailing-List@Domain). The default value
is t
.
nnmail-split-fancy-with-parent
is a function which allows you to
split followups into the same groups their parents are in. Sometimes
you can’t make splitting rules for all your mail. For example, your
boss might send you personal mail regarding different projects you are
working on, and as you can’t tell your boss to put a distinguishing
string into the subject line, you have to resort to manually moving the
messages into the right group. With this function, you only have to do
it once per thread.
To use this feature, you have to set nnmail-treat-duplicates
and nnmail-cache-accepted-message-ids
to a non-nil
value. And then you can include nnmail-split-fancy-with-parent
using the colon feature, like so:
(setq nnmail-treat-duplicates 'warn ; or delete
nnmail-cache-accepted-message-ids t
nnmail-split-fancy
'(| (: nnmail-split-fancy-with-parent)
;; other splits go here
))
This feature works as follows: when nnmail-treat-duplicates
is
non-nil
, Gnus records the message id of every message it sees
in the file specified by the variable
nnmail-message-id-cache-file
, together with the group it is in
(the group is omitted for non-mail messages). When mail splitting is
invoked, the function nnmail-split-fancy-with-parent
then looks
at the References (and In-Reply-To) header of each message to split
and searches the file specified by nnmail-message-id-cache-file
for the message ids. When it has found a parent, it returns the
corresponding group name unless the group name matches the regexp
nnmail-split-fancy-with-parent-ignore-groups
. It is
recommended that you set nnmail-message-id-cache-length
to a
somewhat higher number than the default so that the message ids are
still in the cache. (A value of 5000 appears to create a file some
300 kBytes in size.)
When nnmail-cache-accepted-message-ids
is non-nil
, Gnus
also records the message ids of moved articles, so that the followup
messages goes into the new group.
Also see the variable nnmail-cache-ignore-groups
if you don’t
want certain groups to be recorded in the cache. For example, if all
outgoing messages are written to an “outgoing” group, you could set
nnmail-cache-ignore-groups
to match that group name.
Otherwise, answers to all your messages would end up in the
“outgoing” group.
If nnmail-debug-splitting
is non-nil
, the mail splitting
code will log all splitting decisions to the ‘*nnmail split*’ buffer.
7.4.7 Group Mail Splitting
If you subscribe to dozens of mailing lists but you don’t want to
maintain mail splitting rules manually, group mail splitting is for you.
You just have to set to-list
and/or to-address
in group
parameters or group customization and set nnmail-split-methods
to
gnus-group-split
. This splitting function will scan all groups
for those parameters and split mail accordingly, i.e., messages posted
from or to the addresses specified in the parameters to-list
or
to-address
of a mail group will be stored in that group.
Sometimes, mailing lists have multiple addresses, and you may want mail
splitting to recognize them all: just set the extra-aliases
group
parameter to the list of additional addresses and it’s done. If you’d
rather use a regular expression, set split-regexp
.
All these parameters in a group will be used to create an
nnmail-split-fancy
split, in which the field is ‘any’,
the value is a single regular expression that matches
to-list
, to-address
, all of extra-aliases
and all
matches of split-regexp
, and the split is the name of the
group. restricts are also supported: just set the
split-exclude
parameter to a list of regular expressions.
If you can’t get the right split to be generated using all these
parameters, or you just need something fancier, you can set the
parameter split-spec
to an nnmail-split-fancy
split. In
this case, all other aforementioned parameters will be ignored by
gnus-group-split
. In particular, split-spec
may be set to
nil
, in which case the group will be ignored by
gnus-group-split
.
gnus-group-split
will do cross-posting on all groups that match,
by defining a single &
fancy split containing one split for each
group. If a message doesn’t match any split, it will be stored in the
group named in gnus-group-split-default-catch-all-group
, unless
some group has split-spec
set to catch-all
, in which case
that group is used as the catch-all group. Even though this variable is
often used just to name a group, it may also be set to an arbitrarily
complex fancy split (after all, a group name is a fancy split), and this
may be useful to split mail that doesn’t go to any mailing list to
personal mail folders. Note that this fancy split is added as the last
element of a |
split list that also contains a &
split
with the rules extracted from group parameters.
It’s time for an example. Assume the following group parameters have
been defined:
nnml:mail.bar:
((to-address . "bar@femail.com")
(split-regexp . ".*@femail\\.com"))
nnml:mail.foo:
((to-list . "foo@nowhere.gov")
(extra-aliases "foo@localhost" "foo-redist@home")
(split-exclude "bugs-foo" "rambling-foo")
(admin-address . "foo-request@nowhere.gov"))
nnml:mail.others:
((split-spec . catch-all))
Setting nnmail-split-methods
to gnus-group-split
will
behave as if nnmail-split-fancy
had been selected and variable
nnmail-split-fancy
had been set as follows:
(| (& (any "\\(bar@femail\\.com\\|.*@femail\\.com\\)" "mail.bar")
(any "\\(foo@nowhere\\.gov\\|foo@localhost\\|foo-redist@home\\)"
- "bugs-foo" - "rambling-foo" "mail.foo"))
"mail.others")
If you’d rather not use group splitting for all your mail groups, you
may use it for only some of them, by using nnmail-split-fancy
splits like this:
(: gnus-group-split-fancy groups no-crosspost catch-all)
groups may be a regular expression or a list of group names whose
parameters will be scanned to generate the output split.
no-crosspost can be used to disable cross-posting; in this case, a
single |
split will be output. catch-all is the fall back
fancy split, used like gnus-group-split-default-catch-all-group
.
If catch-all is nil
, or if split-regexp
matches the
empty string in any selected group, no catch-all split will be issued.
Otherwise, if some group has split-spec
set to catch-all
,
this group will override the value of the catch-all argument.
Unfortunately, scanning all groups and their parameters can be quite
slow, especially considering that it has to be done for every message.
But don’t despair! The function gnus-group-split-setup
can be
used to enable gnus-group-split
in a much more efficient way. It
sets nnmail-split-methods
to nnmail-split-fancy
and sets
nnmail-split-fancy
to the split produced by
gnus-group-split-fancy
. Thus, the group parameters are only
scanned once, no matter how many messages are split.
However, if you change group parameters, you’d have to update
nnmail-split-fancy
manually. You can do it by running
gnus-group-split-update
. If you’d rather have it updated
automatically, just tell gnus-group-split-setup
to do it for
you. For example, add to your ~/.gnus.el:
(gnus-group-split-setup auto-update catch-all)
If auto-update is non-nil
, gnus-group-split-update
will be added to gnus-get-top-new-news-hook
, so you won’t ever
have to worry about updating nnmail-split-fancy
again. If you
don’t omit catch-all (it’s optional, equivalent to nil
),
gnus-group-split-default-catch-all-group
will be set to its
value.
Because you may want to change nnmail-split-fancy
after it is set
by gnus-group-split-update
, this function will run
gnus-group-split-updated-hook
just before finishing.
7.4.8 Incorporating Old Mail
Most people have lots of old mail stored in various file formats. If
you have set up Gnus to read mail using one of the spiffy Gnus mail
back ends, you’ll probably wish to have that old mail incorporated into
your mail groups.
Doing so can be quite easy.
To take an example: You’re reading mail using nnml
(see Mail Spool), and have set nnmail-split-methods
to a
satisfactory value (see Splitting Mail). You have an old Unix mbox
file filled with important, but old, mail. You want to move it into
your nnml
groups.
Here’s how:
- Go to the group buffer.
- Type G f and give the file name to the mbox file when prompted to create an
nndoc
group from the mbox file (see Foreign Groups).
- Type SPC to enter the newly created group.
- Type M P b to process-mark all articles in this group’s buffer
(see Setting Process Marks).
- Type B r to respool all the process-marked articles, and answer
‘nnml’ when prompted (see Mail Group Commands).
All the mail messages in the mbox file will now also be spread out over
all your nnml
groups. Try entering them and check whether things
have gone without a glitch. If things look ok, you may consider
deleting the mbox file, but I wouldn’t do that unless I was absolutely
sure that all the mail has ended up where it should be.
Respooling is also a handy thing to do if you’re switching from one mail
back end to another. Just respool all the mail in the old mail groups
using the new mail back end.
7.4.9 Expiring Mail
Traditional mail readers have a tendency to remove mail articles when
you mark them as read, in some way. Gnus takes a fundamentally
different approach to mail reading.
Gnus basically considers mail just to be news that has been received in
a rather peculiar manner. It does not think that it has the power to
actually change the mail, or delete any mail messages. If you enter a
mail group, and mark articles as “read”, or kill them in some other
fashion, the mail articles will still exist on the system. I repeat:
Gnus will not delete your old, read mail. Unless you ask it to, of
course.
To make Gnus get rid of your unwanted mail, you have to mark the
articles as expirable. (With the default key bindings, this means
that you have to type E.) This does not mean that the articles
will disappear right away, however. In general, a mail article will be
deleted from your system if, 1) it is marked as expirable, AND 2) it is
more than one week old. If you do not mark an article as expirable, it
will remain on your system until hell freezes over. This bears
repeating one more time, with some spurious capitalizations: IF you do
NOT mark articles as EXPIRABLE, Gnus will NEVER delete those ARTICLES.
You do not have to mark articles as expirable by hand. Gnus provides
two features, called “auto-expire” and “total-expire”, that can help you
with this. In a nutshell, “auto-expire” means that Gnus hits E
for you when you select an article. And “total-expire” means that Gnus
considers all articles as expirable that are read. So, in addition to
the articles marked ‘E’, also the articles marked ‘r’,
‘R’, ‘O’, ‘K’, ‘Y’ (and so on) are considered
expirable. gnus-auto-expirable-marks
has the full list of
these marks.
When should either auto-expire or total-expire be used? Most people
who are subscribed to mailing lists split each list into its own group
and then turn on auto-expire or total-expire for those groups.
(See Splitting Mail, for more information on splitting each list
into its own group.)
Which one is better, auto-expire or total-expire? It’s not easy to
answer. Generally speaking, auto-expire is probably faster. Another
advantage of auto-expire is that you get more marks to work with: for
the articles that are supposed to stick around, you can still choose
between tick and dormant and read marks. But with total-expire, you
only have dormant and ticked to choose from. The advantage of
total-expire is that it works well with adaptive scoring (see Adaptive Scoring). Auto-expire works with normal scoring but not with adaptive
scoring.
Groups that match the regular expression
gnus-auto-expirable-newsgroups
will have all articles that you
read marked as expirable automatically. All articles marked as
expirable have an ‘E’ in the first column in the summary buffer.
By default, if you have auto expiry switched on, Gnus will mark all the
articles you read as expirable, no matter if they were read or unread
before. To avoid having articles marked as read marked as expirable
automatically, you can put something like the following in your
~/.gnus.el file:
(remove-hook 'gnus-mark-article-hook
'gnus-summary-mark-read-and-unread-as-read)
(add-hook 'gnus-mark-article-hook 'gnus-summary-mark-unread-as-read)
Note that making a group auto-expirable doesn’t mean that all read
articles are expired—only the articles marked as expirable
will be expired. Also note that using the d command won’t make
articles expirable—only semi-automatic marking of articles as read will
mark the articles as expirable in auto-expirable groups.
Let’s say you subscribe to a couple of mailing lists, and you want the
articles you have read to disappear after a while:
(setq gnus-auto-expirable-newsgroups
"mail.nonsense-list\\|mail.nice-list")
Another way to have auto-expiry happen is to have the element
auto-expire
in the group parameters of the group.
If you use adaptive scoring (see Adaptive Scoring) and
auto-expiring, you’ll have problems. Auto-expiring and adaptive scoring
don’t really mix very well.
The nnmail-expiry-wait
variable supplies the default time an
expirable article has to live. The value of this variable can be
either a number of days (not necessarily an integer), or one of the
symbols immediate
or never
, meaning an article is
immediately or never expirable, respectively.
Gnus starts counting days from when the message arrived, not
from when it was sent. The default is seven days.
The nnmail-expiry-wait-function
variable lets you fine-tune how
long articles are to live, based on what group they are in. When set
to a function, its returned value, if non-nil
, overrides that
of nnmail-expiry-wait
. Otherwise, the value of
nnmail-expiry-wait
is used instead.
For example, let’s say you want to have a one month expiry period in
the ‘mail.private’ group, a one day expiry period in the
‘mail.junk’ group, and a six day expiry period everywhere else.
This can be achieved as follows:
(setq nnmail-expiry-wait-function
(lambda (group)
(cond ((string= group "mail.private")
31)
((string= group "mail.junk")
1)
((string= group "important")
'never)
(t
6))))
The group names this function is fed are “unadorned” group
names—no ‘nnml:’ prefixes and the like.
As an alternative to the variables nnmail-expiry-wait
or
nnmail-expiry-wait-function
, you can also use the
expiry-wait
group parameter to selectively change the expiry
period (see Group Parameters).
The normal action taken when expiring articles is to delete them.
However, in some circumstances it might make more sense to move them
to other groups instead of deleting them. The variable
nnmail-expiry-target
(and the expiry-target
group
parameter) controls this. The variable supplies a default value for
all groups, which can be overridden for specific groups by the group
parameter. default value is delete
, but this can also be a
string (which should be the name of the group the message should be
moved to), or a function (which will be called in a buffer narrowed to
the message in question, and with the name of the group being moved
from as its parameter) which should return a target—either a group
name or delete
.
Here’s an example for specifying a group name:
(setq nnmail-expiry-target "nnml:expired")
Gnus provides a function nnmail-fancy-expiry-target
which will
expire mail to groups according to the variable
nnmail-fancy-expiry-targets
. Here’s an example:
(setq nnmail-expiry-target 'nnmail-fancy-expiry-target
nnmail-fancy-expiry-targets
'((to-from "boss" "nnfolder:Work")
("subject" "IMPORTANT" "nnfolder:IMPORTANT.%Y.%b")
("from" ".*" "nnfolder:Archive-%Y")))
With this setup, any mail that has IMPORTANT
in its Subject
header and was sent in the year YYYY
and month MMM
, will
get expired to the group nnfolder:IMPORTANT.YYYY.MMM
. If its
From or To header contains the string boss
, it will get expired
to nnfolder:Work
. All other mail will get expired to
nnfolder:Archive-YYYY
.
If nnmail-keep-last-article
is non-nil
, Gnus will never
expire the final article in a mail newsgroup. This is to make life
easier for procmail users.
By the way: That line up there, about Gnus never expiring non-expirable
articles, is a lie. If you put total-expire
in the group
parameters, articles will not be marked as expirable, but all read
articles will be put through the expiry process. Use with extreme
caution. Even more dangerous is the
gnus-total-expirable-newsgroups
variable. All groups that match
this regexp will have all read articles put through the expiry process,
which means that all old mail articles in the groups in question
will be deleted after a while. Use with extreme caution, and don’t come
crying to me when you discover that the regexp you used matched the
wrong group and all your important mail has disappeared. Be a
man! Or a woman! Whatever you feel more comfortable
with! So there!
Most people make most of their mail groups total-expirable, though.
If gnus-inhibit-user-auto-expire
is non-nil
, user marking
commands will not mark an article as expirable, even if the group has
auto-expire turned on.
The expirable marks of articles will be removed when copying or moving
them to a group in which auto-expire is not turned on. This is for
preventing articles from being expired unintentionally. On the other
hand, to a group that has turned auto-expire on, the expirable marks of
articles that are copied or moved will not be changed by default. I.e.,
when copying or moving to such a group, articles that were expirable
will be left expirable and ones that were not expirable will not be
marked as expirable. So, even though in auto-expire groups, some
articles will never get expired (unless you read them again). If you
don’t side with that behavior that unexpirable articles may be mixed
into auto-expire groups, you can set
gnus-mark-copied-or-moved-articles-as-expirable
to a
non-nil
value. In that case, articles that have been read will
be marked as expirable automatically when being copied or moved to a
group that has auto-expire turned on. The default value is nil
.
7.4.10 Washing Mail
Mailers and list servers are notorious for doing all sorts of really,
really stupid things with mail. “Hey, RFC 822 doesn’t explicitly
prohibit us from adding the string wE aRe ElItE!!!!!1!!
to the
end of all lines passing through our server, so let’s do that!!!!1!”
Yes, but RFC 822 and its successors weren’t designed to be read by
morons. Things that were considered to be self-evident were not
discussed. So. Here we are.
Case in point: The German version of Microsoft Exchange adds ‘AW:
’ to the subjects of replies instead of ‘Re: ’. I could pretend to
be shocked and dismayed by this, but I haven’t got the energy. It is to
laugh.
Gnus provides a plethora of functions for washing articles while
displaying them, but it might be nicer to do the filtering before
storing the mail to disk. For that purpose, we have three hooks and
various functions that can be put in these hooks.
nnmail-prepare-incoming-hook
¶
This hook is called before doing anything with the mail and is meant for
grand, sweeping gestures. It is called in a buffer that contains all
the new, incoming mail. Functions to be used include:
Remove trailing carriage returns from each line. This is default on
Emacs running on MS machines.
This hook is called narrowed to each header. It can be used when
cleaning up the headers. Functions that can be used include:
nnmail-remove-leading-whitespace
¶
Clear leading white space that “helpful” listservs have added to the
headers to make them look nice. Aaah.
(Note that this function works on both the header and the body of all
messages, so it is a potentially dangerous function to use (if a body
of a message contains something that looks like a header line). So
rather than fix the bug, it is of course the right solution to make it
into a feature by documenting it.)
nnmail-remove-list-identifiers
¶
Some list servers add an identifier—for example, ‘(idm)’—to the
beginning of all Subject
headers. I’m sure that’s nice for
people who use stone age mail readers. This function will remove
strings that match the nnmail-list-identifiers
regexp, which can
also be a list of regexp. nnmail-list-identifiers
may not contain
\\(..\\)
.
For instance, if you want to remove the ‘(idm)’ and the
‘nagnagnag’ identifiers:
(setq nnmail-list-identifiers
'("(idm)" "nagnagnag"))
This can also be done non-destructively with
gnus-list-identifiers
, See Article Hiding.
nnmail-remove-tabs
¶
Translate all ‘TAB’ characters into ‘SPC’ characters.
nnmail-ignore-broken-references
¶
-
Some mail user agents (e.g., Eudora and Pegasus) produce broken
References
headers, but correct In-Reply-To
headers. This
function will get rid of the References
header if the headers
contain a line matching the regular expression
nnmail-broken-references-mailers
.
nnmail-prepare-incoming-message-hook
¶
This hook is called narrowed to each message. Functions to be used
include:
article-de-quoted-unreadable
¶
Decode Quoted Readable encoding.
7.4.11 Duplicates
If you are a member of a couple of mailing lists, you will sometimes
receive two copies of the same mail. This can be quite annoying, so
nnmail
checks for and treats any duplicates it might find. To do
this, it keeps a cache of old Message-ID
s:
nnmail-message-id-cache-file
, which is ~/.nnmail-cache by
default. The approximate maximum number of Message-ID
s stored
there is controlled by the nnmail-message-id-cache-length
variable, which is 1000 by default. (So 1000 Message-ID
s will be
stored.) If all this sounds scary to you, you can set
nnmail-treat-duplicates
to warn
(which is what it is by
default), and nnmail
won’t delete duplicate mails. Instead it
will insert a warning into the head of the mail saying that it thinks
that this is a duplicate of a different message.
This variable can also be a function. If that’s the case, the function
will be called from a buffer narrowed to the message in question with
the Message-ID
as a parameter. The function must return either
nil
, warn
, or delete
.
You can turn this feature off completely by setting the variable to
nil
.
If you want all the duplicate mails to be put into a special
duplicates group, you could do that using the normal mail split
methods:
(setq nnmail-split-fancy
'(| ;; Messages duplicates go to a separate group.
("gnus-warning" "duplicat\\(e\\|ion\\) of message" "duplicate")
;; Message from daemons, postmaster, and the like to another.
(any mail "mail.misc")
;; Other rules.
[...] ))
Or something like:
(setq nnmail-split-methods
'(("duplicates" "^Gnus-Warning:.*duplicate")
;; Other rules.
[...]))
Here’s a neat feature: If you know that the recipient reads her mail
with Gnus, and that she has nnmail-treat-duplicates
set to
delete
, you can send her as many insults as you like, just by
using a Message-ID
of a mail that you know that she’s already
received. Think of all the fun! She’ll never see any of it! Whee!
7.4.12 Not Reading Mail
If you start using any of the mail back ends, they have the annoying
habit of assuming that you want to read mail with them. This might not
be unreasonable, but it might not be what you want.
If you set mail-sources
to nil
, none of the back ends
will ever attempt to read incoming mail, which should help.
This might be too much, if, for instance, you are reading mail quite
happily with nnml
and just want to peek at some old (pre-Emacs
23) Rmail file you have stashed away with nnbabyl
. All back ends have
variables called back-end-get-new-mail
. If you want to disable
the nnbabyl
mail reading, you edit the virtual server for the
group to have a setting where nnbabyl-get-new-mail
to nil
.
All the mail back ends will call nn
*-prepare-save-mail-hook
narrowed to the article to be saved before saving it when reading
incoming mail.
7.4.13 Choosing a Mail Back End
Gnus will read the mail spool when you activate a mail group. The mail
file is first copied to your home directory. What happens after that
depends on what format you want to store your mail in.
There are six different mail back ends in the standard Gnus, and more
back ends are available separately. The mail back end most people use
(because it is possibly the fastest) is nnml
(see Mail Spool).
7.4.13.1 Unix Mail Box
The nnmbox back end will use the standard Un*x mbox file to store
mail. nnmbox
will add extra headers to each mail article to say
which group it belongs in.
Virtual server settings:
nnmbox-mbox-file
¶
The name of the mail box in the user’s home directory. Default is
~/mbox.
nnmbox-active-file
¶
The name of the active file for the mail box. Default is
~/.mbox-active.
nnmbox-get-new-mail
¶
If non-nil
, nnmbox
will read incoming mail and split it
into groups. Default is t
.
7.4.13.2 Babyl
The nnbabyl back end will use a Babyl mail box to store mail.
nnbabyl
will add extra headers to each mail article to say which
group it belongs in.
Virtual server settings:
nnbabyl-mbox-file
¶
The name of the Babyl file. The default is ~/RMAIL
nnbabyl-active-file
¶
The name of the active file for the Babyl file. The default is
~/.rmail-active
nnbabyl-get-new-mail
¶
If non-nil
, nnbabyl
will read incoming mail. Default is
t
7.4.13.3 Mail Spool
The nnml spool mail format isn’t compatible with any other known
format. It should be used with some caution.
If you use this back end, Gnus will split all incoming mail into files,
one file for each mail, and put the articles into the corresponding
directories under the directory specified by the nnml-directory
variable. The default value is ~/Mail/.
You do not have to create any directories beforehand; Gnus will take
care of all that.
If you have a strict limit as to how many files you are allowed to store
in your account, you should not use this back end. As each mail gets its
own file, you might very well occupy thousands of inodes within a few
weeks. If this is no problem for you, and it isn’t a problem for you
having your friendly systems administrator walking around, madly,
shouting “Who is eating all my inodes?! Who? Who!?!”, then you should
know that this is probably the fastest format to use. You do not have
to trudge through a big mbox file just to read your new mail.
nnml
is probably the slowest back end when it comes to article
splitting. It has to create lots of files, and it also generates
NOV databases for the incoming mails. This makes it possibly the
fastest back end when it comes to reading mail.
Virtual server settings:
nnml-directory
¶
All nnml
directories will be placed under this directory. The
default is the value of message-directory
(whose default value
is ~/Mail).
nnml-active-file
¶
The active file for the nnml
server. The default is
~/Mail/active.
nnml-newsgroups-file
¶
The nnml
group descriptions file. See Newsgroups File Format. The default is ~/Mail/newsgroups.
nnml-get-new-mail
¶
If non-nil
, nnml
will read incoming mail. The default is
t
.
nnml-nov-is-evil
¶
If non-nil
, this back end will ignore any NOV files. The
default is nil
.
nnml-nov-file-name
¶
The name of the NOV files. The default is .overview.
nnml-prepare-save-mail-hook
¶
Hook run narrowed to an article before saving.
nnml-use-compressed-files
¶
If non-nil
, nnml
will allow using compressed message
files. This requires auto-compression-mode
to be enabled
(see Compressed Files in The Emacs Manual).
If the value of nnml-use-compressed-files
is a string, it is used
as the file extension specifying the compression program. You can set it
to ‘.bz2’ if your Emacs supports it. A value of t
is
equivalent to ‘.gz’.
nnml-compressed-files-size-threshold
¶
Default size threshold for compressed message files. Message files with
bodies larger than that many characters will be automatically compressed
if nnml-use-compressed-files
is non-nil
.
If your nnml
groups and NOV files get totally out of
whack, you can do a complete update by typing M-x
nnml-generate-nov-databases. This command will trawl through the
entire nnml
hierarchy, looking at each and every article, so it
might take a while to complete. A better interface to this
functionality can be found in the server buffer (see Server Commands).
7.4.13.4 MH Spool
nnmh
is just like nnml
, except that is doesn’t generate
NOV databases and it doesn’t keep an active file or marks
file. This makes nnmh
a much slower back end than
nnml
, but it also makes it easier to write procmail scripts
for.
Virtual server settings:
nnmh-directory
¶
All nnmh
directories will be located under this directory. The
default is the value of message-directory
(whose default is
~/Mail)
nnmh-get-new-mail
¶
If non-nil
, nnmh
will read incoming mail. The default is
t
.
nnmh-be-safe
¶
If non-nil
, nnmh
will go to ridiculous lengths to make
sure that the articles in the folder are actually what Gnus thinks
they are. It will check date stamps and stat everything in sight, so
setting this to t
will mean a serious slow-down. If you never
use anything but Gnus to read the nnmh
articles, you do not
have to set this variable to t
. The default is nil
.
7.4.13.5 Maildir
nnmaildir
stores mail in the maildir format, with each maildir
corresponding to a group in Gnus. This format is documented here:
https://cr.yp.to/proto/maildir.html. nnmaildir
also stores extra information in the .nnmaildir/ directory
within a maildir.
Maildir format was designed to allow concurrent deliveries and
reading, without needing locks. With other back ends, you would have
your mail delivered to a spool of some kind, and then you would
configure Gnus to split mail from that spool into your groups. You
can still do that with nnmaildir
, but the more common
configuration is to have your mail delivered directly to the maildirs
that appear as group in Gnus.
nnmaildir
is designed to be perfectly reliable: C-g will
never corrupt its data in memory, and SIGKILL
will never
corrupt its data in the filesystem.
nnmaildir
stores article marks and NOV data in each
maildir. So you can copy a whole maildir from one Gnus setup to
another, and you will keep your marks.
Virtual server settings:
directory
For each of your nnmaildir
servers (it’s very unlikely that
you’d need more than one), you need to create a directory and populate
it with maildirs or symlinks to maildirs (and nothing else; do not
choose a directory already used for other purposes). Each maildir
will be represented in Gnus as a newsgroup on that server; the
filename of the symlink will be the name of the group. Any filenames
in the directory starting with ‘.’ are ignored. The directory is
scanned when you first start Gnus, and each time you type g in
the group buffer; if any maildirs have been removed or added,
nnmaildir
notices at these times.
The value of the directory
parameter should be a Lisp form
which is processed by eval
and expand-file-name
to get
the path of the directory for this server. The form is eval
ed
only when the server is opened; the resulting string is used until the
server is closed. (If you don’t know about forms and eval
,
don’t worry—a simple string will work.) This parameter is not
optional; you must specify it. I don’t recommend using
"~/Mail"
or a subdirectory of it; several other parts of Gnus
use that directory by default for various things, and may get confused
if nnmaildir
uses it too. "~/.nnmaildir"
is a typical
value.
target-prefix
This should be a Lisp form which is processed by eval
and
expand-file-name
. The form is eval
ed only when the
server is opened; the resulting string is used until the server is
closed.
When you create a group on an nnmaildir
server, the maildir is
created with target-prefix
prepended to its name, and a symlink
pointing to that maildir is created, named with the plain group name.
So if directory
is "~/.nnmaildir"
and
target-prefix
is "../maildirs/"
, then when you create
the group foo
, nnmaildir
will create
~/.nnmaildir/../maildirs/foo as a maildir, and will create
~/.nnmaildir/foo as a symlink pointing to
../maildirs/foo.
You can set target-prefix
to a string without any slashes to
create both maildirs and symlinks in the same directory
; in
this case, any maildirs found in directory
whose names start
with target-prefix
will not be listed as groups (but the
symlinks pointing to them will be).
As a special case, if target-prefix
is ""
(the default),
then when you create a group, the maildir will be created in
directory
without a corresponding symlink. Beware that you
cannot use gnus-group-delete-group
on such groups without the
force
argument.
directory-files
This should be a function with the same interface as
directory-files
(such as directory-files
itself). It is
used to scan the server’s directory
for maildirs. This
parameter is optional; the default is
nnheader-directory-files-safe
if
nnheader-directory-files-is-safe
is nil
, and
directory-files
otherwise.
(nnheader-directory-files-is-safe
is checked only once when the
server is opened; if you want to check it each time the directory is
scanned, you’ll have to provide your own function that does that.)
get-new-mail
If non-nil
, then after scanning for new mail in the group
maildirs themselves as usual, this server will also incorporate mail
the conventional Gnus way, from mail-sources
according to
nnmail-split-methods
or nnmail-split-fancy
. The default
value is nil
.
Do not use the same maildir both in mail-sources
and as
an nnmaildir
group. The results might happen to be useful, but
that would be by chance, not by design, and the results might be
different in the future. If your split rules create new groups,
remember to supply a create-directory
server parameter.
7.4.13.6 Group parameters
nnmaildir
uses several group parameters. It’s safe to ignore
all this; the default behavior for nnmaildir
is the same as the
default behavior for other mail back ends: articles are deleted after
one week, etc. Except for the expiry parameters, all this
functionality is unique to nnmaildir
, so you can ignore it if
you’re just trying to duplicate the behavior you already have with
another back end.
If the value of any of these parameters is a vector, the first element
is evaluated as a Lisp form and the result is used, rather than the
original value. If the value is not a vector, the value itself is
evaluated as a Lisp form. (This is why these parameters use names
different from those of other, similar parameters supported by other
back ends: they have different, though similar, meanings.) (For
numbers, strings, nil
, and t
, you can ignore the
eval
business again; for other values, remember to use an extra
quote and wrap the value in a vector when appropriate.)
expire-age
An integer specifying the minimum age, in seconds, of an article
before it will be expired, or the symbol never
to specify that
articles should never be expired. If this parameter is not set,
nnmaildir
falls back to the usual
nnmail-expiry-wait
(-function
) variables (the
expiry-wait
group parameter overrides nnmail-expiry-wait
and makes nnmail-expiry-wait-function
ineffective). If you
wanted a value of 3 days, you could use something like [(* 3 24
60 60)]
; nnmaildir
will evaluate the form and use the result.
An article’s age is measured starting from the article file’s
modification time. Normally, this is the same as the article’s
delivery time, but editing an article makes it younger. Moving an
article (other than via expiry) may also make an article younger.
expire-group
If this is set to a string such as a full Gnus group name, like
"backend+server.address.string:group.name"
and if it is not the name of the same group that the parameter belongs
to, then articles will be moved to the specified group during expiry
before being deleted. If this is set to an nnmaildir
group, the article will be just as old in the destination group as it
was in the source group. So be careful with expire-age
in the
destination group. If this is set to the name of the same group that
the parameter belongs to, then the article is not expired at all. If
you use the vector form, the first element is evaluated once for each
article. So that form can refer to
nnmaildir-article-file-name
, etc., to decide where to put the
article. Even if this parameter is not set, nnmaildir
does not fall back to the expiry-target
group parameter or the
nnmail-expiry-target
variable.
read-only
If this is set to t
, nnmaildir
will treat the articles
in this maildir as read-only. This means: articles are not renamed
from new/ into cur/; articles are only found in
new/, not cur/; articles are never deleted; articles
cannot be edited. new/ is expected to be a symlink to the
new/ directory of another maildir—e.g., a system-wide mailbox
containing a mailing list of common interest. Everything in the
maildir outside new/ is not treated as read-only, so for
a shared mailbox, you do still need to set up your own maildir (or
have write permission to the shared mailbox); your maildir just won’t
contain extra copies of the articles.
directory-files
A function with the same interface as directory-files
. It is
used to scan the directories in the maildir corresponding to this
group to find articles. The default is the function specified by the
server’s directory-files
parameter.
distrust-Lines:
If non-nil
, nnmaildir
will always count the lines of an
article, rather than use the Lines:
header field. If
nil
, the header field will be used if present.
always-marks
A list of mark symbols, such as ['(read expire)]
. Whenever
Gnus asks nnmaildir
for article marks, nnmaildir
will
say that all articles have these marks, regardless of whether the
marks stored in the filesystem say so. This is a proof-of-concept
feature that will probably be removed eventually; it ought to be done
in Gnus proper, or abandoned if it’s not worthwhile.
never-marks
A list of mark symbols, such as ['(tick expire)]
. Whenever
Gnus asks nnmaildir
for article marks, nnmaildir
will
say that no articles have these marks, regardless of whether the marks
stored in the filesystem say so. never-marks
overrides
always-marks
. This is a proof-of-concept feature that will
probably be removed eventually; it ought to be done in Gnus proper, or
abandoned if it’s not worthwhile.
nov-cache-size
An integer specifying the size of the NOV memory cache. To
speed things up, nnmaildir
keeps NOV data in memory
for a limited number of articles in each group. (This is probably not
worthwhile, and will probably be removed in the future.) This
parameter’s value is noticed only the first time a group is seen after
the server is opened—i.e., when you first start Gnus, typically.
The NOV cache is never resized until the server is closed
and reopened. The default is an estimate of the number of articles
that would be displayed in the summary buffer: a count of articles
that are either marked with tick
or not marked with
read
, plus a little extra.
7.4.13.7 Article identification
Articles are stored in the cur/ subdirectory of each maildir.
Each article file is named like uniq:info
, where uniq
contains no colons. nnmaildir
ignores, but preserves, the
:info
part. (Other maildir readers typically use this part of
the filename to store marks.) The uniq
part uniquely
identifies the article, and is used in various places in the
.nnmaildir/ subdirectory of the maildir to store information
about the corresponding article. The full pathname of an article is
available in the variable nnmaildir-article-file-name
after you
request the article in the summary buffer.
7.4.13.8 NOV data
An article identified by uniq
has its NOV data (used
to generate lines in the summary buffer) stored in
.nnmaildir/nov/uniq
. There is no
nnmaildir-generate-nov-databases
function. (There isn’t much
need for it—an article’s NOV data is updated automatically
when the article or nnmail-extra-headers
has changed.) You can
force nnmaildir
to regenerate the NOV data for a
single article simply by deleting the corresponding NOV
file, but beware: this will also cause nnmaildir
to
assign a new article number for this article, which may cause trouble
with seen
marks, the Agent, and the cache.
7.4.13.9 Article marks
An article identified by uniq
is considered to have the mark
flag
when the file .nnmaildir/marks/flag/uniq exists.
When Gnus asks nnmaildir
for a group’s marks, nnmaildir
looks for such files and reports the set of marks it finds. When Gnus
asks nnmaildir
to store a new set of marks, nnmaildir
creates and deletes the corresponding files as needed. (Actually,
rather than create a new file for each mark, it just creates hard
links to .nnmaildir/markfile, to save inodes.)
You can invent new marks by creating a new directory in
.nnmaildir/marks/. You can tar up a maildir and remove it from
your server, untar it later, and keep your marks. You can add and
remove marks yourself by creating and deleting mark files. If you do
this while Gnus is running and your nnmaildir
server is open,
it’s best to exit all summary buffers for nnmaildir
groups and
type s in the group buffer first, and to type g or
M-g in the group buffer afterwards. Otherwise, Gnus might not
pick up the changes, and might undo them.
7.4.13.10 Mail Folders
nnfolder
is a back end for storing each mail group in a
separate file. Each file is in the standard Un*x mbox format.
nnfolder
will add extra headers to keep track of article
numbers and arrival dates.
Virtual server settings:
nnfolder-directory
¶
All the nnfolder
mail boxes will be stored under this
directory. The default is the value of message-directory
(whose default is ~/Mail)
nnfolder-active-file
¶
The name of the active file. The default is ~/Mail/active.
nnfolder-newsgroups-file
¶
The name of the group descriptions file. See Newsgroups File Format. The default is ~/Mail/newsgroups
nnfolder-get-new-mail
¶
If non-nil
, nnfolder
will read incoming mail. The
default is t
nnfolder-save-buffer-hook
¶
-
Hook run before saving the folders. Note that Emacs does the normal
backup renaming of files even with the nnfolder
buffers. If
you wish to switch this off, you could say something like the
following in your .emacs file:
(defun turn-off-backup ()
(set (make-local-variable 'backup-inhibited) t))
(add-hook 'nnfolder-save-buffer-hook 'turn-off-backup)
nnfolder-delete-mail-hook
¶
Hook run in a buffer narrowed to the message that is to be deleted.
This function can be used to copy the message to somewhere else, or to
extract some information from it before removing it.
nnfolder-nov-is-evil
¶
If non-nil
, this back end will ignore any NOV files. The
default is nil
.
nnfolder-nov-file-suffix
¶
The extension for NOV files. The default is .nov.
nnfolder-nov-directory
¶
The directory where the NOV files should be stored. If
nil
, nnfolder-directory
is used.
If you have lots of nnfolder
-like files you’d like to read with
nnfolder
, you can use the M-x nnfolder-generate-active-file
command to make nnfolder
aware of all likely files in
nnfolder-directory
. This only works if you use long file names,
though.
7.4.13.11 Comparing Mail Back Ends
First, just for terminology, the back end is the common word for a
low-level access method—a transport, if you will, by which something
is acquired. The sense is that one’s mail has to come from somewhere,
and so selection of a suitable back end is required in order to get that
mail within spitting distance of Gnus.
The same concept exists for Usenet itself: Though access to articles is
typically done by NNTP these days, once upon a midnight dreary, everyone
in the world got at Usenet by running a reader on the machine where the
articles lay (the machine which today we call an NNTP server), and
access was by the reader stepping into the articles’ directory spool
area directly. One can still select between either the nntp
or
nnspool
back ends, to select between these methods, if one happens
actually to live on the server (or can see its spool directly, anyway,
via NFS).
The goal in selecting a mail back end is to pick one which
simultaneously represents a suitable way of dealing with the original
format plus leaving mail in a form that is convenient to use in the
future. Here are some high and low points on each:
nnmbox
-
UNIX systems have historically had a single, very common, and well-defined
format. All messages arrive in a single spool file, and
they are delineated by a line whose regular expression matches
‘^From_’. (My notational use of ‘_’ is to indicate a space,
to make it clear in this instance that this is not the RFC-specified
‘From:’ header.) Because Emacs and therefore Gnus emanate
historically from the Unix environment, it is simplest if one does not
mess a great deal with the original mailbox format, so if one chooses
this back end, Gnus’ primary activity in getting mail from the real spool
area to Gnus’ preferred directory is simply to copy it, with no
(appreciable) format change in the process. It is the “dumbest” way
to move mail into availability in the Gnus environment. This makes it
fast to move into place, but slow to parse, when Gnus has to look at
what’s where.
nnbabyl
-
Once upon a time, there was the DEC-10 and DEC-20, running operating
systems called TOPS and related things, and the usual (only?) mail
reading environment was a thing called Babyl. I don’t know what format
was used for mail landing on the system, but Babyl had its own internal
format to which mail was converted, primarily involving creating a
spool-file-like entity with a scheme for inserting Babyl-specific
headers and status bits above the top of each message in the file.
Rmail was Emacs’s first mail reader, it was written by Richard Stallman,
and Stallman came out of that TOPS/Babyl environment, so he wrote Rmail
to understand the mail files folks already had in existence. Gnus (and
VM, for that matter) continue to support this format because it’s
perceived as having some good qualities in those mailer-specific
headers/status bits stuff. Rmail itself still exists as well, of
course, and is still maintained within Emacs. Since Emacs 23, it
uses standard mbox format rather than Babyl.
Both of the above forms leave your mail in a single file on your
file system, and they must parse that entire file each time you take a
look at your mail.
nnml
-
nnml
is the back end which smells the most as though you were
actually operating with an nnspool
-accessed Usenet system. (In
fact, I believe nnml
actually derived from nnspool
code,
lo these years ago.) One’s mail is taken from the original spool file,
and is then cut up into individual message files, 1:1. It maintains a
Usenet-style active file (analogous to what one finds in an INN- or
CNews-based news system in (for instance) /var/lib/news/active,
or what is returned via the ‘NNTP LIST’ verb) and also creates
overview files for efficient group entry, as has been defined for
NNTP servers for some years now. It is slower in mail-splitting,
due to the creation of lots of files, updates to the nnml
active
file, and additions to overview files on a per-message basis, but it is
extremely fast on access because of what amounts to the indexing support
provided by the active file and overviews.
nnml
costs inodes in a big way; that is, it soaks up the
resource which defines available places in the file system to put new
files. Sysadmins take a dim view of heavy inode occupation within
tight, shared file systems. But if you live on a personal machine where
the file system is your own and space is not at a premium, nnml
wins big.
It is also problematic using this back end if you are living in a
FAT16-based Windows world, since much space will be wasted on all these
tiny files.
nnmh
-
The Rand MH mail-reading system has been around UNIX systems for a very
long time; it operates by splitting one’s spool file of messages into
individual files, but with little or no indexing support—nnmh
is considered to be semantically equivalent to “nnml
without
active file or overviews”. This is arguably the worst choice, because
one gets the slowness of individual file creation married to the
slowness of access parsing when learning what’s new in one’s groups.
nnfolder
-
Basically the effect of nnfolder
is nnmbox
(the first
method described above) on a per-group basis. That is, nnmbox
itself puts all one’s mail in one file; nnfolder
provides a
little bit of optimization to this so that each of one’s mail groups has
a Unix mail box file. It’s faster than nnmbox
because each group
can be parsed separately, and still provides the simple Unix mail box
format requiring minimal effort in moving the mail around. In addition,
it maintains an “active” file making it much faster for Gnus to figure
out how many messages there are in each separate group.
If you have groups that are expected to have a massive amount of
messages, nnfolder
is not the best choice, but if you receive
only a moderate amount of mail, nnfolder
is probably the most
friendly mail back end all over.
nnmaildir
-
For configuring expiry and other things, nnmaildir
uses
incompatible group parameters, slightly different from those of other
mail back ends.
nnmaildir
is largely similar to nnml
, with some notable
differences. Each message is stored in a separate file, but the
filename is unrelated to the article number in Gnus. nnmaildir
also stores the equivalent of nnml
’s overview files in one file
per article, so it uses about twice as many inodes as nnml
.
(Use df -i
to see how plentiful your inode supply is.) If this
slows you down or takes up very much space, a non-block-structured
file system.
Since maildirs don’t require locking for delivery, the maildirs you use
as groups can also be the maildirs your mail is directly delivered to.
This means you can skip Gnus’ mail splitting if your mail is already
organized into different mailboxes during delivery. A directory
entry in mail-sources
would have a similar effect, but would
require one set of mailboxes for spooling deliveries (in mbox format,
thus damaging message bodies), and another set to be used as groups (in
whatever format you like). A maildir has a built-in spool, in the
new/
subdirectory. Beware that currently, mail moved from
new/
to cur/
instead of via mail splitting will not
undergo treatment such as duplicate checking.
nnmaildir
stores article marks for a given group in the
corresponding maildir, in a way designed so that it’s easy to manipulate
them from outside Gnus. You can tar up a maildir, unpack it somewhere
else, and still have your marks.
nnmaildir
uses a significant amount of memory to speed things up.
(It keeps in memory some of the things that nnml
stores in files
and that nnmh
repeatedly parses out of message files.) If this
is a problem for you, you can set the nov-cache-size
group
parameter to something small (0 would probably not work, but 1 probably
would) to make it use less memory. This caching will probably be
removed in the future.
Startup is likely to be slower with nnmaildir
than with other
back ends. Everything else is likely to be faster, depending in part
on your file system.
nnmaildir
does not use nnoo
, so you cannot use nnoo
to write an nnmaildir
-derived back end.
7.5 Browsing the Web
Web-based discussion forums are getting more and more popular. On many
subjects, the web-based forums have become the most important forums,
eclipsing the importance of mailing lists and news groups. The reason
is easy to understand—they are friendly to new users; you just point
and click, and there’s the discussion. With mailing lists, you have to
go through a cumbersome subscription procedure, and most people don’t
even know what a news group is.
The problem with this scenario is that web browsers are not very good at
being newsreaders. They do not keep track of what articles you’ve read;
they do not allow you to score on subjects you’re interested in; they do
not allow off-line browsing; they require you to click around and drive
you mad in the end.
So—if web browsers suck at reading discussion forums, why not use Gnus
to do it instead?
Gnus has been getting a bit of a collection of back ends for providing
interfaces to these sources.
The main caveat with all these web sources is that they probably won’t
work for a very long time. Gleaning information from the HTML data
is guesswork at best, and when the layout is altered, the Gnus back end
will fail. If you have reasonably new versions of these back ends,
though, you should be ok.
One thing all these Web methods have in common is that the Web sources
are often down, unavailable or just plain too slow to be fun. In those
cases, it makes a lot of sense to let the Gnus Agent (see Gnus Unplugged) handle downloading articles, and then you can read them at
leisure from your local disk. No more World Wide Wait for you.
7.5.1 Archiving Mail
Some of the back ends, notably nnml
, nnfolder
, and
nnmaildir
, now actually store the article marks with each group.
For these servers, archiving and restoring a group while preserving
marks is fairly simple.
(Preserving the group level and group parameters as well still
requires ritual dancing and sacrifices to the .newsrc.eld deity
though.)
To archive an entire nnml
, nnfolder
, or nnmaildir
server, take a recursive copy of the server directory. There is no need
to shut down Gnus, so archiving may be invoked by cron
or
similar. You restore the data by restoring the directory tree, and
adding a server definition pointing to that directory in Gnus. The
Article Backlog, Asynchronous Article Fetching and other things
might interfere with overwriting data, so you may want to shut down Gnus
before you restore the data.
7.5.2 Web Searches
It’s, like, too neat to search the Usenet for articles that match a
string, but it, like, totally sucks, like, totally, to use one of
those, like, Web browsers, and you, like, have to, rilly, like, look at
the commercials, so, like, with Gnus you can do rad, rilly,
searches without having to use a browser.
The nnweb
back end allows an easy interface to the mighty search
engine. You create an nnweb
group, enter a search pattern, and
then enter the group and read the articles like you would any normal
group. The G w command in the group buffer (see Foreign Groups) will do this in an easy-to-use fashion.
nnweb
groups don’t really lend themselves to being solid
groups—they have a very fleeting idea of article numbers. In fact,
each time you enter an nnweb
group (not even changing the search
pattern), you are likely to get the articles ordered in a different
manner. Not even using duplicate suppression (see Duplicate Suppression) will help, since nnweb
doesn’t even know the
Message-ID
of the articles before reading them using some search
engines (Google, for instance). The only possible way to keep track
of which articles you’ve read is by scoring on the Date
header—mark all articles posted before the last date you read the
group as read.
If the search engine changes its output substantially, nnweb
won’t be able to parse it and will fail. One could hardly fault the Web
providers if they were to do this—their raison d’être is to
make money off of advertisements, not to provide services to the
community. Since nnweb
washes the ads off all the articles, one
might think that the providers might be somewhat miffed. We’ll see.
Virtual server variables:
nnweb-type
¶
What search engine type is being used. The currently supported types
are google
and dejanews
. Note that
dejanews
is an alias to google
.
nnweb-search
¶
The search string to feed to the search engine.
nnweb-max-hits
¶
Advisory maximum number of hits per search to display. The default is
999.
nnweb-type-definition
¶
Type-to-definition alist. This alist says what nnweb
should do
with the various search engine types. The following elements must be
present:
article
Function to decode the article and provide something that Gnus
understands.
map
Function to create an article number to message header and URL alist.
search
Function to send the search string to the search engine.
address
The address the aforementioned function should send the search string
to.
id
Format string URL to fetch an article by Message-ID
.
7.6 Other Sources
Gnus can do more than just read news or mail. The methods described
below allow Gnus to view directories and files as if they were
newsgroups.
7.6.1 Directory Groups
If you have a directory that has lots of articles in separate files in
it, you might treat it as a newsgroup. The files have to have numerical
names, of course.
This might be an opportune moment to mention ange-ftp
(and its
successor efs
), that most wonderful of all wonderful Emacs
packages. When I wrote nndir
, I didn’t think much about it—a
back end to read directories. Big deal.
ange-ftp
changes that picture dramatically. For instance, if you
enter the ange-ftp
file name
/ftp.hpc.uh.edu:/pub/emacs/ding-list/ as the directory name,
ange-ftp
or efs
will actually allow you to read this
directory over at ‘sina’ as a newsgroup. Distributed news ahoy!
nndir
will use NOV files if they are present.
nndir
is a “read-only” back end—you can’t delete or expire
articles with this method. You can use nnmh
or nnml
for
whatever you use nndir
for, so you could switch to any of those
methods if you feel the need to have a non-read-only nndir
.
7.6.2 Anything Groups
From the nndir
back end (which reads a single spool-like
directory), it’s just a hop and a skip to nneething
, which
pretends that any arbitrary directory is a newsgroup. Strange, but
true.
When nneething
is presented with a directory, it will scan this
directory and assign article numbers to each file. When you enter such
a group, nneething
must create “headers” that Gnus can use.
After all, Gnus is a newsreader, in case you’re forgetting.
nneething
does this in a two-step process. First, it snoops each
file in question. If the file looks like an article (i.e., the first
few lines look like headers), it will use this as the head. If this is
just some arbitrary file without a head (e.g., a C source file),
nneething
will cobble up a header out of thin air. It will use
file ownership, name and date and do whatever it can with these
elements.
All this should happen automatically for you, and you will be presented
with something that looks very much like a newsgroup. Totally like a
newsgroup, to be precise. If you select an article, it will be displayed
in the article buffer, just as usual.
If you select a line that represents a directory, Gnus will pop you into
a new summary buffer for this nneething
group. And so on. You can
traverse the entire disk this way, if you feel like, but remember that
Gnus is not dired, really, and does not intend to be, either.
There are two overall modes to this action—ephemeral or solid. When
doing the ephemeral thing (i.e., G D from the group buffer), Gnus
will not store information on what files you have read, and what files
are new, and so on. If you create a solid nneething
group the
normal way with G m, Gnus will store a mapping table between
article numbers and file names, and you can treat this group like any
other groups. When you activate a solid nneething
group, you will
be told how many unread articles it contains, etc., etc.
Some variables:
nneething-map-file-directory
¶
All the mapping files for solid nneething
groups will be stored
in this directory, which defaults to ~/.nneething/.
nneething-exclude-files
¶
All files that match this regexp will be ignored. Nice to use to exclude
auto-save files and the like, which is what it does by default.
nneething-include-files
¶
Regexp saying what files to include in the group. If this variable is
non-nil
, only files matching this regexp will be included.
nneething-map-file
¶
Name of the map files.
7.6.3 Document Groups
nndoc
is a cute little thing that will let you read a single file
as a newsgroup. Several files types are supported:
-
babyl
The Babyl format.
mbox
The standard Unix mbox file.
mmdf
The MMDF mail box format.
news
Several news articles appended into a file.
rnews
The rnews batch transport format.
nsmail
Netscape mail boxes.
mime-parts
MIME multipart messages.
standard-digest
The standard (RFC 1153) digest format.
mime-digest
A MIME digest of messages.
lanl-gov-announce
Announcement messages from LANL Gov Announce.
git
git
commit messages.
rfc822-forward
A message forwarded according to RFC 822 or its successors.
outlook
The Outlook mail box.
oe-dbx
The Outlook Express dbx mail box.
exim-bounce
A bounce message from the Exim MTA.
forward
A message forwarded according to informal rules.
rfc934
An RFC934-forwarded message.
mailman
A mailman digest.
clari-briefs
A digest of Clarinet brief news items.
slack-digest
Non-standard digest format—matches most things, but does it badly.
mail-in-mail
The last resort.
You can also use the special “file type” guess
, which means
that nndoc
will try to guess what file type it is looking at.
digest
means that nndoc
should guess what digest type the
file is.
nndoc
will not try to change the file or insert any extra headers into
it—it will simply, like, let you use the file as the basis for a
group. And that’s it.
If you have some old archived articles that you want to insert into your
new & spiffy Gnus mail back end, nndoc
can probably help you with
that. Say you have an old RMAIL file with mail that you now want
to split into your new nnml
groups. You look at that file using
nndoc
(using the G f command in the group buffer
(see Foreign Groups)), set the process mark on all the articles in
the buffer (M P b, for instance), and then re-spool (B r)
using nnml
. If all goes well, all the mail in the RMAIL
file is now also stored in lots of nnml
directories, and you can
delete that pesky RMAIL file. If you have the guts!
Virtual server variables:
nndoc-article-type
¶
This should be one of mbox
, babyl
, digest
,
news
, rnews
, mmdf
, forward
, rfc934
,
rfc822-forward
, mime-parts
, standard-digest
,
slack-digest
, clari-briefs
, nsmail
, outlook
,
oe-dbx
, mailman
, and mail-in-mail
or guess
.
nndoc-post-type
¶
This variable says whether Gnus is to consider the group a news group or
a mail group. There are two valid values: mail
(the default)
and news
.
7.6.3.1 Document Server Internals
Adding new document types to be recognized by nndoc
isn’t
difficult. You just have to whip up a definition of what the document
looks like, write a predicate function to recognize that document type,
and then hook into nndoc
.
First, here’s an example document type definition:
(mmdf
(article-begin . "^\^A\^A\^A\^A\n")
(body-end . "^\^A\^A\^A\^A\n"))
The definition is simply a unique name followed by a series of
regexp pseudo-variable settings. Below are the possible
variables—don’t be daunted by the number of variables; most document
types can be defined with very few settings:
first-article
If present, nndoc
will skip past all text until it finds
something that match this regexp. All text before this will be
totally ignored.
article-begin
This setting has to be present in all document type definitions. It
says what the beginning of each article looks like. To do more
complicated things that cannot be dealt with a simple regexp, you can
use article-begin-function
instead of this.
article-begin-function
If present, this should be a function that moves point to the beginning
of each article. This setting overrides article-begin
.
head-begin
If present, this should be a regexp that matches the head of the
article. To do more complicated things that cannot be dealt with a
simple regexp, you can use head-begin-function
instead of this.
head-begin-function
If present, this should be a function that moves point to the head of
the article. This setting overrides head-begin
.
head-end
This should match the end of the head of the article. It defaults to
‘^$’—the empty line.
body-begin
This should match the beginning of the body of the article. It defaults
to ‘^\n’. To do more complicated things that cannot be dealt with
a simple regexp, you can use body-begin-function
instead of this.
body-begin-function
If present, this function should move point to the beginning of the body
of the article. This setting overrides body-begin
.
body-end
If present, this should match the end of the body of the article. To do
more complicated things that cannot be dealt with a simple regexp, you
can use body-end-function
instead of this.
body-end-function
If present, this function should move point to the end of the body of
the article. This setting overrides body-end
.
file-begin
If present, this should match the beginning of the file. All text
before this regexp will be totally ignored.
file-end
If present, this should match the end of the file. All text after this
regexp will be totally ignored.
So, using these variables nndoc
is able to dissect a document
file into a series of articles, each with a head and a body. However, a
few more variables are needed since not all document types are all that
news-like—variables needed to transform the head or the body into
something that’s palatable for Gnus:
prepare-body-function
If present, this function will be called when requesting an article. It
will be called with point at the start of the body, and is useful if the
document has encoded some parts of its contents.
article-transform-function
If present, this function is called when requesting an article. It’s
meant to be used for more wide-ranging transformation of both head and
body of the article.
generate-head-function
If present, this function is called to generate a head that Gnus can
understand. It is called with the article number as a parameter, and is
expected to generate a nice head for the article in question. It is
called when requesting the headers of all articles.
generate-article-function
If present, this function is called to generate an entire article that
Gnus can understand. It is called with the article number as a
parameter when requesting all articles.
dissection-function
If present, this function is called to dissect a document by itself,
overriding first-article
, article-begin
,
article-begin-function
, head-begin
,
head-begin-function
, head-end
, body-begin
,
body-begin-function
, body-end
, body-end-function
,
file-begin
, and file-end
.
Let’s look at the most complicated example I can come up with—standard
digests:
(standard-digest
(first-article . ,(concat "^" (make-string 70 ?-) "\n\n+"))
(article-begin . ,(concat "\n\n" (make-string 30 ?-) "\n\n+"))
(prepare-body-function . nndoc-unquote-dashes)
(body-end-function . nndoc-digest-body-end)
(head-end . "^ ?$")
(body-begin . "^ ?\n")
(file-end . "^End of .*digest.*[0-9].*\n\\*\\*\\|^End of.*Digest *$")
(subtype digest guess))
We see that all text before a 70-width line of dashes is ignored; all
text after a line that starts with that ‘^End of’ is also ignored;
each article begins with a 30-width line of dashes; the line separating
the head from the body may contain a single space; and that the body is
run through nndoc-unquote-dashes
before being delivered.
To hook your own document definition into nndoc
, use the
nndoc-add-type
function. It takes two parameters—the first
is the definition itself and the second (optional) parameter says
where in the document type definition alist to put this definition.
The alist is traversed sequentially, and
nndoc-type-type-p
is called for a given type type.
So nndoc-mmdf-type-p
is called to see whether a document is of
mmdf
type, and so on. These type predicates should return
nil
if the document is not of the correct type; t
if it
is of the correct type; and a number if the document might be of the
correct type. A high number means high probability; a low number
means low probability with ‘0’ being the lowest valid number.
7.6.4 Mail-To-News Gateways
If your local nntp
server doesn’t allow posting, for some reason
or other, you can post using one of the numerous mail-to-news gateways.
The nngateway
back end provides the interface.
Note that you can’t read anything from this back end—it can only be
used to post with.
Server variables:
nngateway-address
¶
This is the address of the mail-to-news gateway.
News headers often have to be transformed in some odd way or other
for the mail-to-news gateway to accept it. This variable says what
transformation should be called, and defaults to
nngateway-simple-header-transformation
. The function is called
narrowed to the headers to be transformed and with one parameter—the
gateway address.
This default function just inserts a new To
header based on the
Newsgroups
header and the gateway address.
For instance, an article with this Newsgroups
header:
Newsgroups: alt.religion.emacs
will get this To
header inserted:
To: alt-religion-emacs@GATEWAY
The following pre-defined functions exist:
nngateway-simple-header-transformation
Creates a To
header that looks like
newsgroup@nngateway-address
.
nngateway-mail2news-header-transformation
Creates a To
header that looks like
nngateway-address
.
Here’s an example:
(setq gnus-post-method
'(nngateway
"mail2news@replay.com"
(nngateway-header-transformation
nngateway-mail2news-header-transformation)))
So, to use this, simply say something like:
(setq gnus-post-method '(nngateway "GATEWAY.ADDRESS"))
7.6.5 The Empty Backend
nnnil
is a backend that can be used as a placeholder if you
have to specify a backend somewhere, but don’t really want to. The
classical example is if you don’t want to have a primary select
methods, but want to only use secondary ones:
(setq gnus-select-method '(nnnil ""))
(setq gnus-secondary-select-methods
'((nnimap "foo")
(nnml "")))
7.7 Virtual Groups
Gnus allows combining articles from many sources, and combinations of
whole groups together into virtual groups.
7.7.1 Select Groups
Gnus provides the nnselect method for creating virtual groups
composed of collections of messages, even when these messages come
from groups that span multiple servers and backends. For the most
part these virtual groups behave like any other group: messages may be
threaded, marked, moved, deleted, copied, etc.; groups may be
ephemeral or persistent; groups may be created via
gnus-group-make-group
or browsed as foreign via
gnus-group-browse-foreign-server
.
The key to using an nnselect group is specifying the messages to
include. Each nnselect group has a group parameter
nnselect-specs
which is an alist with two elements: a function
nnselect-function
; and arguments nnselect-args
to be
passed to the function, if any.
The function nnselect-function
must return a vector. Each
element of this vector is in turn a 3-element vector corresponding to
one message. The 3 elements are: the fully-qualified group name; the
message number; and a "score" that can be used for additional sorting.
The values for the score are arbitrary, and are not used directly by
the nnselect method—they may, for example, all be set to 100.
Here is an example:
(nnselect-specs
(nnselect-function . identity)
(nnselect-args
. [["nnimap+work:mail" 595 100]
["nnimap+home:sent" 223 100]
["nntp+news.gmane.org:gmane.emacs.gnus.general" 23666 100]]))
The function is the identity and the argument is just the list of
messages to include in the virtual group.
Or we may wish to create a group from the results of a search query:
(nnselect-specs
(nnselect-function . gnus-search-run-query)
(nnselect-args
(search-query-spec
(query . "mark:flag"))
(search-group-spec
("nnimap:home")
("nnimap:work"))))
This creates a group including all flagged messages from all groups on
two IMAP servers, "home" and "work".
And one last example. Here is a function that runs a search query to
find all messages that have been received recently from certain groups:
(defun my-recent-email (args)
(let ((query-spec
(list
(cons 'query
(format-time-string "SENTSINCE %d-%b-%Y"
(time-subtract (current-time)
(days-to-time (car args)))))
(cons 'criteria "")))
(group-spec (cadr args)))
(gnus-search-run-query (list (cons 'search-query-spec query-spec)
(cons 'search-group-spec group-spec)))))
Then the following nnselect-specs
:
(nnselect-specs
(nnselect-function . my-recent-email)
(nnselect-args . (7 (("nnimap:home") ("nnimap:work")))))
will provide a group composed of all messages on the home and work
servers received in the last 7 days.
Refreshing the selection of an nnselect group by running the
nnselect-function
may take a long time to complete.
Consequently nnselect groups are not refreshed by default when
gnus-group-get-new-news
is invoked. In those cases where
running the function is not too time-consuming, a non-nil
group
parameter of nnselect-rescan
will allow automatic refreshing.
A refresh can always be invoked manually through
gnus-group-get-new-news-this-group
.
Gnus includes engines for searching a variety of backends. While the
details of each search engine vary, the result of a search is always a
vector of the sort used by the nnselect method, and the results of
queries are usually viewed using an nnselect group. Indeed the
standard search function gnus-group-read-ephemeral-search-group
just creates an ephemeral nnselect group with the appropriate search
query as the nnselect-specs
.
7.7.2 Combined Groups
An nnvirtual group is really nothing more than a collection of
other groups.
For instance, if you are tired of reading many small groups, you can
put them all in one big group, and then grow tired of reading one
big, unwieldy group. The joys of computing!
You specify nnvirtual
as the method. The address should be a
regexp to match component groups.
All marks in the virtual group will stick to the articles in the
component groups. So if you tick an article in a virtual group, the
article will also be ticked in the component group from whence it
came. (And vice versa—marks from the component groups will also be
shown in the virtual group.). To create an empty virtual group, run
G V (gnus-group-make-empty-virtual
) in the group buffer
and edit the method regexp with M-e
(gnus-group-edit-group-method
)
Here’s an example nnvirtual
method that collects all Andrea Dworkin
newsgroups into one, big, happy newsgroup:
(nnvirtual "^alt\\.fan\\.andrea-dworkin$\\|^rec\\.dworkin.*")
The component groups can be native or foreign; everything should work
smoothly, but if your computer explodes, it was probably my fault.
Collecting the same group from several servers might actually be a good
idea if users have set the Distribution header to limit distribution.
If you would like to read ‘soc.motss’ both from a server in Japan
and a server in Norway, you could use the following as the group regexp:
"^nntp\\+server\\.jp:soc\\.motss$\\|^nntp\\+server\\.no:soc\\.motss$"
(Remember, though, that if you’re creating the group with G m, you
shouldn’t double the backslashes, and you should leave off the quote
characters at the beginning and the end of the string.)
This should work kinda smoothly—all articles from both groups should
end up in this one, and there should be no duplicates. Threading (and
the rest) will still work as usual, but there might be problems with the
sequence of articles. Sorting on date might be an option here
(see Selecting a Group).
One limitation, however—all groups included in a virtual
group have to be alive (i.e., subscribed or unsubscribed). Killed or
zombie groups can’t be component groups for nnvirtual
groups.
If the nnvirtual-always-rescan
variable is non-nil
(which
is the default), nnvirtual
will always scan groups for unread
articles when entering a virtual group. If this variable is nil
and you read articles in a component group after the virtual group has
been activated, the read articles from the component group will show up
when you enter the virtual group. You’ll also see this effect if you
have two virtual groups that have a component group in common. If
that’s the case, you should set this variable to t
. Or you can
just tap M-g
on the virtual group every time before you enter
it—it’ll have much the same effect.
nnvirtual
can have both mail and news groups as component groups.
When responding to articles in nnvirtual
groups, nnvirtual
has to ask the back end of the component group the article comes from
whether it is a news or mail back end. However, when you do a ^,
there is typically no sure way for the component back end to know this,
and in that case nnvirtual
tells Gnus that the article came from a
not-news back end. (Just to be on the safe side.)
C-c C-n in the message buffer will insert the Newsgroups
line from the article you respond to in these cases.
nnvirtual
groups do not inherit anything but articles and marks
from component groups—group parameters, for instance, are not
inherited.
7.8 Email Based Diary
This section describes a special mail back end called nndiary
,
and its companion library gnus-diary
. It is “special” in the
sense that it is not meant to be one of the standard alternatives for
reading mail with Gnus. See Choosing a Mail Back End for that.
Instead, it is used to treat some of your mails in a special way,
namely, as event reminders.
Here is a typical scenario:
- You’ve got a date with Andy Mc Dowell or Bruce Willis (select according
to your sexual preference) in one month. You don’t want to forget it.
- So you send a “reminder” message (actually, a diary one) to yourself.
- You forget all about it and keep on getting and reading new mail, as usual.
- From time to time, as you type g in the group buffer and as the date
is getting closer, the message will pop up again to remind you of your
appointment, just as if it were new and unread.
- Read your “new” messages, this one included, and start dreaming again
of the night you’re gonna have.
- Once the date is over (you actually fell asleep just after dinner), the
message will be automatically deleted if it is marked as expirable.
The Gnus Diary back end has the ability to handle regular appointments
(that wouldn’t ever be deleted) as well as punctual ones, operates as a
real mail back end and is configurable in many ways. All of this is
explained in the sections below.
7.8.1 The NNDiary Back End
nndiary
is a back end very similar to nnml
(see Mail Spool). Actually, it could appear as a mix of nnml
and
nndraft
. If you know nnml
, you’re already familiar with
the message storing scheme of nndiary
: one file per message, one
directory per group.
Before anything, there is one requirement to be able to run
nndiary
properly: you must use the group timestamp feature
of Gnus. This adds a timestamp to each group’s parameters. Group Timestamp to see how it’s done.
7.8.1.1 Diary Messages
nndiary
messages are just normal ones, except for the mandatory
presence of 7 special headers. These headers are of the form
X-Diary-<something>
, <something>
being one of
Minute
, Hour
, Dom
, Month
, Year
,
Time-Zone
and Dow
. Dom
means “Day of Month”, and
Dow
means “Day of Week”. These headers actually behave like
crontab specifications and define the event date(s):
- For all headers except the
Time-Zone
one, a header value is
either a star (meaning all possible values), or a list of fields
(separated by a comma).
- A field is either an integer, or a range.
- A range is two integers separated by a dash.
- Possible integer values are 0–59 for
Minute
, 0–23 for
Hour
, 1–31 for Dom
, 1–12 for Month
, above 1971
for Year
and 0–6 for Dow
(0 meaning Sunday).
- As a special case, a star in either
Dom
or Dow
doesn’t
mean “all possible values”, but “use only the other field”. Note
that if both are star’ed, the use of either one gives the same result.
- The
Time-Zone
header is special in that it can only have one
value (GMT
, for instance). A star doesn’t mean “all possible
values” (because it makes no sense), but “the current local time
zone”. Most of the time, you’ll be using a star here. However, for a
list of available time zone values, see the variable
nndiary-headers
.
As a concrete example, here are the diary headers to add to your message
for specifying “Each Monday and each 1st of month, at 12:00, 20:00,
21:00, 22:00, 23:00 and 24:00, from 1999 to 2010” (I’ll let you find
what to do then):
X-Diary-Minute: 0
X-Diary-Hour: 12, 20-24
X-Diary-Dom: 1
X-Diary-Month: *
X-Diary-Year: 1999-2010
X-Diary-Dow: 1
X-Diary-Time-Zone: *
7.8.1.2 Running NNDiary
nndiary
has two modes of operation: “traditional” (the default)
and “autonomous”. In traditional mode, nndiary
does not get new
mail by itself. You have to move (B m) or copy (B c) mails
from your primary mail back end to nndiary groups in order to handle them
as diary messages. In autonomous mode, nndiary
retrieves its own
mail and handles it independently from your primary mail back end.
One should note that Gnus is not inherently designed to allow several
“master” mail back ends at the same time. However, this does make
sense with nndiary
: you really want to send and receive diary
messages to your diary groups directly. So, nndiary
supports
being sort of a “second primary mail back end” (to my knowledge, it is
the only back end offering this feature). However, there is a limitation
(which I hope to fix some day): respooling doesn’t work in autonomous
mode.
In order to use nndiary
in autonomous mode, you have several
things to do:
Once this is done, you might want to customize the following two options
that affect the diary mail retrieval and splitting processes:
- Variable: nndiary-mail-sources ¶
This is the diary-specific replacement for the standard
mail-sources
variable. It obeys the same syntax, and defaults to
(file :path "~/.nndiary")
.
- Variable: nndiary-split-methods ¶
This is the diary-specific replacement for the standard
nnmail-split-methods
variable. It obeys the same syntax.
Finally, you may add a permanent nndiary
virtual server
(something like (nndiary "diary")
should do) to your
gnus-secondary-select-methods
.
Hopefully, almost everything (see the TODO section in
nndiary.el) will work as expected when you restart Gnus: in
autonomous mode, typing g and M-g in the group buffer, will
also get your new diary mails and split them according to your
diary-specific rules, F will find your new diary groups etc.
7.8.1.3 Customizing NNDiary
Now that nndiary
is up and running, it’s time to customize it.
The custom group is called nndiary
(no, really ?!). You should
browse it to figure out which options you’d like to tweak. The following
two variables are probably the only ones you will want to change:
- Variable: nndiary-reminders ¶
This is the list of times when you want to be reminded of your
appointments (e.g., 3 weeks before, then 2 days before, then 1 hour
before and that’s it). Remember that “being reminded” means that the
diary message will pop up as brand new and unread again when you get new
mail.
- Variable: nndiary-week-starts-on-monday ¶
Rather self-explanatory. Otherwise, Sunday is assumed (this is the
default).
7.8.2 The Gnus Diary Library
Using nndiary
manually (I mean, writing the headers by hand and
so on) would be rather boring. Fortunately, there is a library called
gnus-diary
written on top of nndiary
, that does many
useful things for you.
In order to use it, add the following line to your ~/.gnus.el file:
Also, you shouldn’t use any gnus-user-format-function-[d|D]
(see Summary Buffer Lines). gnus-diary
provides both of these
(sorry if you used them before).
7.8.2.2 Diary Articles Sorting
gnus-diary
provides new sorting functions (see Sorting the Summary Buffer ) called gnus-summary-sort-by-schedule
,
gnus-thread-sort-by-schedule
and
gnus-article-sort-by-schedule
. These functions let you organize
your diary summary buffers from the closest event to the farthest one.
gnus-diary
automatically installs
gnus-summary-sort-by-schedule
as a menu item in the summary
buffer’s “sort” menu, and the two others as the primary (hence
default) sorting functions in the group parameters (see Diary Group Parameters).
7.8.2.4 Diary Group Parameters
When you create a new diary group, or visit one, gnus-diary
automatically checks your group parameters and if needed, sets the
summary line format to the diary-specific value, installs the
diary-specific sorting functions, and also adds the different
X-Diary-*
headers to the group’s posting-style. It is then easier
to send a diary message, because if you use C-u a or C-u m
on a diary group to prepare a message, these headers will be inserted
automatically (although not filled with proper values yet).
nndiary
is a real mail back end. You really send real diary
messages for real. This means for instance that you can give
appointments to anybody (provided they use Gnus and nndiary
) by
sending the diary message to them as well.
7.9 Gnus Unplugged
In olden times (ca. February ’88), people used to run their newsreaders
on big machines with permanent connections to the net. News transport
was dealt with by news servers, and all the newsreaders had to do was to
read news. Believe it or not.
Nowadays most people read news and mail at home, and use some sort of
modem to connect to the net. To avoid running up huge phone bills, it
would be nice to have a way to slurp down all the news and mail, hang up
the phone, read for several hours, and then upload any responses you
have to make. And then you repeat the procedure.
Of course, you can use news servers for doing this as well. I’ve used
inn
together with slurp
, pop
and sendmail
for some years, but doing that’s a bore. Moving the news server
functionality up to the newsreader makes sense if you’re the only person
reading news on a machine.
Setting up Gnus as an “offline” newsreader is quite simple. In
fact, you don’t have to configure anything as the agent is now enabled
by default (see gnus-agent).
Of course, to use it as such, you have to learn a few new commands.
7.9.1 Agent Basics
First, let’s get some terminology out of the way.
The Gnus Agent is said to be unplugged when you have severed the
connection to the net (and notified the Agent that this is the case).
When the connection to the net is up again (and Gnus knows this), the
Agent is plugged.
The local machine is the one you’re running on, and which isn’t
connected to the net continuously.
Downloading means fetching things from the net to your local
machine. Uploading is doing the opposite.
You know that Gnus gives you all the opportunity you’d ever want for
shooting yourself in the foot. Some people call it flexibility. Gnus
is also customizable to a great extent, which means that the user has a
say on how Gnus behaves. Other newsreaders might unconditionally shoot
you in your foot, but with Gnus, you have a choice!
Gnus is never really in plugged or unplugged state. Rather, it applies
that state to each server individually. This means that some servers
can be plugged while others can be unplugged. Additionally, some
servers can be ignored by the Agent altogether (which means that
they’re kinda like plugged always).
So when you unplug the Agent and then wonder why is Gnus opening a
connection to the Net, the next step to do is to look whether all
servers are agentized. If there is an unagentized server, you found
the culprit.
Another thing is the offline state. Sometimes, servers aren’t
reachable. When Gnus notices this, it asks you whether you want the
server to be switched to offline state. If you say yes, then the
server will behave somewhat as if it was unplugged, except that Gnus
will ask you whether you want to switch it back online again.
Let’s take a typical Gnus session using the Agent.
-
You start Gnus with
gnus-unplugged
. This brings up the Gnus
Agent in a disconnected state. You can read all the news that you have
already fetched while in this mode.
- You then decide to see whether any new news has arrived. You connect
your machine to the net (using PPP or whatever), and then hit J j
to make Gnus become plugged and use g to check for new mail
as usual. To check for new mail in unplugged mode (see Mail Source Specifiers).
- You can then read the new news immediately, or you can download the
news onto your local machine. If you want to do the latter, you press
g to check if there are any new news and then J s to fetch
all the eligible articles in all the groups. (To let Gnus know which
articles you want to download, see Agent Categories).
- After fetching the articles, you press J j to make Gnus become
unplugged again, and you shut down the PPP thing (or whatever). And
then you read the news offline.
- And then you go to step 2.
Here are some things you should do the first time (or so) that you use
the Agent.
- Decide which servers should be covered by the Agent. If you have a mail
back end, it would probably be nonsensical to have it covered by the
Agent. Go to the server buffer (^ in the group buffer) and press
J a on the server (or servers) that you wish to have covered by the
Agent (see Server Agent Commands), or J r on automatically
added servers you do not wish to have covered by the Agent. By default,
no servers are agentized.
- Decide on download policy. It’s fairly simple once you decide whether
you are going to use agent categories, topic parameters, and/or group
parameters to implement your policy. If you’re new to gnus, it
is probably best to start with a category, See Agent Categories.
Both topic parameters (see Topic Parameters) and agent categories
(see Agent Categories) provide for setting a policy that applies
to multiple groups. Which you use is entirely up to you. Topic
parameters do override categories so, if you mix the two, you’ll have
to take that into account. If you have a few groups that deviate from
your policy, you can use group parameters (see Group Parameters) to
configure them.
- Uhm&helli