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
MODE READERto the server with the
nntp-send-mode-readerfunction. This function should always be present in this hook.
nntp-send-authinfo, which looks through your ~/.authinfo (or whatever you've set the
nntp-authinfo-filevariable to) 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
ftpmanual page, but here are the salient facts:
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.
default force yes
This will force sending ‘AUTHINFO’ commands to all servers not previously mentioned.
Remember to not leave the ~/.authinfo file world-readable.
(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.
headcommands. 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-requestvariable, and is 400 by default. If your network is buggy, you should set this to 1.
nntpgroups 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
nntpback end should wait for a connection before giving up. If it is
nil, which is the default, no timeouts are done.
nntpusually checks automatically whether NOV can be used.
nntpnormally 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
nntpwill 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
XOVERrequest 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
nntpwill never split requests. The default is 5.
Message-IDthat a user specifies or having the
Message-IDof the parent article of the current one (see Finding the Parent), Gnus sends a
HEADcommand 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
Xrefheader. 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-IDotherwise. 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
Xrefheader 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-
nilvalue, 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
nntpwill 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-functionparameter, 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).
nilmeans 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-
nilin the method for such a server setting
nntp-open-ssl-streamfor example. The default value is
nil. Note that the
nntp-open-connection-functions-never-echo-commandsvariable overrides the
nilvalue of this variable.
nntp-open-connection-functionto this list if it does not echo commands. Note that a non-
nilvalue of the
nntp-never-echoes-commandsvariable overrides this variable. The default value is
Message-IDheader 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-Lockheaders even if you inhibit Gnus to add a
Message-IDheader, 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.
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.