UP | HOME

Gnus is great. Here's how to get started using email with it. To unlock the real power of gnus, you'll have to use newsgroups. Then only will the terminology will make sense and you can start reading it's manual.

Note that the gnus manual, however dense might it seem is very descriptive. So, you should use newsgroups for a little while before using gnus to read mail. For that, skip directly to Select methods section below.

Mail sources

The variable mail-sources has the sources for fetching mail from. Gnus will fetch it from different servers and store them in the hard disk. You can set-it as:

;; (info "(gnus) Mail Source Specifiers")
(setq mail-sources '((imap :server "imap.domain.tld"
			   :user "user@host.tld"
			   :password "very-secret")
		    (pop :server "pop3.mailserver.com"
			 :user "myname")))

Select methods

Select methods are responsible for getting and handling mails. There are various ways to go about it.

You could get you mail from a pop server and may want it to store it in mbox or maildir or mail spools formats. There are two types of select methods. gnus-select-method and gnus-secondary-select-methods. Both of them act the same way except that as the name implies, gnus-select-method can only work with one backend.

While there is a info node talking about select methods, i will not link to it since the only select methods people will use is either nntp or some sort of mail-related select method. The comparison of mail-related select methods can be read with: (info "(gnus) Comparing Mail Back Ends") As is said on that node, if you're on a personal computer, use nnml. However, nnml will likely not work with other MUAs. But that will never be needed ;-) (if you do want that, or are not in a personal computer, use nnfolder)

To get news from a newsgroup (news.gmane.org), get mail as defined in mail-sources and store them in nnml files in ~/Mail/, you'd use the following:

(setq gnus-select-method '(nntp "news.gmane.io")
      gnus-secondary-select-methods '((nnml "")))

Splitting Mails

Not all mails are the same. Splitting takes all the incoming mail and divides them into various groups. Using gnus-group-split, we'll make some groups and then in the group parameters (G c), tell it some basic information. Gnus will then use this information to make a nnmail-split-fancy s-exp and split accordingly.

(setq nnmail-split-methods 'gnus-group-split
      ;;if incase you're using nnmaildir
      nnmail-resplit-incoming t)

Then, edit the group parameters after making the group with G c or G p and have it like:

((to-list . "foo@nowhere.gov")
 (extra-aliases "foo@localhost" "foo-redist@home")
 (split-exclude "bugs-foo" "rambling-foo")
 (admin-address . "foo-request@nowhere.gov"))

Email: ashwin@ashwink.com.np

Validate