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

10.9.3 Getting messages

Question 3.1:  I just installed Gnus, started it via M-x gnus but it only says
            "nntp (news) open error", what to do? 
Question 3.2:  I'm working under Windows and have no idea what ~/.gnus means.
Question 3.3:  My news server requires authentication, how to store user name and password on disk?
Question 3.4:  Gnus seems to start up OK, but I can't find out how to subscribe to a group.
Question 3.5:  Gnus doesn't show all groups / Gnus says I'm not allowed to post on this server as well as I am, what's that?
Question 3.6:  I want Gnus to fetch news from several servers, is this possible?
Question 3.7:  And how about local spool files?
Question 3.8:  OK, reading news works now, but I want to be able to read my mail with Gnus, too. How to do it?
Question 3.9:  And what about IMAP?
Question 3.10:  At the office we use one of those MS Exchange servers, can I use Gnus to read my mail from it?
Question 3.11:  Can I tell Gnus not to delete the mails on the server it retrieves via POP3?

Question 3.1:

I just installed Gnus, started it via `M-x gnus' but it only says "nntp (news) open error", what to do?

Answer:

You've got to tell Gnus where to fetch the news from. Read the documentation for information on how to do this. As a first start, put those lines in ~/.gnus:

 
(setq gnus-select-method '(nntp "news.yourprovider.net"))
(setq user-mail-address "you@yourprovider.net")
(setq user-full-name "Your Name")

Question 3.2:

I'm working under Windows and have no idea what ~/.gnus means.

Answer:

The ~/ means the home directory where Gnus and Emacs look for the configuration files. However, you don't really need to know what this means, it suffices that Emacs knows what it means :-) You can type `C-x C-f ~/.gnus RET ' (yes, with the forward slash, even on Windows), and Emacs will open the right file for you. (It will most likely be new, and thus empty.) However, I'd discourage you from doing so, since the directory Emacs chooses will most certainly not be what you want, so let's do it the correct way. The first thing you've got to do is to create a suitable directory (no blanks in directory name please) e.g. `c:\myhome'. Then you must set the environment variable HOME to this directory. To do this under Win9x or Me include the line

 
SET HOME=C:\myhome
	    

in your autoexec.bat and reboot. Under NT, 2000 and XP, hit Winkey+Pause/Break to enter system options (if it doesn't work, go to Control Panel -> System). There you'll find the possibility to set environment variables, create a new one with name HOME and value `c:\myhome', a reboot is not necessary.

