Go forward to Duplicates.
Go backward to Incorporating Old Mail.
Go up to Getting Mail.
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". 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. Groups that
match the regular expression `gnus-auto-expirable-newsgroups' will have
all articles that you read marked as expirable automatically. All
articles that are marked as expirable have an `E' in the first column
in the summary buffer.
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.
The `nnmail-expiry-wait' variable supplies the default time an
expirable article has to live. The default is seven days.
Gnus also supplies a function that lets you fine-tune how long
articles are to live, based on what group they are in. Let's say you
want to have 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:
(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 that this function is fed are "unadorned" group
names--no `nnml:' prefixes and the like.
The `nnmail-expiry-wait' variable and `nnmail-expiry-wait-function'
function can be either a number (not necessarily an integer) or the
symbols `immediate' or `never'.
You can also use the `expiry-wait' group parameter to selectively
change the expiry period (see Group Parameters.).
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!