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

6.1 Server Buffer

Traditionally, a server is a machine or a piece of software that one connects to, and then requests information from. Gnus does not connect directly to any real servers, but does all transactions through one back end or other. But that’s just putting one layer more between the actual media and Gnus, so we might just as well say that each back end represents a virtual server.

For instance, the nntp back end may be used to connect to several different actual NNTP servers, or, perhaps, to many different ports on the same actual NNTP server. You tell Gnus which back end to use, and what parameters to set by specifying a select method.

These select method specifications can sometimes become quite complicated—say, for instance, that you want to read from the NNTP server ‘news.funet.fi’ on port number 13, which hangs if queried for NOV headers and has a buggy select. Ahem. Anyway, if you had to specify that for each group that used this server, that would be too much work, so Gnus offers a way of naming select methods, which is what you do in the server buffer.

To enter the server buffer, use the ^ (gnus-group-enter-server-mode) command in the group buffer.

gnus-server-mode-hook is run when creating the server buffer.


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

6.1.1 Server Buffer Format

You can change the look of the server buffer lines by changing the gnus-server-line-format variable. This is a format-like variable, with some simple extensions:

h

How the news is fetched—the back end name.

n

The name of this server.

w

Where the news is to be fetched from—the address.

s

The opened/closed/denied status of the server.

a

Whether this server is agentized.

The mode line can also be customized by using the gnus-server-mode-line-format variable (see section Mode Line Formatting). The following specs are understood:

S

Server name.

M

Server method.

Also see section Formatting Variables.


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

6.1.2 Server Commands

v

The key v is reserved for users. You can bind it to some command or better use it as a prefix key.

a

Add a new server (gnus-server-add-server).

e

Edit a server (gnus-server-edit-server).

S

Show the definition of a server (gnus-server-show-server).

SPACE

Browse the current server (gnus-server-read-server).

q

Return to the group buffer (gnus-server-exit).

k

Kill the current server (gnus-server-kill-server).

y

Yank the previously killed server (gnus-server-yank-server).

c

Copy the current server (gnus-server-copy-server).

l

List all servers (gnus-server-list-servers).

s

Request that the server scan its sources for new articles (gnus-server-scan-server). This is mainly sensible with mail servers.

g

Request that the server regenerate all its data structures (gnus-server-regenerate-server). This can be useful if you have a mail back end that has gotten out of sync.

z

Compact all groups in the server under point (gnus-server-compact-server). Currently implemented only in nnml (see section Mail Spool). This removes gaps between article numbers, hence getting a correct total article count.

Some more commands for closing, disabling, and re-opening servers are listed in Unavailable Servers.


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

6.1.3 Example Methods

Most select methods are pretty simple and self-explanatory:

 
(nntp "news.funet.fi")

Reading directly from the spool is even simpler:

 
(nnspool "")

As you can see, the first element in a select method is the name of the back end, and the second is the address, or name, if you will.

After these two elements, there may be an arbitrary number of (variable form) pairs.

To go back to the first example—imagine that you want to read from port 15 on that machine. This is what the select method should look like then:

 
(nntp "news.funet.fi" (nntp-port-number 15))

You should read the documentation to each back end to find out what variables are relevant, but here’s an nnmh example:

nnmh is a mail back end that reads a spool-like structure. Say you have two structures that you wish to access: One is your private mail spool, and the other is a public one. Here’s the possible spec for your private mail:

 
(nnmh "private" (nnmh-directory "~/private/mail/"))

(This server is then called ‘private’, but you may have guessed that.)

Here’s the method for a public spool:

 
(nnmh "public"
      (nnmh-directory "/usr/information/spool/")
      (nnmh-get-new-mail nil))

If you are behind a firewall and only have access to the NNTP server from the firewall machine, you can instruct Gnus to rlogin on the firewall machine and connect with netcat from there to the NNTP server. Doing this can be rather fiddly, but your virtual server definition should probably look something like this:

 
(nntp "firewall"
      (nntp-open-connection-function nntp-open-via-rlogin-and-netcat)
      (nntp-via-address "the.firewall.machine")
      (nntp-address "the.real.nntp.host"))

If you want to use the wonderful ssh program to provide a compressed connection over the modem line, you could add the following configuration to the example above:

 
      (nntp-via-rlogin-command "ssh")

