[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.9.6 Old messages

Question 6.1:  How to import my old mail into Gnus?
Question 6.2:  How to archive interesting messages?
Question 6.3:  How to search for a specific message?
Question 6.4:  How to get rid of old unwanted mail?
Question 6.5:  I want that all read messages are expired (at least in some groups). How to do it?
Question 6.6:  I don't want expiration to delete my mails but to move them to another group.

Question 6.1:

How to import my old mail into Gnus?

Answer:

The easiest way is to tell your old mail program to export the messages in mbox format. Most Unix mailers are able to do this, if you come from the MS Windows world, you may find tools at http://mbx2mbox.sourceforge.net/.

Now you've got to import this mbox file into Gnus. To do this, create a nndoc group based on the mbox file by saying `G f /path/file.mbox RET' in Group buffer. You now have read-only access to your mail. If you want to import the messages to your normal Gnus mail groups hierarchy, enter the nndoc group you've just created by saying `C-u RET' (thus making sure all messages are retrieved), mark all messages by saying `M P b' and either copy them to the desired group by saying `B c name.of.group RET' or send them through nnmail-split-methods (respool them) by saying `B r'.

Question 6.2:

How to archive interesting messages?

Answer:

If you stumble across an interesting message, say in gnu.emacs.gnus and want to archive it there are several solutions. The first and easiest is to save it to a file by saying `O f'. However, wouldn't it be much more convenient to have more direct access to the archived message from Gnus? If you say yes, put this snippet by Frank Haun <pille3003@fhaun.de> in ~/.gnus:

 
(defun my-archive-article (&optional n)
  "Copies one or more article(s) to a corresponding `nnml:' group, e.g.
`gnus.ding' goes to `nnml:1.gnus.ding'. And `nnml:List-gnus.ding' goes
to `nnml:1.List-gnus-ding'.

Use process marks or mark a region in the summary buffer to archive
more then one article."
  (interactive "P")
  (let ((archive-name
         (format
          "nnml:1.%s"
          (if (featurep 'xemacs)
              (replace-in-string gnus-newsgroup-name "^.*:" "")
            (replace-regexp-in-string "^.*:" "" gnus-newsgroup-name)))))
    (gnus-summary-copy-article n archive-name)))

You can now say `M-x my-archive-article' in summary buffer to archive the article under the cursor in a nnml group. (Change nnml to your preferred back end)

Of course you can also make sure the cache is enabled by saying

 
(setq gnus-use-cache t)

then you only have to set either the tick or the dormant mark for articles you want to keep, setting the read mark will remove them from cache.

Question 6.3:

How to search for a specific message?

Answer:

There are several ways for this, too. For a posting from a Usenet group the easiest solution is probably to ask groups.google.com, if you found the posting there, tell Google to display the raw message, look for the message-id, and say `M-^ the@message.id RET' in a summary buffer. Since Gnus 5.10.0 there's also a Gnus interface for groups.google.com which you can call with `G W') in group buffer.

Another idea which works for both mail and news groups is to enter the group where the message you are searching is and use the standard Emacs search `C-s', it's smart enough to look at articles in collapsed threads, too. If you want to search bodies, too try `M-s' instead. Further on there are the gnus-summary-limit-to-foo functions, which can help you, too.

Of course you can also use grep to search through your local mail, but this is both slow for big archives and inconvenient since you are not displaying the found mail in Gnus. Here comes nnir into action. Nnir is a front end to search engines like swish-e or swish++ and others. You index your mail with one of those search engines and with the help of nnir you can search trough the indexed mail and generate a temporary group with all messages which met your search criteria. If this sound cool to you get nnir.el from ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs/ or ftp://ftp.is.informatik.uni-duisburg.de/pub/src/emacs/. Instructions on how to use it are at the top of the file.

Question 6.4:

How to get rid of old unwanted mail?

Answer:

You can of course just mark the mail you don't need anymore by saying `#' with point over the mail and then say `B DEL' to get rid of them forever. You could also instead of actually deleting them, send them to a junk-group by saying `B m nnml:trash-bin' which you clear from time to time, but both are not the intended way in Gnus.

In Gnus, we let mail expire like news expires on a news server. That means you tell Gnus the message is expirable (you tell Gnus "I don't need this mail anymore") by saying `E' with point over the mail in summary buffer. Now when you leave the group, Gnus looks at all messages which you marked as expirable before and if they are old enough (default is older than a week) they are deleted.

Question 6.5:

I want that all read messages are expired (at least in some groups). How to do it?

Answer:

If you want all read messages to be expired (e.g. in mailing lists where there's an online archive), you've got two choices: auto-expire and total-expire. Auto-expire means, that every article which has no marks set and is selected for reading is marked as expirable, Gnus hits `E' for you every time you read a message. Total-expire follows a slightly different approach, here all article where the read mark is set are expirable.

To activate auto-expire, include auto-expire in the Group parameters for the group. (Hit `G c' in summary buffer with point over the group to change group parameters). For total-expire add total-expire to the group-parameters.

Which method you choose is merely a matter of taste: Auto-expire is faster, but it doesn't play together with Adaptive Scoring, so if you want to use this feature, you should use total-expire.

If you want a message to be excluded from expiration in a group where total or auto expire is active, set either tick (hit `u') or dormant mark (hit `u'), when you use auto-expire, you can also set the read mark (hit `d').

Question 6.6:

I don't want expiration to delete my mails but to move them to another group.

Answer:

Say something like this in ~/.gnus:

 
(setq nnmail-expiry-target "nnml:expired")

(If you want to change the value of nnmail-expiry-target on a per group basis see the question "How can I disable threading in some (e.g. mail-) groups, or set other variables specific for some groups?")


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on October, 20 2003 using texi2html