From 348af5ecdd6d6510c79fbb9ee53b6c9fc882cacf Mon Sep 17 00:00:00 2001 From: yamaoka Date: Sun, 16 Jul 2000 23:47:08 +0000 Subject: [PATCH] Synch with Gnus. --- lisp/ChangeLog | 38 +++++++++++++++++++ lisp/gnus-agent.el | 8 +++- lisp/gnus-cus.el | 4 +- lisp/gnus-sum.el | 13 ++++--- lisp/gnus.el | 7 +++- lisp/imap.el | 103 +++++++++++++++++++++++++++++++++++++++++++++------- lisp/nndoc.el | 11 ++++++ texi/ChangeLog | 8 ++++ texi/gnus-ja.texi | 43 +++++++++++++++++++--- texi/gnus.texi | 47 ++++++++++++++++++++---- 10 files changed, 244 insertions(+), 38 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 80f4136..ef6e461 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,41 @@ +2000-07-16 18:25:07 ShengHuo ZHU + + * nndoc.el (nndoc-type-alist): Add outlook. + (nndoc-outlook-type-p): New function. + (nndoc-outlook-article-begin): Ditto. + +2000-07-16 Daiki Ueno + + * gnus-sum.el (gnus-restore-hidden-threads-configuration): Save + excursion. + +2000-07-15 Simon Josefsson + + * gnus-cus.el (gnus-group-parameters, banner): Type is regexp. + + * imap.el (imap): + (imap-kerberos4-program): + (imap-gssapi-program): + (imap-ssl-program): Customization. + (imap-shell-program): + (imap-shell-host): New variables. + (imap-streams): + (imap-stream-alist): Add shell. + (imap-shell-p): + (imap-shell-open): New functions. + (imap-open): Don't call authenticator if preauth. + (imap-authenticate): Return t if already authenticated. + +2000-07-14 Simon Josefsson + + * gnus.el (gnus-invalid-group-regexp): New variable. + (gnus-read-group): Use it. + +2000-07-14 12:40:51 ShengHuo ZHU + + * gnus-agent.el (gnus-agent-fetch-group-1): mark-below, + expunge-below and orphan-score are "group variables". + 2000-07-13 Simon Josefsson * gnus-srvr.el (gnus-browse-read-group): Don't pass fully diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 073306c..8163f92 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -1046,7 +1046,13 @@ the actual number of articles toggled is returned." gnus-newsgroup-dependencies gnus-newsgroup-headers gnus-newsgroup-scored gnus-headers gnus-score gnus-use-cache articles arts - category predicate info marks score-param) + category predicate info marks score-param + (gnus-summary-expunge-below gnus-summary-expunge-below) + (gnus-summary-mark-below gnus-summary-mark-below) + (gnus-orphan-score gnus-orphan-score) + ;; Maybe some other gnus-summary local variables should also + ;; be put here. + ) (unless (gnus-check-group group) (error "Can't open server for %s" group)) ;; Fetch headers. diff --git a/lisp/gnus-cus.el b/lisp/gnus-cus.el index 95a9c87..442ca05 100644 --- a/lisp/gnus-cus.el +++ b/lisp/gnus-cus.el @@ -155,9 +155,9 @@ rules as described later).") (banner (choice :tag "Banner" (const signature) - string + regexp (const :tag "None" nil)) "\ -Banner to be removed from articles.") +Regular expression matching banners to be removed from articles.") (auto-expire (const :tag "Automatic Expire" t) "\ All articles that are read will be marked as expirable.") diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 09ddf09..6fff1ec 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -2442,12 +2442,13 @@ marks of articles." (defun gnus-restore-hidden-threads-configuration (config) "Restore hidden threads configuration from CONFIG." - (let (point buffer-read-only) - (while (setq point (pop config)) - (when (and (< point (point-max)) - (goto-char point) - (eq (char-after) ?\n)) - (subst-char-in-region point (1+ point) ?\n ?\r))))) + (save-excursion + (let (point buffer-read-only) + (while (setq point (pop config)) + (when (and (< point (point-max)) + (goto-char point) + (eq (char-after) ?\n)) + (subst-char-in-region point (1+ point) ?\n ?\r)))))) ;; Various summary mode internalish functions. diff --git a/lisp/gnus.el b/lisp/gnus.el index 04924d4..78adf57 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1684,6 +1684,9 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.") use the article treating faculties instead. Is is described in Info node `Customizing Articles'.") +(defvar gnus-invalid-group-regexp "[: `'\"/]\\|^$" + "Regexp matching invalid groups.") + ;;; End of variables. ;; Define some autoload functions Gnus might use. @@ -2860,8 +2863,8 @@ Disallow invalid group names." (let ((prefix "") group) (while (not group) - (when (string-match - "[: `'\"/]\\|^$" + (when (string-match + gnus-invalid-group-regexp (setq group (read-string (concat prefix prompt) (cons (or default "") 0) 'gnus-group-history))) diff --git a/lisp/imap.el b/lisp/imap.el index f0a44d6..a3e0fc6 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -155,27 +155,57 @@ ;; User variables. -(defvar imap-kerberos4-program '("imtest -m kerberos_v4 -u %l -p %p %s" - "imtest -kp %s %p") +(defgroup imap nil + "Low-level IMAP issues." + :group 'mail) + +(defcustom imap-kerberos4-program '("imtest -m kerberos_v4 -u %l -p %p %s" + "imtest -kp %s %p") "List of strings containing commands for Kerberos 4 authentication. %s is replaced with server hostname, %p with port to connect to, and %l with the value of `imap-default-user'. The program should accept -IMAP commands on stdin and return responses to stdout.") +IMAP commands on stdin and return responses to stdout. Each entry in +the list is tried until a successful connection is made." + :group 'imap + :type '(repeat string)) -(defvar imap-gssapi-program '("imtest -m gssapi -u %l -p %p %s") +(defcustom imap-gssapi-program '("imtest -m gssapi -u %l -p %p %s") "List of strings containing commands for GSSAPI (krb5) authentication. %s is replaced with server hostname, %p with port to connect to, and %l with the value of `imap-default-user'. The program should accept -IMAP commands on stdin and return responses to stdout.") - -(defvar imap-ssl-program '("openssl s_client -ssl3 -connect %s:%p" - "openssl s_client -ssl2 -connect %s:%p" - "s_client -ssl3 -connect %s:%p" - "s_client -ssl2 -connect %s:%p") +IMAP commands on stdin and return responses to stdout. Each entry in +the list is tried until a successful connection is made." + :group 'imap + :type '(repeat string)) + +(defcustom imap-ssl-program '("openssl s_client -ssl3 -connect %s:%p" + "openssl s_client -ssl2 -connect %s:%p" + "s_client -ssl3 -connect %s:%p" + "s_client -ssl2 -connect %s:%p") "A string, or list of strings, containing commands for SSL connections. Within a string, %s is replaced with the server address and %p with port number on server. The program should accept IMAP commands on -stdin and return responses to stdout.") +stdin and return responses to stdout. Each entry in the list is tried +until a successful connection is made." + :group 'imap + :type '(choice string + (repeat string))) + +(defcustom imap-shell-program '("ssh %s imapd" + "rsh %s imapd" + "ssh %g ssh %s imapd" + "rsh %g rsh %s imapd") + "A list of strings, containing commands for IMAP connection. +Within a string, %s is replaced with the server address, %p with port +number on server, %g with `imap-shell-host', and %l with +`imap-default-user'. The program should read IMAP commands from stdin +and write IMAP response to stdout. Each entry in the list is tried +until a successful connection is made." + :group 'imap + :type '(repeat string)) + +(defvar imap-shell-host "gateway" + "Hostname of rlogin proxy.") (defvar imap-default-user (user-login-name) "Default username to use.") @@ -188,7 +218,7 @@ stdin and return responses to stdout.") (defvar imap-fetch-data-hook nil "Hooks called after receiving each FETCH response.") -(defvar imap-streams '(gssapi kerberos4 starttls ssl network) +(defvar imap-streams '(gssapi kerberos4 starttls ssl network shell) "Priority of streams to consider when opening connection to server.") (defvar imap-stream-alist @@ -196,6 +226,7 @@ stdin and return responses to stdout.") (kerberos4 imap-kerberos4-stream-p imap-kerberos4-open) (ssl imap-ssl-p imap-ssl-open) (network imap-network-p imap-network-open) + (shell imap-shell-p imap-shell-open) (starttls imap-starttls-p imap-starttls-open)) "Definition of network streams. @@ -566,6 +597,47 @@ If ARGS, PROMPT is used as an argument to `format'." (when (memq (process-status process) '(open run)) process)))) +(defun imap-shell-p (buffer) + nil) + +(defun imap-shell-open (name buffer server port) + (let ((cmds imap-shell-program) + cmd done) + (while (and (not done) (setq cmd (pop cmds))) + (message "imap: Opening IMAP connection with `%s'..." cmd) + (setq imap-client-eol "\n") + (let* ((port (or port imap-default-port)) + (process (as-binary-process + (start-process + name buffer shell-file-name shell-command-switch + (format-spec + cmd + (format-spec-make + ?s server + ?g imap-shell-host + ?p (number-to-string port) + ?l imap-default-user)))))) + (when process + (while (and (memq (process-status process) '(open run)) + (goto-char (point-min)) + (not (imap-parse-greeting))) + (accept-process-output process 1) + (sit-for 1)) + (erase-buffer) + (and imap-log + (with-current-buffer (get-buffer-create imap-log) + (buffer-disable-undo) + (goto-char (point-max)) + (insert-buffer-substring buffer))) + (when (memq (process-status process) '(open run)) + (setq done process))))) + (if done + (progn + (message "imap: Opening IMAP connection with `%s'...done" cmd) + done) + (message "imap: Failed opening IMAP connection") + nil))) + (defun imap-starttls-p (buffer) (and (condition-case () (require 'starttls) @@ -789,7 +861,7 @@ necessery. If nil, the buffer name is generated." (setq imap-capability nil))) (if (imap-opened buffer) ;; Choose authenticator - (when (null imap-auth) + (when (and (null imap-auth) (not (eq imap-state 'auth))) (let ((auths imap-authenticators)) (while (setq auth (pop auths)) (if (funcall (nth 1 (assq auth imap-authenticator-alist)) @@ -819,7 +891,10 @@ user and optionally stored in the buffer. If USER and/or PASSWD is specified, the user will not be questioned and the username and/or password is remembered in the buffer." (with-current-buffer (or buffer (current-buffer)) - (when (eq imap-state 'nonauth) + (if (not (eq imap-state 'nonauth)) + (or (eq imap-state 'auth) + (eq imap-state 'select) + (eq imap-state 'examine)) (make-variable-buffer-local 'imap-username) (make-variable-buffer-local 'imap-password) (if user (setq imap-username user)) diff --git a/lisp/nndoc.el b/lisp/nndoc.el index 15e10db..b7ecab6 100644 --- a/lisp/nndoc.el +++ b/lisp/nndoc.el @@ -125,6 +125,9 @@ from the document.") (rfc822-forward (article-begin . "^\n") (body-end-function . nndoc-rfc822-forward-body-end-function)) + (outlook + (article-begin-function . nndoc-outlook-article-begin) + (body-end . "\0")) (guess (guess . t) (subtype nil)) @@ -589,6 +592,14 @@ from the document.") (when (looking-at "From - ") t)) +(defun nndoc-outlook-article-begin () + (prog1 (re-search-forward "From:\\|Received:" nil t) + (goto-char (match-beginning 0)))) + +(defun nndoc-outlook-type-p () + ;; FIXME: Is JMF the magic of outlook mailbox? -- ShengHuo. + (looking-at "JMF")) + (deffoo nndoc-request-accept-article (group &optional server last) nil) diff --git a/texi/ChangeLog b/texi/ChangeLog index f7dd6c7..87d4538 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,11 @@ +2000-07-15 Simon Josefsson + + * gnus.texi (nnimap-authinfo-file): + (gnus-invalid-group-regexp): Add. + (Mail Source Specifiers): Fix. + (IMAP): Fix. + (Agent Basics): Fix. + 2000-07-12 19:37:19 ShengHuo ZHU * gnus.texi (Article Washing): Add keystroke `t'. diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 5bc6d52..f9bda09 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -10806,7 +10806,7 @@ IMAP サーバーに渡すパスワードです。指定されていないときは、利用者は入力 シンボルの中のひとつを設定します。現状では、@samp{kerberos4} か @samp{ssl} か初期値の @samp{network} になります。 -@item :authenticator +@item :authentication サーバーでの認証にどの認証法を使うか。これは @code{imap-authenticator-alist} のシンボルの一つを設定します。現状では、 @samp{kerberos4}、@samp{cram-md5}、@samp{anonymous} か初期値の @@ -13121,17 +13121,29 @@ REFERENCE が使用されるかはサーバー特有ですが、ワシントン大学のサーバーで @dfn{ssl:} SSL を使います。OpenSSL (@samp{openssl} プログラム) か SSLeay (@samp{s_client}) が必要です。 @item +@dfn{shell:} シェル命令を使って IMAP 接続を開始します。 +@item @dfn{network:} 生の、TCP/IP のネットワーク接続です。 @end itemize +@vindex imap-kerberos4-program @samp{imtest} プログラムは Cyrus IMAPD に含まれています。nnimap は -@samp{imtest} バージョン 1.5.x と 1.6.x の両方をサポートします。 +@samp{imtest} バージョン 1.5.x と 1.6.x の両方をサポートします。変数 +@code{imap-kerberos4-program} は imtest プログラムに渡すパタメータを含み +ます。 +@vindex imap-ssl-program SSL 接続のための OpenSSL プログラムは @file{http://www.openssl.org/} か ら入手できます。OpenSSL は以前は SSLeay として知られていたもので、nnimap はそれもサポートします。しかし、SSLeay の最新版である 0.9.x には重大なバ グがあるため使えません。以前の版、特に SSLeay 0.8.x は使えることがわかっ -ています。 +ています。変数 @code{imap-ssl-program} は OpenSSL/SSLeay に渡すパタメー +タを含みます。 + +@vindex imap-shell-program +@vindex imap-shell-host +IMAP 接続に @code{shell} ストリームを使う場合、変数 +@code{imap-shell-program} は何のプログラムを呼ぶかを指定します。 @item nnimap-authenticator @vindex nnimap-authenticator @@ -13191,6 +13203,14 @@ SSL 接続のための OpenSSL プログラムは @file{http://www.openssl.org/} @item ask メールボックスを閉じるときに、nnimap が消去された記事を削除するかどうか を尋ねます。 + +@item nnimap-authinfo-file +@vindex nnimap-authinfo-file + +サーバにログインするために使う認証情報 (authinfo) を含むファイルです。そ +の形式は (ほとんど) @code{ftp} の @file{~/.netrc} ファイルと同じです。厳 +密た定義は `nntp-authinfo-file'を見て下さい。 + @end table @end table @@ -13641,9 +13661,10 @@ Gnus を @code{gnus-unplugged} で起動します。これは gnus エージェ $Bしているニュース記事は全て読むことができます。 @item -そして、新しいニュースが到着しているかどうかを調べることにします。 -あなたは (PPP か何かを使って) あなたのマシンをネットワークに接続 -し、そして gnus を差し込むために @kbd{J j} を叩きます。 +そして、新しいニュースが到着しているかどうかを調べることにします。あなた +は (PPP か何かを使って) あなたのマシンをネットワークに接続し、gnus を差 +し込むために @kbd{J j} を叩き、そして普通は新着メールを検査するために +@kbd{g} を使います。 @item そして、その場ですぐに新しいニュースを読むこともできますし、ニュー @@ -17970,6 +17991,16 @@ t)} で、これは不可視テキストを見えなくして触れなくします。 二つのシェル命令を区切るのに使用される文字列。初期設定値は @samp{;} です。 +@item gnus-invalid-group-regexp +@vindex gnus-invalid-group-regexp + +ユーザにグループ名を確認するときに使う、``使えない'' グループ名にマッチ +する正規表現です。既定値は gnus の内部動作 (選択方法とグループの境界に、 +通常 @samp{:} を使っている) をめちゃめちゃにしてしまうかもしれない、いく +つかの @strong{本当に} 使えないグループ名を捕まえます。 + +IMAP ユーザはグループ名に @samp{/} を使いたいと思うでしょうけれど。 + @end table diff --git a/texi/gnus.texi b/texi/gnus.texi index 8ae5765..84e6eeb 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -11003,7 +11003,7 @@ Or using the default path: @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 you ange-ftp +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. @@ -11229,7 +11229,7 @@ What stream to use for connecting to the server, this is one of the symbols in @code{imap-stream-alist}. Right now, this means @samp{kerberos4}, @samp{ssl} or the default @samp{network}. -@item :authenticator +@item :authentication Which authenticator to use for authenticating to the server, this is one of the symbols in @code{imap-authenticator-alist}. Right now, this means @samp{kerberos4}, @samp{cram-md5}, @samp{anonymous} or the default @@ -13537,17 +13537,30 @@ SSL). Require the external library @samp{starttls.el} and program @dfn{ssl:} Connect through SSL. Require OpenSSL (the program @samp{openssl}) or SSLeay (@samp{s_client}). @item +@dfn{shell:} Use a shell command to start IMAP connection. +@item @dfn{network:} Plain, TCP/IP network connection. @end itemize +@vindex imap-kerberos4-program The @samp{imtest} program is shipped with Cyrus IMAPD, nnimap support -both @samp{imtest} version 1.5.x and version 1.6.x. +both @samp{imtest} version 1.5.x and version 1.6.x. The variable +@code{imap-kerberos4-program} contain parameters to pass to the imtest +program. +@vindex imap-ssl-program For SSL connections, the OpenSSL program is available from @file{http://www.openssl.org/}. OpenSSL was formerly known as SSLeay, -and nnimap support it too - although the most recent versions of SSLeay, -0.9.x, are known to have serious bugs making it useless. Earlier -versions, especially 0.8.x, of SSLeay are known to work. +and nnimap support it too - although the most recent versions of +SSLeay, 0.9.x, are known to have serious bugs making it +useless. Earlier versions, especially 0.8.x, of SSLeay are known to +work. The variable @code{imap-ssl-program} contain parameters to pass +to OpenSSL/SSLeay. + +@vindex imap-shell-program +@vindex imap-shell-host +For IMAP connections using the @code{shell} stream, the variable +@code{imap-shell-program} specify what program to call. @item nnimap-authenticator @vindex nnimap-authenticator @@ -13606,6 +13619,14 @@ manually, @xref{Expunging mailboxes}. @item ask When closing mailboxes, nnimap will ask if you wish to expunge deleted articles or not. + +@item nnimap-authinfo-file +@vindex nnimap-authinfo-file + +A file containing credentials used to log in on servers. The format +is (almost) the same as the @code{ftp} @file{~/.netrc} file. See +`nntp-authinfo-file' for exact syntax. + @end table @end table @@ -14050,7 +14071,8 @@ already fetched while in this mode. @item You then decide to see whether any new news has arrived. You connect your machine to the net (using PPP or whatever), and then hit @kbd{J j} -to make Gnus become @dfn{plugged}. +to make Gnus become @dfn{plugged} and use @kbd{g} to check for new mail +as usual. @item You can then read the new news immediately, or you can download the news @@ -18296,6 +18318,17 @@ some headers. I don't see why you'd want that, though. @vindex gnus-shell-command-separator String used to separate two shell commands. The default is @samp{;}. +@item gnus-invalid-group-regexp +@vindex gnus-invalid-group-regexp + +Regexp to match ``invalid'' group names when querying user for a group +name. The default value catches some @strong{really} invalid group +names who could possibly mess up Gnus internally (like allowing +@samp{:} in a group name, which is normally used to delimit method and +group). + +IMAP users might want to allow @samp{/} in group names though. + @end table -- 1.7.10.4