See also nntp-via-rlogin-command-switches. Here’s an example for an indirect connection:

 
(setq gnus-select-method
      '(nntp "indirect"
             (nntp-address "news.server.example")
             (nntp-via-user-name "intermediate_user_name")
             (nntp-via-address "intermediate.host.example")
             (nntp-via-rlogin-command "ssh")
             (nntp-via-rlogin-command-switches ("-C"))
             (nntp-open-connection-function nntp-open-via-rlogin-and-netcat)))

This means that you have to have set up ssh-agent correctly to provide automatic authorization, of course.

If you’re behind a firewall, but have direct access to the outside world through a wrapper command like "runsocks", you could open a socksified netcat connection to the news server as follows:

 
(nntp "outside"
      (nntp-pre-command "runsocks")
      (nntp-open-connection-function nntp-open-netcat-stream)
      (nntp-address "the.news.server"))

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

6.1.4 Creating a Virtual Server

If you’re saving lots of articles in the cache by using persistent articles, you may want to create a virtual server to read the cache.

First you need to add a new server. The a command does that. It would probably be best to use nnml to read the cache. You could also use nnspool or nnmh, though.

Type a nnml RET cache RET.

You should now have a brand new nnml virtual server called ‘cache’. You now need to edit it to have the right definitions. Type e to edit the server. You’ll be entered into a buffer that will contain the following:

 
(nnml "cache")

Change that to:

 
(nnml "cache"
         (nnml-directory "~/News/cache/")
         (nnml-active-file "~/News/cache/active"))

Type C-c C-c to return to the server buffer. If you now press RET over this virtual server, you should be entered into a browse buffer, and you should be able to enter any of the groups displayed.


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

6.1.5 Server Variables

One sticky point when defining variables (both on back ends and in Emacs in general) is that some variables are typically initialized from other variables when the definition of the variables is being loaded. If you change the “base” variable after the variables have been loaded, you won’t change the “derived” variables.

This typically affects directory and file variables. For instance, nnml-directory is ‘~/Mail/’ by default, and all nnml directory variables are initialized from that variable, so nnml-active-file will be ‘~/Mail/active’. If you define a new virtual nnml server, it will not suffice to set just nnml-directory—you have to explicitly set all the file variables to be what you want them to be. For a complete list of variables for each back end, see each back end’s section later in this manual, but here’s an example nnml definition:

 
(nnml "public"
      (nnml-directory "~/my-mail/")
      (nnml-active-file "~/my-mail/active")
      (nnml-newsgroups-file "~/my-mail/newsgroups"))

Server variables are often called server parameters.


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

6.1.6 Servers and Methods

Wherever you would normally use a select method (e.g., gnus-secondary-select-method, in the group select method, when browsing a foreign server) you can use a virtual server name instead. This could potentially save lots of typing. And it’s nice all over.


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

6.1.7 Unavailable Servers

If a server seems to be unreachable, Gnus will mark that server as denied. That means that any subsequent attempt to make contact with that server will just be ignored. “It can’t be opened,” Gnus will tell you, without making the least effort to see whether that is actually the case or not.

That might seem quite naughty, but it does make sense most of the time. Let’s say you have 10 groups subscribed to on server ‘nephelococcygia.com’. This server is located somewhere quite far away from you and the machine is quite slow, so it takes 1 minute just to find out that it refuses connection to you today. If Gnus were to attempt to do that 10 times, you’d be quite annoyed, so Gnus won’t attempt to do that. Once it has gotten a single “connection refused”, it will regard that server as “down”.

So, what happens if the machine was only feeling unwell temporarily? How do you test to see whether the machine has come up again?

You jump to the server buffer (see section Server Buffer) and poke it with the following commands:

O

Try to establish connection to the server on the current line (gnus-server-open-server).

C

Close the connection (if any) to the server (gnus-server-close-server).

D

Mark the current server as unreachable (gnus-server-deny-server).

M-o

Open the connections to all servers in the buffer (gnus-server-open-all-servers).

M-c

Close the connections to all servers in the buffer (gnus-server-close-all-servers).

R

Remove all marks to whether Gnus was denied connection from any servers (gnus-server-remove-denials).

c

Copy a server and give it a new name (gnus-server-copy-server). This can be useful if you have a complex method definition, and want to use the same definition towards a different (physical) server.

L

Set server status to offline (gnus-server-offline-server).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated on January 25, 2015 using texi2html 1.82.