Gnus Manual. Node: Example Methods

PREVServer Commands UPThe Server Buffer NEXTCreating a Virtual Server

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 backend, 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 backend to find out what variables are relevant, but here's an nnmh example:

nnmh is a mail backend 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 telnet 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-address "the.firewall.machine")
      (nntp-open-connection-function nntp-open-rlogin)
      (nntp-end-of-line "\n")
      (nntp-rlogin-parameters
       ("telnet" "the.real.nntp.host" "nntp")))

If you want to use the wonderful ssh program to provide a compressed connection over the modem line, you could create a virtual server that would look something like this:

(nntp "news"
       (nntp-address "copper.uio.no")
       (nntp-rlogin-program "ssh")
       (nntp-open-connection-function nntp-open-rlogin)
       (nntp-end-of-line "\n")
       (nntp-rlogin-parameters
        ("telnet" "news.uio.no" "nntp")))

This means that you have to have set up ssh-agent correctly to provide automatic authorization, of course. And to get a compressed connection, you have to have the `Compression' option in the ssh `config' file.

PREVServer Commands UPThe Server Buffer NEXTCreating a Virtual Server