(defvoo nntp-open-connection-function 'nntp-open-network-stream
"*Function used for connecting to a remote system.
-It will be called with the buffer to output in.
+It will be called with the buffer to output in as argument.
-Two pre-made functions are `nntp-open-network-stream', which is the
-default, and simply connects to some port or other on the remote
-system (see nntp-port-number). The other are `nntp-open-rlogin',
-which does an rlogin on the remote system, and then does a telnet to
-the NNTP server available there (see nntp-rlogin-parameters) and
-`nntp-open-telnet' which telnets to a remote system, logs in and does
-the same.")
+Currently, five such functions are provided (please refer to their
+respective doc string for more information), three of them establishing
+direct connections to the nntp server, and two of them using an indirect
+host.
-(defvoo nntp-rlogin-program "rsh"
- "*Program used to log in on remote machines.
-The default is \"rsh\", but \"ssh\" is a popular alternative.")
+Direct connections:
+- `nntp-open-network-stream' (the default),
+- `nntp-open-ssl-stream',
+- `nntp-open-telnet-stream'.
-(defvoo nntp-rlogin-parameters '("telnet" "-8" "${NNTPSERVER:=news}" "nntp")
- "*Parameters to `nntp-open-rlogin'.
-That function may be used as `nntp-open-connection-function'. In that
-case, this list will be used as the parameter list given to rsh.")
+Indirect connections:
+- `nntp-open-via-rlogin-and-telnet',
+- `nntp-open-via-telnet-and-telnet'.")
-(defvoo nntp-rlogin-user-name nil
- "*User name on remote system when using the rlogin connect method.")
+(defvoo nntp-pre-command nil
+ "*Pre-command to use with the various nntp-open-via-* methods.
+This is where you would put \"runsocks\" or stuff like that.")
-(defvoo nntp-telnet-parameters
- '("exec" "telnet" "-8" "${NNTPSERVER:=news}" "nntp")
- "*Parameters to `nntp-open-telnet'.
-That function may be used as `nntp-open-connection-function'. In that
-case, this list will be executed as a command after logging in
-via telnet.")
+(defvoo nntp-telnet-command "telnet"
+ "*Telnet command used to connect to the nntp server.
+This command is used by the various nntp-open-via-* methods.")
-(defvoo nntp-telnet-user-name nil
- "User name to log in via telnet with.")
+(defvoo nntp-telnet-switches '("-8")
+ "*Switches given to the telnet command `nntp-telnet-command'.")
-(defvoo nntp-telnet-passwd nil
- "Password to use to log in via telnet with.")
+(defvoo nntp-end-of-line "\r\n"
+ "*String to use on the end of lines when talking to the NNTP server.
+This is \"\\r\\n\" by default, but should be \"\\n\" when
+using and indirect connection method (nntp-open-via-*).")
-(defvoo nntp-open-telnet-envuser nil
- "*If non-nil, telnet session (client and server both) will support the ENVIRON option and not prompt for login name.")
+(defvoo nntp-via-rlogin-command "rsh"
+ "*Rlogin command used to connect to an intermediate host.
+This command is used by the `nntp-open-via-rlogin-and-telnet' method.
+The default is \"rsh\", but \"ssh\" is a popular alternative.")
-(defvoo nntp-telnet-shell-prompt "bash\\|\$ *\r?$\\|> *\r?"
- "*Regular expression to match the shell prompt on the remote machine.")
+(defvoo nntp-via-telnet-command "telnet"
+ "*Telnet command used to connect to an intermediate host.
+This command is used by the `nntp-open-via-telnet-and-telnet' method.")
-(defvoo nntp-telnet-command "telnet"
- "Command used to start telnet.")
+(defvoo nntp-via-telnet-switches '("-8")
+ "*Switches given to the telnet command `nntp-via-telnet-command'.")
-(defvoo nntp-telnet-switches '("-8")
- "Switches given to the telnet command.")
+(defvoo nntp-via-user-name nil
+ "*User name to log in on an intermediate host with.
+This variable is used by the `nntp-open-via-telnet-and-telnet' method.")
-(defvoo nntp-end-of-line "\r\n"
- "String to use on the end of lines when talking to the NNTP server.
-This is \"\\r\\n\" by default, but should be \"\\n\" when
-using rlogin or telnet to communicate with the server.")
+(defvoo nntp-via-user-password nil
+ "*Password to use to log in on an intermediate host with.
+This variable is used by the `nntp-open-via-telnet-and-telnet' method.")
+
+(defvoo nntp-via-address nil
+ "*Address of an intermediate host to connect to.
+This variable is used by the `nntp-open-via-rlogin-and-telnet' and
+`nntp-open-via-telnet-and-telnet' methods.")
+
+(defvoo nntp-via-envuser nil
+ "*Whether both telnet client and server support the ENVIRON option.
+If non-nil, there will be no prompt for a login name.")
+
+(defvoo nntp-via-shell-prompt "bash\\|\$ *\r?$\\|> *\r?"
+ "*Regular expression to match the shell prompt on an intermediate host.
+This variable is used by the `nntp-open-via-telnet-and-telnet' method.")
(defvoo nntp-large-newsgroup 50
"*The number of the articles which indicates a large newsgroup.
(memq (process-status process) '(open run)))
(when (looking-at "480")
(nntp-handle-authinfo process))
+ (when (looking-at "^.*\n")
+ (delete-region (point) (progn (forward-line 1) (point))))
(nntp-accept-process-output process)
(goto-char (point-min)))
(prog1
(save-excursion
(set-buffer nntp-server-buffer)
(erase-buffer)))
- (nntp-retrieve-data
- (mapconcat 'identity strings " ")
- nntp-address nntp-port-number nntp-server-buffer
- wait-for nnheader-callback-function))
+ (let* ((command (mapconcat 'identity strings " "))
+ (buffer (process-buffer (nntp-find-connection nntp-server-buffer)))
+ (pos (point buffer)))
+ (prog1
+ (nntp-retrieve-data command
+ nntp-address nntp-port-number nntp-server-buffer
+ wait-for nnheader-callback-function)
+ ;; If nothing to wait for, still remove possibly echo'ed commands
+ (unless wait-for
+ (nntp-accept-response)
+ (save-excursion
+ (set-buffer buffer)
+ (goto-char pos)
+ (if (looking-at (regexp-quote command))
+ (delete-region pos (progn (forward-line 1) (point-at-bol))))
+ )))
+ ))
(defun nntp-send-command-nodelete (wait-for &rest strings)
"Send STRINGS to server and wait until WAIT-FOR returns."
- (nntp-retrieve-data
- (mapconcat 'identity strings " ")
- nntp-address nntp-port-number nntp-server-buffer
- wait-for nnheader-callback-function))
+ (let* ((command (mapconcat 'identity strings " "))
+ (buffer (process-buffer (nntp-find-connection nntp-server-buffer)))
+ (pos (point buffer)))
+ (prog1
+ (nntp-retrieve-data command
+ nntp-address nntp-port-number nntp-server-buffer
+ wait-for nnheader-callback-function)
+ ;; If nothing to wait for, still remove possibly echo'ed commands
+ (unless wait-for
+ (nntp-accept-response)
+ (save-excursion
+ (set-buffer buffer)
+ (goto-char pos)
+ (if (looking-at (regexp-quote command))
+ (delete-region pos (progn (forward-line 1) (point-at-bol))))
+ )))
+ ))
(defun nntp-send-command-and-decode (wait-for &rest strings)
"Send STRINGS to server and wait until WAIT-FOR returns."
(save-excursion
(set-buffer nntp-server-buffer)
(erase-buffer)))
- (nntp-retrieve-data
- (mapconcat 'identity strings " ")
- nntp-address nntp-port-number nntp-server-buffer
- wait-for nnheader-callback-function t))
+ (let* ((command (mapconcat 'identity strings " "))
+ (buffer (process-buffer (nntp-find-connection nntp-server-buffer)))
+ (pos (point buffer)))
+ (prog1
+ (nntp-retrieve-data command
+ nntp-address nntp-port-number nntp-server-buffer
+ wait-for nnheader-callback-function t)
+ ;; If nothing to wait for, still remove possibly echo'ed commands
+ (unless wait-for
+ (nntp-accept-response)
+ (save-excursion
+ (set-buffer buffer)
+ (goto-char pos)
+ (if (looking-at (regexp-quote command))
+ (delete-region pos (progn (forward-line 1) (point-at-bol))))
+ )))
+ ))
+
(defun nntp-send-buffer (wait-for)
"Send the current buffer to server and wait until WAIT-FOR returns."
(setq last-point (point))
(< received count)))
(nntp-accept-response))))
-
+
;; Wait for the reply from the final command.
(unless (gnus-buffer-live-p buf)
(nnheader-report 'nntp "Connection to %s is closed." server)
(not (re-search-backward "^\\.\r?\n"
(- (point) 4) t)))))
(nntp-accept-response)))
-
+
;; Now all replies are received. We remove CRs.
(unless (gnus-buffer-live-p buf)
(nnheader-report 'nntp "Connection to %s is closed." server)
(goto-char (point-min))
(while (search-forward "\r" nil t)
(replace-match "" t t))
-
+
(if (not nntp-server-list-active-group)
(progn
(copy-to-buffer nntp-server-buffer (point-min) (point-max))
(progn (forward-line 1) (point))))
(copy-to-buffer nntp-server-buffer (point-min) (point-max))
'active))))))
-
+
(deffoo nntp-retrieve-articles (articles &optional group server)
(nntp-possibly-change-group group server)
(save-excursion
(while (and (cdr articles)
(< (- (nth 1 articles) (car articles)) nntp-nov-gap))
(setq articles (cdr articles)))
-
+
(setq in-process-buffer-p (stringp nntp-server-xover))
(nntp-send-xover-command first (car articles))
(setq articles (cdr articles))
-
+
(when (and nntp-server-xover in-process-buffer-p)
;; Don't count tried request.
(setq count (1+ count))
(setq nntp-server-xover nil)))
nntp-server-xover))))
-;;; Alternative connection methods.
+(defun nntp-find-group-and-number ()
+ (save-excursion
+ (save-restriction
+ (set-buffer nntp-server-buffer)
+ (narrow-to-region (goto-char (point-min))
+ (or (search-forward "\n\n" nil t) (point-max)))
+ (goto-char (point-min))
+ ;; We first find the number by looking at the status line.
+ (let ((number (and (looking-at "2[0-9][0-9] +\\([0-9]+\\) ")
+ (string-to-int
+ (buffer-substring (match-beginning 1)
+ (match-end 1)))))
+ group newsgroups xref)
+ (and number (zerop number) (setq number nil))
+ ;; Then we find the group name.
+ (setq group
+ (cond
+ ;; If there is only one group in the Newsgroups header,
+ ;; then it seems quite likely that this article comes
+ ;; from that group, I'd say.
+ ((and (setq newsgroups (mail-fetch-field "newsgroups"))
+ (not (string-match "," newsgroups)))
+ newsgroups)
+ ;; If there is more than one group in the Newsgroups
+ ;; header, then the Xref header should be filled out.
+ ;; We hazard a guess that the group that has this
+ ;; article number in the Xref header is the one we are
+ ;; looking for. This might very well be wrong if this
+ ;; article happens to have the same number in several
+ ;; groups, but that's life.
+ ((and (setq xref (mail-fetch-field "xref"))
+ number
+ (string-match (format "\\([^ :]+\\):%d" number) xref))
+ (substring xref (match-beginning 1) (match-end 1)))
+ (t "")))
+ (when (string-match "\r" group)
+ (setq group (substring group 0 (match-beginning 0))))
+ (cons group number)))))
(defun nntp-wait-for-string (regexp)
"Wait until string arrives in the buffer."
(set-buffer buf)
(goto-char (point-min)))))
+
+;; ==========================================================================
+;; Obsolete nntp-open-* connection methods -- drv
+;; ==========================================================================
+
+(defvoo nntp-open-telnet-envuser nil
+ "*If non-nil, telnet session (client and server both) will support the ENVIRON option and not prompt for login name.")
+
+(defvoo nntp-telnet-shell-prompt "bash\\|\$ *\r?$\\|> *\r?"
+ "*Regular expression to match the shell prompt on the remote machine.")
+
+(defvoo nntp-rlogin-program "rsh"
+ "*Program used to log in on remote machines.
+The default is \"rsh\", but \"ssh\" is a popular alternative.")
+
+(defvoo nntp-rlogin-parameters '("telnet" "-8" "${NNTPSERVER:=news}" "nntp")
+ "*Parameters to `nntp-open-rlogin'.
+That function may be used as `nntp-open-connection-function'. In that
+case, this list will be used as the parameter list given to rsh.")
+
+(defvoo nntp-rlogin-user-name nil
+ "*User name on remote system when using the rlogin connect method.")
+
+(defvoo nntp-telnet-parameters
+ '("exec" "telnet" "-8" "${NNTPSERVER:=news}" "nntp")
+ "*Parameters to `nntp-open-telnet'.
+That function may be used as `nntp-open-connection-function'. In that
+case, this list will be executed as a command after logging in
+via telnet.")
+
+(defvoo nntp-telnet-user-name nil
+ "User name to log in via telnet with.")
+
+(defvoo nntp-telnet-passwd nil
+ "Password to use to log in via telnet with.")
+
(defun nntp-open-telnet (buffer)
(save-excursion
(set-buffer buffer)
(delete-region (point-min) (point))
proc)))
-(defun nntp-find-group-and-number ()
+
+;; ==========================================================================
+;; Replacements for the nntp-open-* functions -- drv
+;; ==========================================================================
+
+(defun nntp-open-telnet-stream (buffer)
+ "Open a nntp connection by telnet'ing the news server.
+
+Please refer to the following variables to customize the connection:
+- `nntp-pre-command',
+- `nntp-telnet-command',
+- `nntp-telnet-switches',
+- `nntp-address',
+- `nntp-port-number',
+- `nntp-end-of-line'."
+ (let ((command `(,nntp-telnet-command
+ ,@nntp-telnet-switches
+ ,nntp-address ,nntp-port-number))
+ proc)
+ (and nntp-pre-command
+ (push nntp-pre-command command))
+ (setq proc (apply 'start-process "nntpd" buffer command))
+ (save-excursion
+ (set-buffer buffer)
+ (nntp-wait-for-string "^\r*20[01]")
+ (beginning-of-line)
+ (delete-region (point-min) (point))
+ proc)))
+
+(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.
+
+Please refer to the following variables to customize the connection:
+- `nntp-pre-command',
+- `nntp-via-rlogin-command',
+- `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
+ ,nntp-address ,nntp-port-number))
+ proc)
+ (and nntp-via-user-name
+ (setq command `("-l" ,nntp-via-user-name ,@command)))
+ (push nntp-via-rlogin-command command)
+ (and nntp-pre-command
+ (push nntp-pre-command command))
+ (setq proc (apply 'start-process "nntpd" buffer command))
+ (save-excursion
+ (set-buffer buffer)
+ (nntp-wait-for-string "^\r*20[01]")
+ (beginning-of-line)
+ (delete-region (point-min) (point))
+ proc)))
+
+(defun nntp-open-via-telnet-and-telnet (buffer)
+ "Open a connection to an nntp server through an intermediate host.
+First telnet the remote host, and then telnet the real news server
+from there.
+
+Please refer to the following variables to customize the connection:
+- `nntp-pre-command',
+- `nntp-via-telnet-command',
+- `nntp-via-telnet-switches',
+- `nntp-via-address',
+- `nntp-via-envuser',
+- `nntp-via-user-name',
+- `nntp-via-user-password',
+- `nntp-via-shell-prompt',
+- `nntp-telnet-command',
+- `nntp-telnet-switches',
+- `nntp-address',
+- `nntp-port-number',
+- `nntp-end-of-line'."
(save-excursion
- (save-restriction
- (set-buffer nntp-server-buffer)
- (narrow-to-region (goto-char (point-min))
- (or (search-forward "\n\n" nil t) (point-max)))
- (goto-char (point-min))
- ;; We first find the number by looking at the status line.
- (let ((number (and (looking-at "2[0-9][0-9] +\\([0-9]+\\) ")
- (string-to-int
- (buffer-substring (match-beginning 1)
- (match-end 1)))))
- group newsgroups xref)
- (and number (zerop number) (setq number nil))
- ;; Then we find the group name.
- (setq group
- (cond
- ;; If there is only one group in the Newsgroups header,
- ;; then it seems quite likely that this article comes
- ;; from that group, I'd say.
- ((and (setq newsgroups (mail-fetch-field "newsgroups"))
- (not (string-match "," newsgroups)))
- newsgroups)
- ;; If there is more than one group in the Newsgroups
- ;; header, then the Xref header should be filled out.
- ;; We hazard a guess that the group that has this
- ;; article number in the Xref header is the one we are
- ;; looking for. This might very well be wrong if this
- ;; article happens to have the same number in several
- ;; groups, but that's life.
- ((and (setq xref (mail-fetch-field "xref"))
- number
- (string-match (format "\\([^ :]+\\):%d" number) xref))
- (substring xref (match-beginning 1) (match-end 1)))
- (t "")))
- (when (string-match "\r" group)
- (setq group (substring group 0 (match-beginning 0))))
- (cons group number)))))
+ (set-buffer buffer)
+ (erase-buffer)
+ (let ((command `(,nntp-via-telnet-command ,@nntp-via-telnet-switches))
+ (case-fold-search t)
+ proc)
+ (and nntp-pre-command (push nntp-pre-command command))
+ (setq proc (apply 'start-process "nntpd" buffer command))
+ (when (memq (process-status proc) '(open run))
+ (nntp-wait-for-string "^r?telnet")
+ (process-send-string proc "set escape \^X\n")
+ (cond
+ ((and nntp-via-envuser nntp-via-user-name)
+ (process-send-string proc (concat "open " "-l" nntp-via-user-name
+ nntp-via-address "\n")))
+ (t
+ (process-send-string proc (concat "open " nntp-via-address
+ "\n"))))
+ (when (not nntp-via-envuser)
+ (nntp-wait-for-string "^\r*.?login:")
+ (process-send-string proc
+ (concat
+ (or nntp-via-user-name
+ (setq nntp-via-user-name
+ (read-string "login: ")))
+ "\n")))
+ (nntp-wait-for-string "^\r*.?password:")
+ (process-send-string proc
+ (concat
+ (or nntp-via-user-password
+ (setq nntp-via-user-password
+ (mail-source-read-passwd
+ "Password: ")))
+ "\n"))
+ (nntp-wait-for-string nntp-via-shell-prompt)
+ (let ((real-telnet-command `("exec"
+ ,nntp-telnet-command
+ ,@nntp-telnet-switches
+ ,nntp-address
+ ,nntp-port-number)))
+ (process-send-string proc
+ (concat (mapconcat 'identity
+ real-telnet-command " ")
+ "\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)))
(provide 'nntp)
\thispagestyle{empty}
-Copyright \copyright{} 1995, 1996, 1997, 1998, 1999, 2000
+Copyright \copyright{} 1995, 1996, 1997, 1998, 1999, 2000
Free Software Foundation, Inc.
Getting Mail
-* Mail in a Newsreader:: Important introductory notes.
+* Mail in a Newsreader:: Important introductory notes.
* Getting Started Reading Mail:: A simple cookbook example.
* Splitting Mail:: How to create mail groups.
* Mail Sources:: How to tell Gnus where to get mail from.
@item gnus-subscribe-topics
@vindex gnus-subscribe-topics
-Put the groups into the topic that has a matching @code{subscribe} topic
+Put the groups into the topic that has a matching @code{subscribe} topic
parameter (@pxref{Topic Parameters}). For instance, a @code{subscribe}
topic parameter that looks like
"nnslashdot"
@end example
-will mean that all groups that match that regex will be subscribed under
+will mean that all groups that match that regex will be subscribed under
that topic.
If no topics match the groups, the groups will be subscribed in the
@code{LIST ACTIVE group} command, this isn't very nice to the server.
If you think that starting up Gnus takes too long, try all the three
-different values for this variable and see what works best for you.
+different values for this variable and see what works best for you.
In any case, if you use @code{some} or @code{nil}, you should definitely
kill all groups that you aren't interested in to speed things up.
@item T j
@kindex T j (Topic)
@findex gnus-topic-jump-to-topic
-Go to a topic (@code{gnus-topic-jump-to-topic}).
+Go to a topic (@code{gnus-topic-jump-to-topic}).
@item T c
@kindex T c (Topic)
@table @code
@item subscribe
-When subscribing new groups by topic (@pxref{Subscription Methods}), the
-@code{subscribe} topic parameter says what groups go in what topic. Its
+When subscribing new groups by topic (@pxref{Subscription Methods}), the
+@code{subscribe} topic parameter says what groups go in what topic. Its
value should be a regexp to match the groups that should go in that
-topic.
+topic.
@end table
@item gnus-group-name-charset-group-alist
@vindex gnus-group-name-charset-group-alist
-An alist of regexp of group name and the charset for group names.
+An alist of regexp of group name and the charset for group names.
It is used to show non-ASCII group names.
For example:
(@pxref{Formatting Variables}).
There should always be a colon on the line; the cursor always moves to
-the colon after performing an operation.
+the colon after performing an operation.
The default string is @samp{%U%R%z%I%(%[%4L: %-20,20n%]%) %s\n}.
encoded in the @code{cn-gb-2312} charset. If you have
@lisp
-(setq gnus-summary-show-article-charset-alist
- '((1 . cn-gb-2312)
+(setq gnus-summary-show-article-charset-alist
+ '((1 . cn-gb-2312)
(2 . big5)))
@end lisp
@kindex S o p (Summary)
@findex gnus-summary-post-forward
Forward the current article to a newsgroup
-(@code{gnus-summary-post-forward}).
+(@code{gnus-summary-post-forward}).
If no prefix is given, the message is forwarded according to the value
of (@code{message-forward-as-mime}) and
(@code{message-forward-show-mml}); if the prefix is 1, decode the
@lisp
(setq gnus-use-long-file-name '(not-save)) ; to get a hierarchy
-(setq gnus-default-article-saver
+(setq gnus-default-article-saver
'gnus-summary-save-in-file) ; no encoding
@end lisp
@item W Q
@kindex W Q (Summary)
-@findex gnus-article-fill-long-lines
+@findex gnus-article-fill-long-lines
Fill long lines (@code{gnus-article-fill-long-lines}).
@item W C
@samp{déjà vu} look like @samp{d=E9j=E0 vu}, which doesn't look very
readable to me. Note that the this is usually done automatically by
Gnus if the message in question has a @code{Content-Transfer-Encoding}
-header that says that this encoding has been done.
+header that says that this encoding has been done.
If a prefix is given, a charset will be asked for.
@item W 6
@item W h
@kindex W h (Summary)
@findex gnus-article-wash-html
-Treat HTML (@code{gnus-article-wash-html}).
+Treat HTML (@code{gnus-article-wash-html}).
Note that the this is usually done automatically by Gnus if the message
in question has a @code{Content-Type} header that says that this type
has been done.
@kindex W p (Summary)
@findex gnus-article-verify-x-pgp-sig
Verify a signed control message (@code{gnus-article-verify-x-pgp-sig}).
-Control messages such as @code{newgroup} and @code{checkgroups} are
-usually signed by the hierarchy maintainer. You need to add the PGP
+Control messages such as @code{newgroup} and @code{checkgroups} are
+usually signed by the hierarchy maintainer. You need to add the PGP
public key of the maintainer to your keyring to verify the
message.@footnote{PGP keys for many hierarchies are available at
@uref{ftp://ftp.isc.org/pub/pgpcontrol/README.html}}
@kindex A t (Summary)
@findex gnus-article-babel
Translate the article from one language to another
-(@code{gnus-article-babel}).
+(@code{gnus-article-babel}).
@end table
@vindex gnus-preserve-marks
Move the article from one mail group to another
(@code{gnus-summary-move-article}). Marks will be preserved if
-@var{gnus-preserve-marks} is non-@code{nil} (which is the default).
+@var{gnus-preserve-marks} is non-@code{nil} (which is the default).
@item B c
@kindex B c (Summary)
encrypted messages.
@enumerate
-@item
+@item
To verify or decrypt PGP messages, you have to install mailcrypt or
gpg.el.
@findex gnus-mime-view-part-as-type
@item t (Article)
View the @sc{mime} object as if it were a different @sc{mime} media type
-(@code{gnus-mime-view-part-as-type}).
+(@code{gnus-mime-view-part-as-type}).
@findex gnus-mime-view-part-as-charset
@itemx C (Article)
@code{gnus-part-display-hook}. The functions are called narrowed to the
part, and you can do anything you like, pretty much. There is no
information that you have to keep in the buffer---you can change
-everything.
+everything.
@node Article Keymap
@lisp
(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")))
+ (nntp-open-connection-function nntp-open-via-rlogin-and-telnet)
+ (nntp-via-address "the.firewall.machine")
+ (nntp-address "the.real.nntp.host")
+ (nntp-end-of-line "\n"))
@end lisp
If you want to use the wonderful @code{ssh} program to provide a
-compressed connection over the modem line, you could create a virtual
-server that would look something like this:
+compressed connection over the modem line, you could add the following
+configuration to the example above:
@lisp
-(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")))
+ (nntp-via-rlogin-command "ssh")
+@end lisp
+
+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
+telnet connection to the news server as follows:
+
+@lisp
+(nntp "outside"
+ (nntp-pre-command "runsocks")
+ (nntp-open-connection-function nntp-open-via-telnet)
+ (nntp-address "the.news.server")
+ (nntp-end-of-line "\n"))
@end lisp
This means that you have to have set up @code{ssh-agent} correctly to
The file contains one or more line, each of which define one server.
@item
-Each line may contain an arbitrary number of token/value pairs.
+Each line may contain an arbitrary number of token/value pairs.
The valid tokens include @samp{machine}, @samp{login}, @samp{password},
@samp{default}. In addition Gnus introduces two new tokens, not present
@lisp
'(("nntpd 1\\.5\\.11t"
- (remove-hook 'nntp-server-opened-hook
+ (remove-hook 'nntp-server-opened-hook
'nntp-send-mode-reader)))
@end lisp
This hook is run as the last step when connecting to an @sc{nntp}
server.
-@findex nntp-open-rlogin
-@findex nntp-open-telnet
-@findex nntp-open-network-stream
-@item nntp-open-connection-function
-@vindex nntp-open-connection-function
-This function is used to connect to the remote system. Four pre-made
-functions are supplied:
-
-@table @code
-@item nntp-open-network-stream
-This is the default, and simply connects to some port or other on the
-remote system.
-
-@item nntp-open-rlogin
-Does an @samp{rlogin} on the
-remote system, and then does a @samp{telnet} to the @sc{nntp} server
-available there.
-
-@code{nntp-open-rlogin}-related variables:
-
-@table @code
-
-@item nntp-rlogin-program
-@vindex nntp-rlogin-program
-Program used to log in on remote machines. The default is @samp{rsh},
-but @samp{ssh} is a popular alternative.
-
-@item nntp-rlogin-parameters
-@vindex nntp-rlogin-parameters
-This list will be used as the parameter list given to @code{rsh}.
-
-@item nntp-rlogin-user-name
-@vindex nntp-rlogin-user-name
-User name on the remote system.
-
-@end table
-
-@item nntp-open-telnet
-Does a @samp{telnet} to the remote system and then another @samp{telnet}
-to get to the @sc{nntp} server.
-
-@code{nntp-open-telnet}-related variables:
-
-@table @code
-@item nntp-telnet-command
-@vindex nntp-telnet-command
-Command used to start @code{telnet}.
-
-@item nntp-telnet-switches
-@vindex nntp-telnet-switches
-List of strings to be used as the switches to the @code{telnet} command.
-
-@item nntp-telnet-user-name
-@vindex nntp-telnet-user-name
-User name for log in on the remote system.
-
-@item nntp-telnet-passwd
-@vindex nntp-telnet-passwd
-Password to use when logging in.
-
-@item nntp-telnet-parameters
-@vindex nntp-telnet-parameters
-A list of strings executed as a command after logging in
-via @code{telnet}.
-
-@item nntp-telnet-shell-prompt
-@vindex nntp-telnet-shell-prompt
-Regexp matching the shell prompt on the remote machine. The default is
-@samp{bash\\|\$ *\r?$\\|> *\r?}.
-
-@item nntp-open-telnet-envuser
-@vindex nntp-open-telnet-envuser
-If non-@code{nil}, the @code{telnet} session (client and server both)
-will support the @code{ENVIRON} option and not prompt for login name.
-This works for Solaris @code{telnet}, for instance.
-
-@end table
-
-@findex nntp-open-ssl-stream
-@item nntp-open-ssl-stream
-Opens a connection to a server over a @dfn{secure} channel. To use this
-you must have SSLay installed
-(@uref{ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL}, and you also need
-@file{ssl.el} (from the W3 distribution, for instance). You then
-define a server as follows:
-
-@lisp
-;; Type `C-c C-c' after you've finished editing.
-;;
-;; "snews" is port 563 and is predefined
-;; in our /etc/services
-;;
-(nntp "snews.bar.com"
- (nntp-open-connection-function
- nntp-open-ssl-stream)
- (nntp-port-number "snews")
- (nntp-address "snews.bar.com"))
-@end lisp
-
-@end table
-
-@item nntp-end-of-line
-@vindex nntp-end-of-line
-String to use as end-of-line marker when talking to the @sc{nntp}
-server. This is @samp{\r\n} by default, but should be @samp{\n} when
-using @code{rlogin} to talk to the server.
-
-@item nntp-rlogin-user-name
-@vindex nntp-rlogin-user-name
-User name on the remote system when using the @code{rlogin} connect
-function.
-
-@item nntp-address
-@vindex nntp-address
-The address of the remote system running the @sc{nntp} server.
-
-@item nntp-port-number
-@vindex nntp-port-number
-Port number to connect to when using the @code{nntp-open-network-stream}
-connect function.
-
@item nntp-buggy-select
@vindex nntp-buggy-select
Set this to non-@code{nil} if your select routine is buggy.
buffer. This is useful if you are debugging a Gnus/@sc{nntp} connection
that doesn't seem to work.
+@item nntp-open-connection-function
+@vindex nntp-open-connection-function
+It is possible to customize how the connection to the nntp server will
+be opened. If you specify an @code{nntp-open-connection-function}
+parameter, Gnus will use that function to establish the connection.
+Five pre-made functions are supplied. These functions can be grouped in
+two categories: direct connection functions (three pre-made), and
+indirect ones (two pre-made).
+@end table
+
+@menu
+* Direct Functions:: Connecting directly to the server.
+* Indirect Functions:: Connecting indirectly to the server.
+* Common Variables:: Understood by several connection functions.
+@end menu
+
+
+@node Direct Functions
+@subsubsection Direct Functions
+@cindex direct connection functions
+
+These functions are called direct because they open a direct connection
+between your machine and the @sc{nntp} server. The behavior of these
+functions is also affected by commonly understood variables
+(@pxref{Common Variables}).
+
+@table @code
+@findex nntp-open-network-stream
+@item nntp-open-network-stream
+This is the default, and simply connects to some port or other on the
+remote system.
+
+@findex nntp-open-ssl-stream
+@item nntp-open-ssl-stream
+Opens a connection to a server over a @dfn{secure} channel. To use this
+you must have SSLay installed
+(@uref{ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL}, and you also need
+@file{ssl.el} (from the W3 distribution, for instance). You then
+define a server as follows:
+
+@lisp
+;; Type `C-c C-c' after you've finished editing.
+;;
+;; "snews" is port 563 and is predefined in our /etc/services
+;;
+(nntp "snews.bar.com"
+ (nntp-open-connection-function nntp-open-ssl-stream)
+ (nntp-port-number "snews")
+ (nntp-address "snews.bar.com"))
+@end lisp
+
+@findex nntp-open-telnet-stream
+@item nntp-open-telnet-stream
+Opens a connection to an @sc{nntp} server by simply @samp{telnet}'ing
+it. You might wonder why this function exists, since we have the
+default @code{nntp-open-network-stream} which would do the job. (One
+of) the reason(s) is that if you are behind a firewall but have direct
+connections to the outside world thanks to a command wrapper like
+@code{runsocks}, you can use it like this:
+
+@lisp
+(nntp "socksified"
+ (nntp-pre-command "runsocks")
+ (nntp-open-connection-function nntp-open-telnet-stream)
+ (nntp-address "the.news.server"))
+@end lisp
+
+With the default method, you would need to wrap your whole Emacs
+session, which is not a good idea.
+@end table
+
+
+@node Indirect Functions
+@subsubsection Indirect Functions
+@cindex indirect connection functions
+
+These functions are called indirect because they connect to an
+intermediate host before actually connecting to the @sc{nntp} server.
+All of these functions and related variables are also said to belong to
+the "via" family of connection: they're all prefixed with "via" to make
+things cleaner. The behavior of these functions is also affected by
+commonly understood variables (@pxref{Common Variables}).
+
+@table @code
+@item nntp-open-via-rlogin-and-telnet
+@findex nntp-open-via-rlogin-and-telnet
+Does an @samp{rlogin} on a remote system, and then does a @samp{telnet}
+to the real @sc{nntp} server from there. This is useful for instance if
+you need to connect to a firewall machine first.
+
+@code{nntp-open-via-rlogin-and-telnet}-specific variables:
+
+@table @code
+@item nntp-via-rlogin-command
+@vindex nntp-via-rlogin-command
+Command used to log in on the intermediate host. The default is
+@samp{rsh}, but @samp{ssh} is a popular alternative.
+@end table
+
+@item nntp-open-via-telnet-and-telnet
+@findex nntp-open-via-telnet-and-telnet
+Does essentially the same, but uses @samp{telnet} instead of
+@samp{rlogin} to connect to the intermediate host.
+
+@code{nntp-open-via-telnet-and-telnet}-specific variables:
+
+@table @code
+@item nntp-via-telnet-command
+@vindex nntp-via-telnet-command
+Command used to @code{telnet} the intermediate host. The default is
+@samp{telnet}.
+
+@item nntp-via-telnet-switches
+@vindex nntp-via-telnet-switches
+List of strings to be used as the switches to the
+@code{nntp-via-telnet-command} command. The default is @samp{("-8")}.
+
+@item nntp-via-user-password
+@vindex nntp-via-user-password
+Password to use when logging in on the intermediate host.
+
+@item nntp-via-envuser
+@vindex nntp-via-envuser
+If non-@code{nil}, the intermediate @code{telnet} session (client and
+server both) will support the @code{ENVIRON} option and not prompt for
+login name. This works for Solaris @code{telnet}, for instance.
+
+@item nntp-via-shell-prompt
+@vindex nntp-via-shell-prompt
+Regexp matching the shell prompt on the intermediate host. The default
+is @samp{bash\\|\$ *\r?$\\|> *\r?}.
+
+@end table
+
+@end table
+
+
+Here are some additional variables that are understood by all the above
+functions:
+
+@table @code
+
+@item nntp-via-user-name
+@vindex nntp-via-user-name
+User name to use when connecting to the intermediate host.
+
+@item nntp-via-address
+@vindex nntp-via-address
+Address of the intermediate host to connect to.
+
+@end table
+
+
+@node Common Variables
+@subsubsection Common Variables
+
+The following variables affect the behavior of all, or several of the
+pre-made connection functions. When not specified, all functions are
+affected.
+
+@table @code
+
+@item nntp-pre-command
+@vindex nntp-pre-command
+A command wrapper to use when connecting through a non native connection
+function (all except @code{nntp-open-network-stream} and
+@code{nntp-open-ssl-stream}. This is where you would put a @samp{SOCKS}
+wrapper for instance.
+
+@item nntp-address
+@vindex nntp-address
+The address of the @sc{nntp} server.
+
+@item nntp-port-number
+@vindex nntp-port-number
+Port number to connect to the @sc{nntp} server. The default is @samp{nntp}.
+
+@item nntp-end-of-line
+@vindex nntp-end-of-line
+String to use as end-of-line marker when talking to the @sc{nntp}
+server. This is @samp{\r\n} by default, but should be @samp{\n} when
+using a non native connection function.
+
+@item nntp-telnet-command
+@vindex nntp-telnet-command
+Command to use when connecting to the @sc{nntp} server through
+@samp{telnet}. This is NOT for an intermediate host. This is just for
+the real @sc{nntp} server. The default is @samp{telnet}.
+
+@item nntp-telnet-switches
+@vindex nntp-telnet-switches
+A list of switches to pass to @code{nntp-telnet-command}. The default
+is @samp{("-8")}.
+
@end table
course.
@menu
-* Mail in a Newsreader:: Important introductory notes.
+* Mail in a Newsreader:: Important introductory notes.
* Getting Started Reading Mail:: A simple cookbook example.
* Splitting Mail:: How to create mail groups.
* Mail Sources:: How to tell Gnus where to get mail from.
@node Mail in a Newsreader
@subsection Mail in a Newsreader
-If you are used to traditional mail readers, but have decided to switch
+If you are used to traditional mail readers, but have decided to switch
to reading mail with Gnus, you may find yourself experiencing something
of a culture shock.
-Gnus does not behave like traditional mail readers. If you want to make
+Gnus does not behave like traditional mail readers. If you want to make
it behave that way, you can, but it's an uphill battle.
Gnus, by default, handles all its groups using the same approach. This
deleted? How awful!
But, no, it means that old messages are @dfn{expired} according to some
-scheme or other. For news messages, the expire process is controlled by
+scheme or other. For news messages, the expire process is controlled by
the news administrator; for mail, the expire process is controlled by
you. The expire process for mail is covered in depth in @pxref{Expiring
Mail}.
can use the @kbd{M-x nnmail-split-history} command. If you wish to see
where re-spooling messages would put the messages, you can use
@code{gnus-summary-respool-trace} and related commands (@pxref{Mail
-Group Commands}).
+Group Commands}).
Gnus gives you all the opportunity you could possibly want for shooting
yourself in the foot. Let's say you create a group that will contain
(file)
@end lisp
-If the mail spool file is not located on the local machine, it's best to
-use POP or @sc{imap} or the like to fetch the mail. You can not use ange-ftp
+If the mail spool file is not located on the local machine, it's best to
+use POP or @sc{imap} or the like to fetch the mail. You can not use ange-ftp
file names here---it has no way to lock the mail spool while moving the
mail.
Two example maildir mail sources:
@lisp
-(maildir :path "/home/user-name/Maildir/"
+(maildir :path "/home/user-name/Maildir/"
:subdirs ("cur" "new"))
@end lisp
@lisp
-(maildir :path "/user@@remotehost.org:~/Maildir/"
+(maildir :path "/user@@remotehost.org:~/Maildir/"
:subdirs ("new"))
@end lisp
An example @sc{imap} mail source:
@lisp
-(imap :server "mail.mycorp.com"
- :stream kerberos4
+(imap :server "mail.mycorp.com"
+ :stream kerberos4
:fetchflag "\\Seen")
@end lisp
An example webmail source:
@lisp
-(webmail :subtype 'hotmail
- :user "user-name"
+(webmail :subtype 'hotmail
+ :user "user-name"
:password "secret")
@end lisp
@end table
@lisp
(setq mail-sources
- '((directory :path "/home/pavel/.Spool/"
+ '((directory :path "/home/pavel/.Spool/"
:suffix ""
:plugged t)))
@end lisp
(any "procmail@@informatik\\.rwth-aachen\\.de" "procmail.list")
(any "SmartList@@informatik\\.rwth-aachen\\.de" "SmartList.list")
;; Both lists below have the same suffix, so prevent
- ;; cross-posting to mkpkg.list of messages posted only to
+ ;; cross-posting to mkpkg.list of messages posted only to
;; the bugs- list, but allow cross-posting when the
;; message was really cross-posted.
(any "bugs-mypackage@@somewhere" "mypkg.bugs")
@item nnmbox-active-file
@vindex nnmbox-active-file
The name of the active file for the mail box. Default is
-@file{~/.mbox-active}.
+@file{~/.mbox-active}.
@item nnmbox-get-new-mail
@vindex nnmbox-get-new-mail
little bit of optimization to this so that each of one's mail groups has
a Unix mail box file. It's faster than @code{nnmbox} because each group
can be parsed separately, and still provides the simple Unix mail box
-format requiring minimal effort in moving the mail around. In addition,
-it maintains an ``active'' file making it much faster for Gnus to figure
+format requiring minimal effort in moving the mail around. In addition,
+it maintains an ``active'' file making it much faster for Gnus to figure
out how many messages there are in each separate group.
If you have groups that are expected to have a massive amount of
go through a cumbersome subscription procedure, and most people don't
even know what a news group is.
-The problem with this scenario is that web browsers are not very good at
-being newsreaders. They do not keep track of what articles you've read;
-they do not allow you to score on subjects you're interested in; they do
+The problem with this scenario is that web browsers are not very good at
+being newsreaders. They do not keep track of what articles you've read;
+they do not allow you to score on subjects you're interested in; they do
not allow off-line browsing; they require you to click around and drive
you mad in the end.
-So---if web browsers suck at reading discussion forums, why not use Gnus
+So---if web browsers suck at reading discussion forums, why not use Gnus
to do it instead?
Gnus has been getting a bit of a collection of backends for providing
All the web sources require Emacs/w3 and the url library to work.
The main caveat with all these web sources is that they probably won't
-work for a very long time. Gleaning information from the @sc{html} data
+work for a very long time. Gleaning information from the @sc{html} data
is guesswork at best, and when the layout is altered, the Gnus backend
will fail. If you have reasonably new versions of these backends,
though, you should be ok.
@item nnslashdot-active-url
@vindex nnslashdot-active-url
The @sc{url} format string that will be used to fetch the information on
-news articles and comments. Default:
+news articles and comments. The default is
@samp{http://slashdot.org/search.pl?section=&min=%d}.
@item nnslashdot-comments-url
information Gnus needs to keep groups updated.
The easiest way to get started with @code{nnultimate} is to say
-something like the following in the group buffer: @kbd{B nnultimate RET
+something like the following in the group buffer: @kbd{B nnultimate RET
http://www.tcj.com/messboard/ubbcgi/ RET}. (Substitute the @sc{url}
(not including @samp{Ultimate.cgi} or the like at the end) for a forum
you're interested in; there's quite a list of them on the Ultimate web
@cindex url
@cindex Netscape
-Gnus uses the url library to fetch web pages and Emacs/w3 to display web
+Gnus uses the url library to fetch web pages and Emacs/w3 to display web
pages. Emacs/w3 is documented in its own manual, but there are some
things that may be more relevant for Gnus users.
For instance, a common question is how to make Emacs/w3 follow links
-using the @code{browse-url} functions (which will call some external web
+using the @code{browse-url} functions (which will call some external web
browser like Netscape). Here's one way:
@lisp
@lisp
(setq gnus-post-method
- '(nngateway
+ '(nngateway
"mail2news@@replay.com"
(nngateway-header-transformation
nngateway-mail2news-header-transformation)))
might look something like this:
@lisp
-(setq gnus-secondary-select-methods
+(setq gnus-secondary-select-methods
'((nnimap "simpleserver") ; no special configuration
; perhaps a ssh port forwarded server:
(nnimap "dolk"
@lisp
(nnimap "mail.server.com"
- (nnimap-list-pattern ("INBOX" "Mail/*" "alt.sex.*"
+ (nnimap-list-pattern ("INBOX" "Mail/*" "alt.sex.*"
("~friend/Mail/" . "list/*"))))
@end lisp
@lisp
(setq nnimap-split-rule
- '(("INBOX.nnimap"
+ '(("INBOX.nnimap"
"^Sender: owner-nnimap@@vic20.globalcom.se")
("INBOX.junk" "^Subject:.*MAKE MONEY")
("INBOX.private" "")))
For example, to do hierarchical scoring but use a non-server-specific
overall score file, you could use the value
@example
-(list (lambda (group) ("all.SCORE"))
+(list (lambda (group) ("all.SCORE"))
'gnus-score-find-hierarchical)
@end example
If you want to lower the score of articles that have been crossposted to
more than, say, 3 groups:
@lisp
-("xref"
+("xref"
("[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+"
-1000 nil r))
@end lisp
accomplish that, something like the following can be done:
@lisp
-(message
+(message
(frame 1.0
(if (not (buffer-live-p gnus-summary-buffer))
(car (cdr (assoc 'group gnus-buffer-configuration)))
@subsection Example Window Configurations
@itemize @bullet
-@item
+@item
Narrow left hand side occupied by group buffer. Right hand side split
between summary buffer (top one-sixth) and article buffer (bottom).
@findex gnus-undo
The undoability is provided by the @code{gnus-undo-mode} minor mode. It
is used if @code{gnus-use-undo} is non-@code{nil}, which is the
-default. The @kbd{M-C-_} key performs the @code{gnus-undo}
+default. The @kbd{M-C-_} key performs the @code{gnus-undo}
command, which should feel kinda like the normal Emacs @code{undo}
command.
(setq nnmail-procmail-suffix "\\.in")
@end lisp
-this now has changed to
+this now has changed to
@lisp
(setq mail-sources
@item The Gnus posting styles have been redone again and now works in a
subtly different manner.
-@item New web-based backends have been added: @code{nnslashdot},
+@item New web-based backends have been added: @code{nnslashdot},
@code{nnwarchive} and @code{nnultimate}. nnweb has been revamped,
again, to keep up with ever-changing layouts.
that's already there. This is not how this manual is written. When
implementing something, I write the manual entry for that something
straight away. I then see that it's difficult to explain the
-functionality, so I write how it's supposed to be, and then I change the
+functionality, so I write how it's supposed to be, and then I change the
implementation. Writing the documentation and writing the code goes
hand in hand.
This, of course, means that this manual has no, or little, flow. It
documents absolutely everything in Gnus, but often not where you're
-looking for it. It is a reference manual, and not a guide to how to get
+looking for it. It is a reference manual, and not a guide to how to get
started with Gnus.
-That would be a totally different book, that should be written using the
+That would be a totally different book, that should be written using the
reference manual as source material. It would look quite differently.
"*Non-nil means that nndir will never retrieve NOV headers."
nnml-nov-is-evil)
-(defvoo nndir-current-group ""
- nil
+(defvoo nndir-current-group ""
+ nil
nnml-current-group nnmh-current-group)
(defvoo nndir-top-directory nil nil nnml-directory nnmh-directory)
(defvoo nndir-get-new-mail nil nil nnml-get-new-mail nnmh-get-new-mail)
(unless (assq 'nndir-directory defs)
(push `(nndir-directory ,server) defs))
(push `(nndir-current-group
- ,(file-name-nondirectory
+ ,(file-name-nondirectory
(directory-file-name nndir-directory)))
defs)
(push `(nndir-top-directory