info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

quick howto on : socksified gnus (telnet)


From: Gernot Hassenpflug
Subject: quick howto on : socksified gnus (telnet)
Date: Wed, 09 May 2007 17:01:09 +0900
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux)

Hello all (and a special thanks to the news.motzarella.org staff for
giving me such a useful account). Here's a hopefully useful quick
howto for people using gnus from inside a company firewalland NAT
system which uses SOCKS (4 or 5) to pass through telnet services.

If you're running a modern version of GNU/linux, you'll be able to get
hold of "tsocks", a utility to socksify any (according to the man
page) TCP connection. I installed the package on my Ubuntu AMD64
Feisty and Debian x86 unstable systems.

First, edit /etc/tsocks.conf. You'll need to be root to do this, I did
not notice any way to make a local copy on a per-user basis.

Aside: there is also the proxychains package, which has a central file
and offers functionality for per-user files.

In the /etc/tsocks.conf file, change the address (IP or FQDN) of the
proxy and the port to those on your network. Also modify or add to the
local (direct, i.e., not socksified) domains.

Now, to test, run a telnet session to an outside machine like your
external newsserver:

$ telnet <machine> 119

... this should not work, since telnet does not support proxies!

Try again using tsocks:

$ tsocks telnet <machine> 119

Voila, you should be connected to the newsserver OK.


If you are in a terminal (you can add the following lines to your
startup script for the shell), you can switch on or off the tsocks for
all subsequent TCP connection attempts from that shell, as follows:

$ . /usr/bin/tsocks -on

to switch on, or

$ . /usr/bin/tsocks -off

to switch off again. Note that this is a shell script executing, and
requires the full path. For useres of (t)csh, presumably you need the
source command for this.


This trick now is how to get emacs to do this when you start up
gnus. Especially if you start your emacs from a graphical menu. I
struggled to make use of the gnus predefined variables and functions,
without success. nntp-pre-command looked promising, but it does not
seem to do what I thought it does (it is supposed to work with
"runsocks", a program I can not even find, let alone figure out what
it does. I surmise from the existing gnus documentation that it is a
wrapper, but I cannot find out any more about it or the
nntp-pre-command).

You can either start emacs from a command line as in the previous
example, and all subsequent programs starting from inside emacs will
make use of tsocks also, or you can switch on tsocks at the terminal
and then start emacs, with the same result.

$ tsocks emacs &

or

$ . /usr/bin/tsocks -on
$ emacs &

Alternatively, edit the menu items in your graphical menu to launch
emacs. I use GNOME, so I go to the System->Preferences->Main Menu
item, find the various instances of Emacs I have there, tight-click on
each and go to Properties, where I add tsocks in front of the
launching command. Voila, you now call a socksified emacs application
and can use gnus to telnet socksified connections to an external
newsserver. If your /etc/tsocks.conf has the local domains listed, any
local newsservers will be connected to directly.

Have fun!

If anyone can comment further on how possibly to do socksifying in the
nntp connection opening lisp code in the ~/.gnus setup file, please
add to this thread. As SOCKS proxies and firewalls as so common these
days, but a Google search of Google Groups revealed a mere three posts
mentioning nntp-pre-command, I surmise an entirely different approach
is probably needed....

Regards,
        Gernot Hassenpflug
-- 
BOFH excuse #275:

Bit rot


reply via email to

[Prev in Thread] Current Thread [Next in Thread]