Function: nntp-open-via-rlogin-and-telnet

nntp-open-via-rlogin-and-telnet is a byte-compiled function defined in nntp.el.gz.

Signature

(nntp-open-via-rlogin-and-telnet BUFFER)

Documentation

Open a connection to an nntp server through an intermediate host.

First rlogin to the remote host, and then telnet the real news server from there. nntp-open-via-rlogin-and-netcat is recommended in place of this function because it is more reliable.

Please refer to the following variables to customize the connection:
- nntp-pre-command,
- nntp-via-rlogin-command,
- nntp-via-rlogin-command-switches,
- nntp-via-user-name,
- nntp-via-address,
- nntp-telnet-command,
- nntp-telnet-switches,
- nntp-address,
- nntp-port-number,
- nntp-end-of-line.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nntp.el.gz
(defun nntp-open-via-rlogin-and-telnet (buffer)
  "Open a connection to an nntp server through an intermediate host.
First rlogin to the remote host, and then telnet the real news server
from there.
`nntp-open-via-rlogin-and-netcat' is recommended in place of this function
because it is more reliable.

Please refer to the following variables to customize the connection:
- `nntp-pre-command',
- `nntp-via-rlogin-command',
- `nntp-via-rlogin-command-switches',
- `nntp-via-user-name',
- `nntp-via-address',
- `nntp-telnet-command',
- `nntp-telnet-switches',
- `nntp-address',
- `nntp-port-number',
- `nntp-end-of-line'."
  (let ((command `(,nntp-via-address
		   ,nntp-telnet-command
		   ,@nntp-telnet-switches))
	proc)
    (when nntp-via-user-name
      (setq command `("-l" ,nntp-via-user-name ,@command)))
    (when nntp-via-rlogin-command-switches
      (setq command (append nntp-via-rlogin-command-switches command)))
    (push nntp-via-rlogin-command command)
    (and nntp-pre-command
	 (push nntp-pre-command command))
    (setq proc (apply #'start-process "nntpd" buffer command))
    (with-current-buffer buffer
      (nntp-wait-for-string "^r?telnet")
      (process-send-string proc (concat "open " nntp-address " "
					(nntp-service-to-port nntp-port-number)
					"\n"))
      (nntp-wait-for-string "^\r*20[01]")
      (beginning-of-line)
      (delete-region (point-min) (point))
      (process-send-string proc "\^]")
      (nntp-wait-for-string "^r?telnet")
      (process-send-string proc "mode character\n")
      (accept-process-output proc 1)
      (sit-for 1)
      (goto-char (point-min))
      (forward-line 1)
      (delete-region (point) (point-max)))
    proc))