Now to create ~/.gnus, say `C-x C-f ~/.gnus RET C-x C-s'. in Emacs.

Question 3.3:

My news server requires authentication, how to store user name and password on disk?

Answer:

Create a file ~/.authinfo which includes for each server a line like this

 
machine news.yourprovider.net login YourUserName password YourPassword

. Make sure that the file isn't readable to others if you work on a OS which is capable of doing so. (Under Unix say

 
chmod 600 ~/.authinfo

in a shell.)

Question 3.4:

Gnus seems to start up OK, but I can't find out how to subscribe to a group.

Answer:

If you know the name of the group say `U name.of.group RET' in group buffer (use the tab-completion Luke). Otherwise hit ^ in group buffer, this brings you to the server buffer. Now place point (the cursor) over the server which carries the group you want, hit `RET', move point to the group you want to subscribe to and say `u' to subscribe to it.

Question 3.5:

Gnus doesn't show all groups / Gnus says I'm not allowed to post on this server as well as I am, what's that?

Answer:

Some providers allow restricted anonymous access and full access only after authorization. To make Gnus send authinfo to those servers append

 
force yes

to the line for those servers in ~/.authinfo.

Question 3.6:

I want Gnus to fetch news from several servers, is this possible?

Answer:

Of course. You can specify more sources for articles in the variable gnus-secondary-select-methods. Add something like this in ~/.gnus:

 
(add-to-list 'gnus-secondary-select-methods 
	     '(nntp "news.yourSecondProvider.net"))
(add-to-list 'gnus-secondary-select-methods 
	     '(nntp "news.yourThirdProvider.net"))	    

Question 3.7:

And how about local spool files?

Answer:

No problem, this is just one more select method called nnspool, so you want this:

 
(add-to-list 'gnus-secondary-select-methods '(nnspool ""))

Or this if you don't want an NNTP Server as primary news source:

 
(setq gnus-select-method '(nnspool ""))

Gnus will look for the spool file in /usr/spool/news, if you want something different, change the line above to something like this:

 
(add-to-list 'gnus-secondary-select-methods
             '(nnspool "" (nnspool-directory "/usr/local/myspoolddir")))

This sets the spool directory for this server only. You might have to specify more stuff like the program used to post articles, see the Gnus manual on how to do this.

Question 3.8:

OK, reading news works now, but I want to be able to read my mail with Gnus, too. How to do it?

Answer:

That's a bit harder since there are many possible sources for mail, many possible ways for storing mail and many different ways for sending mail. The most common cases are these: 1: You want to read your mail from a pop3 server and send them directly to a SMTP Server 2: Some program like fetchmail retrieves your mail and stores it on disk from where Gnus shall read it. Outgoing mail is sent by Sendmail, Postfix or some other MTA. Sometimes, you even need a combination of the above cases.

However, the first thing to do is to tell Gnus in which way it should store the mail, in Gnus terminology which back end to use. Gnus supports many different back ends, the most commonly used one is nnml. It stores every mail in one file and is therefor quite fast. However you might prefer a one file per group approach if your file system has problems with many small files, the nnfolder back end is then probably the choice for you. To use nnml add the following to ~/.gnus:

 
(add-to-list 'gnus-secondary-select-methods '(nnml ""))

As you might have guessed, if you want nnfolder, it's

 
(add-to-list 'gnus-secondary-select-methods '(nnfolder ""))

Now we need to tell Gnus, where to get it's mail from. If it's a POP3 server, then you need something like this:

 
(eval-after-load "mail-source"
  '(add-to-list 'mail-sources '(pop :server "pop.YourProvider.net"
                                    :user "yourUserName"
                                    :password "yourPassword")))

Make sure ~/.gnus isn't readable to others if you store your password there. If you want to read your mail from a traditional spool file on your local machine, it's

 
(eval-after-load "mail-source"
  '(add-to-list 'mail-sources '(file :path "/path/to/spool/file")))

If it's a Maildir, with one file per message as used by postfix, Qmail and (optionally) fetchmail it's

 
(eval-after-load "mail-source"
  '(add-to-list 'mail-sources '(maildir :path "/path/to/Maildir/"
                                        :subdirs ("cur" "new")))

And finally if you want to read your mail from several files in one directory, for example because procmail already split your mail, it's

 
(eval-after-load "mail-source"
  '(add-to-list 'mail-sources '(directory :path "/path/to/procmail-dir/"
                                          :suffix ".prcml"))

Where :suffix ".prcml" tells Gnus only to use files with the suffix .prcml.

OK, now you only need to tell Gnus how to send mail. If you want to send mail via sendmail (or whichever MTA is playing the role of sendmail on your system), you don't need to do anything. However, if you want to send your mail to an SMTP Server you need the following in your ~/.gnus

 
(setq send-mail-function 'smtpmail-send-it)
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-default-smtp-server "smtp.yourProvider.net")

Question 3.9:

And what about IMAP?

Answer:

There are two ways of using IMAP with Gnus. The first one is to use IMAP like POP3, that means Gnus fetches the mail from the IMAP server and stores it on disk. If you want to do this (you don't really want to do this) add the following to ~/.gnus

 
(add-to-list 'mail-sources '(imap :server "mail.mycorp.com"
                                  :user "username"
                                  :pass "password"
                                  :stream network
                                  :authentication login
                                  :mailbox "INBOX"
                                  :fetchflag "\\Seen"))

You might have to tweak the values for stream and/or authentification, see the Gnus manual node "Mail Source Specifiers" for possible values.

If you want to use IMAP the way it's intended, you've got to follow a different approach. You've got to add the nnimap back end to your select method and give the information about the server there.

 
(add-to-list 
 'gnus-secondary-select-methods
 '(nnimap "Give the baby a name"
	  (nnimap-address "imap.yourProvider.net")
	  (nnimap-port 143)
	  (nnimap-list-pattern "archive.*")))

Again, you might have to specify how to authenticate to the server if Gnus can't guess the correct way, see the Manual Node "IMAP" for detailed information.

Question 3.10:

At the office we use one of those MS Exchange servers, can I use Gnus to read my mail from it?

Answer:

Offer your administrator a pair of new running shoes for activating IMAP on the server and follow the instructions above.

Question 3.11:

Can I tell Gnus not to delete the mails on the server it retrieves via POP3?

Answer:

First of all, that's not the way POP3 is intended to work, if you have the possibility, you should use the IMAP Protocol if you want your messages to stay on the server. Nevertheless there might be situations where you need the feature, but sadly Gnus itself has no predefined functionality to do so.

However this is Gnus county so there are possibilities to achieve what you want. The easiest way is to get an external program which retrieves copies of the mail and stores them on disk, so Gnus can read it from there. On Unix systems you could use e.g. fetchmail for this, on MS Windows you can use Hamster, an excellent local news and mail server.

The other solution would be, to replace the method Gnus uses to get mail from POP3 servers by one which is capable of leaving the mail on the server. If you use XEmacs, get the package mail-lib, it includes an enhanced pop3.el, look in the file, there's documentation on how to tell Gnus to use it and not to delete the retrieved mail. For GNU Emacs look for the file epop3.el which can do the same (If you know the home of this file, please send me an e-mail). You can also tell Gnus to use an external program (e.g. fetchmail) to fetch your mail, see the info node "Mail Source Specifiers" in the Gnus manual on how to do it.


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

This document was generated on October, 20 2003 using texi2html