Next: Creating a Virtual Server, Previous: Server Commands, Up: Server Buffer [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"))

Next: Creating a Virtual Server, Previous: Server Commands, Up: Server Buffer [Contents][Index]