Commit 6b958814 authored by Gnus developers's avatar Gnus developers Committed by Katsumi Yamaoka
Browse files

nnimap.el (nnimap-request-accept-article): Get the Message-ID without the \r.

nnimap.el (nnimap-find-article-by-message-id): Use EXAMINE instead of SELECT to get the message-id.
gnus-art.el, gnus.el, nnimap.el: Fix up make-obsolete-variable declarations throughout.
gnus.texi (Mail Source Specifiers): Remove webmail.el mentions.
mail-source.el: Removed webmail support.
nntp.el (nntp-server-list-active-group): Document.
gnus.texi (NNTP): Document nntp-server-list-active-group.
gnus.texi (Customizing the IMAP Connection): Remove extra quote.
nnimap.el (nnimap-find-article-by-message-id): Really return the article number.
nnimap.el: Add nnimap-split-fancy.
netrc.el (netrc-credentials, netrc-machine): Return the value of the "default" entry.
nnimap.el: Use tls.el exclusively, and not starttls.el at all.
nnimap.el (nnimap-wait-for-connection): Accept the moronic openssl s_client -starttls output, too.
nnrss.el (nnrss-use-local): Add documentation.
message.el (message-ignored-supersedes-headers): Strip Injection-* headers before superseding.
nnimap.el (nnimap-open-connection): Reinstate the auto-upgrade from unencrypted to STARTTLS, if possible.
nnir.el: Use the server names without suffixes.
gnus-sum.el (gnus-summary-show-thread): Skip past invisible text when expanding threads.
gnus-registry.el: Don't follow nnmairix references.  Install the nnregistry refer method.
gnus.texi (Spam Package Configuration Examples, SpamOracle): Remove nnimap-split-rule from examples.
parent 55e572ef
2010-09-30 Teodor Zlatanov <tzz@lifelogs.com>
* gnus.texi (Spam Package Configuration Examples, SpamOracle): Remove
nnimap-split-rule from examples.
2010-09-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Mail Source Specifiers): Remove webmail.el mentions.
(NNTP): Document nntp-server-list-active-group. Suggested by Barry
Fishman.
(Client-Side IMAP Splitting): Add nnimap-split-fancy.
2010-09-30 Julien Danjou <julien@danjou.info>
* gnus.texi (Gravatars): Fix documentation about
gnu-gravatar-properties.
2010-09-29 Daiki Ueno <ueno@unixuser.org> 2010-09-29 Daiki Ueno <ueno@unixuser.org>
* epa.texi (Bug Reports): New section. * epa.texi (Bug Reports): New section.
...@@ -6,6 +23,16 @@ ...@@ -6,6 +23,16 @@
* Makefile.in (top_srcdir): Remove unused variable. * Makefile.in (top_srcdir): Remove unused variable.
2010-09-29 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Using IMAP): Remove the @acronyms from the headings.
(Client-Side IMAP Splitting): Document 'default.
2010-09-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus.texi (Customizing the IMAP Connection): Document
nnimap-fetch-partial-articles.
2010-09-26 Lars Magne Ingebrigtsen <larsi@gnus.org> 2010-09-26 Lars Magne Ingebrigtsen <larsi@gnus.org>
* gnus-news.texi: Mention nnimap-inbox. * gnus-news.texi: Mention nnimap-inbox.
......
...@@ -14394,6 +14394,12 @@ inhibit Gnus to add a @code{Message-ID} header, you could say: ...@@ -14394,6 +14394,12 @@ inhibit Gnus to add a @code{Message-ID} header, you could say:
Note that not all servers support the recommended ID. This works for Note that not all servers support the recommended ID. This works for
INN versions 2.3.0 and later, for instance. INN versions 2.3.0 and later, for instance.
   
@item nntp-server-list-active-group
If @code{nil}, then always use @samp{GROUP} instead of @samp{LIST
ACTIVE}. This is usually slower, but on misconfigured servers that
don't update their active files often, this can help.
@end table @end table
   
@menu @menu
...@@ -14836,7 +14842,7 @@ Here's an example method that's more complex: ...@@ -14836,7 +14842,7 @@ Here's an example method that's more complex:
(nnimap-inbox "INBOX") (nnimap-inbox "INBOX")
(nnimap-split-methods default) (nnimap-split-methods default)
(nnimap-expunge t) (nnimap-expunge t)
(nnimap-stream 'ssl) (nnimap-stream ssl)
(nnir-search-engine imap) (nnir-search-engine imap)
(nnimap-expunge-inbox t)) (nnimap-expunge-inbox t))
@end example @end example
...@@ -14906,6 +14912,9 @@ Uses the same syntax as @code{nnmail-split-methods} (@pxref{Splitting ...@@ -14906,6 +14912,9 @@ Uses the same syntax as @code{nnmail-split-methods} (@pxref{Splitting
Mail}), except the symbol @code{default}, which means that it should Mail}), except the symbol @code{default}, which means that it should
use the value of the @code{nnmail-split-methods} variable. use the value of the @code{nnmail-split-methods} variable.
   
@item nnimap-split-fancy
Uses the same syntax as @code{nnmail-split-fancy}.
@end table @end table
   
   
...@@ -15559,45 +15568,6 @@ An example @acronym{IMAP} mail source: ...@@ -15559,45 +15568,6 @@ An example @acronym{IMAP} mail source:
:fetchflag "\\Seen") :fetchflag "\\Seen")
@end lisp @end lisp
   
@item webmail
Get mail from a webmail server, such as @uref{http://www.hotmail.com/},
@uref{http://webmail.netscape.com/}, @uref{http://www.netaddress.com/},
@uref{http://mail.yahoo.com/}.
NOTE: Webmail largely depends on cookies. A "one-line-cookie" patch is
required for url "4.0pre.46".
WARNING: Mails may be lost. NO WARRANTY.
Keywords:
@table @code
@item :subtype
The type of the webmail server. The default is @code{hotmail}. The
alternatives are @code{netscape}, @code{netaddress}, @code{my-deja}.
@item :user
The user name to give to the webmail server. The default is the login
name.
@item :password
The password to give to the webmail server. If not specified, the user is
prompted.
@item :dontexpunge
If non-@code{nil}, only fetch unread articles and don't move them to
trash folder after finishing the fetch.
@end table
An example webmail source:
@lisp
(webmail :subtype 'hotmail
:user "user-name"
:password "secret")
@end lisp
@item group @item group
Get the actual mail source from the @code{mail-source} group parameter, Get the actual mail source from the @code{mail-source} group parameter,
@xref{Group Parameters}. @xref{Group Parameters}.
...@@ -24196,8 +24166,8 @@ From Ted Zlatanov <tzz@@lifelogs.com>. ...@@ -24196,8 +24166,8 @@ From Ted Zlatanov <tzz@@lifelogs.com>.
spam-move-spam-nonspam-groups-only nil spam-move-spam-nonspam-groups-only nil
spam-mark-only-unseen-as-spam t spam-mark-only-unseen-as-spam t
spam-mark-ham-unread-before-move-from-spam-group t spam-mark-ham-unread-before-move-from-spam-group t
nnimap-split-rule 'nnimap-split-fancy
;; @r{understand what this does before you copy it to your own setup!} ;; @r{understand what this does before you copy it to your own setup!}
;; @r{for nnimap you'll probably want to set nnimap-split-methods, see the manual}
nnimap-split-fancy '(| nnimap-split-fancy '(|
;; @r{trace references to parents and put in their group} ;; @r{trace references to parents and put in their group}
(: gnus-registry-split-fancy-with-parent) (: gnus-registry-split-fancy-with-parent)
...@@ -24919,8 +24889,8 @@ messages stay in @samp{INBOX}: ...@@ -24919,8 +24889,8 @@ messages stay in @samp{INBOX}:
@example @example
(setq spam-use-spamoracle t (setq spam-use-spamoracle t
spam-split-group "Junk" spam-split-group "Junk"
;; @r{for nnimap you'll probably want to set nnimap-split-methods, see the manual}
nnimap-split-inbox '("INBOX") nnimap-split-inbox '("INBOX")
nnimap-split-rule 'nnimap-split-fancy
nnimap-split-fancy '(| (: spam-split) "INBOX")) nnimap-split-fancy '(| (: spam-split) "INBOX"))
@end example @end example
   
...@@ -26239,7 +26209,7 @@ wrong show. ...@@ -26239,7 +26209,7 @@ wrong show.
Masanobu @sc{Umeda}---the writer of the original @sc{gnus}. Masanobu @sc{Umeda}---the writer of the original @sc{gnus}.
   
@item @item
Shenghuo Zhu---uudecode.el, mm-uu.el, rfc1843.el, webmail.el, Shenghuo Zhu---uudecode.el, mm-uu.el, rfc1843.el,
nnwarchive and many, many other things connected with @acronym{MIME} and nnwarchive and many, many other things connected with @acronym{MIME} and
other types of en/decoding, as well as general bug fixing, new other types of en/decoding, as well as general bug fixing, new
functionality and stuff. functionality and stuff.
2010-09-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
* tls.el (tls-starttls-switches): New variable.
(tls-find-starttls-argument): Use it.
(open-tls-stream): Ditto.
1 * netrc.el (netrc-credentials): Return the value of the "default"
entry.
(netrc-machine): Ditto.
2010-09-30 Eli Zaretskii <eliz@gnu.org> 2010-09-30 Eli Zaretskii <eliz@gnu.org>
   
* vc/vc-hooks.el (vc-default-mode-line-string): Doc fix. * vc/vc-hooks.el (vc-default-mode-line-string): Doc fix.
......
2010-09-30 Teodor Zlatanov <tzz@lifelogs.com>
* gnus-registry.el (gnus-registry-install-nnregistry): New function to
install the nnregistry refer method.
(gnus-registry-install-hooks): Use it.
(gnus-registry-unfollowed-groups): Add nnmairix to the default
unfollowed groups.
2010-09-30 Jose A. Ortega Ruiz <jao@gnu.org> (tiny change)
* gnus-sum.el (gnus-summary-show-thread): Skip past invisible text when
expanding threads.
2010-09-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
* nnir.el: Use the server names without suffixes (bug #7009).
* nnimap.el (nnimap-open-connection): Reinstate the auto-upgrade from
unencrypted to STARTTLS, if possible.
2010-09-30 Teemu Likonen <tlikonen@iki.fi> (tiny change)
* message.el (message-ignored-supersedes-headers): Strip Injection-*
headers before superseding.
2010-09-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
* nnrss.el (nnrss-use-local): Add documentation.
* nnimap.el (nnimap-extend-tls-programs): New function.
(nnimap-open-connection): Use tls.el exclusively, and not starttls.el.
(nnimap-wait-for-connection): Accept the greeting from the stupid
output from openssl s_client -starttls, too.
* nnimap.el (nnimap-find-article-by-message-id): Really return the
article number.
(nnimap-split-fancy): New variable.
(nnimap-split-incoming-mail): Use it.
* nntp.el (nntp-server-list-active-group): Document.
* nnimap.el (nnimap-find-article-by-message-id): Use EXAMINE instead of
SELECT to get the message-id.
* mail-source.el (mail-sources): Removed webmail support.
(defvar): Ditto.
(mail-source-fetcher-alist): Ditto.
(mail-source-fetch-webmail): Removed.
* webmail.el: Removed -- doesn't seem relevant any more.
* gnus.el: Fix up make-obsolete-variable declarations throughout.
* nnimap.el (nnimap-request-accept-article): Get the Message-ID without
the \r.
2010-09-30 Julien Danjou <julien@danjou.info> 2010-09-30 Julien Danjou <julien@danjou.info>
   
* gnus-agent.el (gnus-agent-add-group): Fix call to * gnus-agent.el (gnus-agent-add-group): Fix call to
...@@ -44,11 +100,13 @@ ...@@ -44,11 +100,13 @@
(nnimap-request-accept-article): Add \r\n to the lines to make this (nnimap-request-accept-article): Add \r\n to the lines to make this
work with Cyrus. work with Cyrus.
   
* nnregistry.el: Added.
* nndraft.el (nndraft-request-expire-articles): Use the group name * nndraft.el (nndraft-request-expire-articles): Use the group name
instead if "nndraft". Fix found by Nils Ackermann. instead if "nndraft". Fix found by Nils Ackermann.
   
2010-09-29 Ludovic Courtes <ludo@gnu.org>
* nnregistry.el: Added.
2010-09-29 Stefan Monnier <monnier@iro.umontreal.ca> 2010-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
   
* nnmail.el (group, group-art-list, group-art): * nnmail.el (group, group-art-list, group-art):
......
...@@ -725,7 +725,7 @@ Each element is a regular expression." ...@@ -725,7 +725,7 @@ Each element is a regular expression."
:group 'gnus-article-various) :group 'gnus-article-various)
(make-obsolete-variable 'gnus-article-hide-pgp-hook nil (make-obsolete-variable 'gnus-article-hide-pgp-hook nil
"Gnus 5.10 (Emacs-22.1)") "Gnus 5.10 (Emacs 22.1)")
(defface gnus-button (defface gnus-button
'((t (:weight bold))) '((t (:weight bold)))
...@@ -1412,7 +1412,7 @@ predicate. See Info node `(gnus)Customizing Articles'." ...@@ -1412,7 +1412,7 @@ predicate. See Info node `(gnus)Customizing Articles'."
:type gnus-article-treat-custom) :type gnus-article-treat-custom)
(make-obsolete-variable 'gnus-treat-display-xface (make-obsolete-variable 'gnus-treat-display-xface
'gnus-treat-display-x-face "22.1") 'gnus-treat-display-x-face "Emacs 22.1")
(defcustom gnus-treat-display-x-face (defcustom gnus-treat-display-x-face
(and (not noninteractive) (and (not noninteractive)
......
...@@ -122,12 +122,14 @@ display." ...@@ -122,12 +122,14 @@ display."
:type 'symbol) :type 'symbol)
(defcustom gnus-registry-unfollowed-groups (defcustom gnus-registry-unfollowed-groups
'("delayed$" "drafts$" "queue$" "INBOX$") '("delayed$" "drafts$" "queue$" "INBOX$" "^nnmairix:")
"List of groups that gnus-registry-split-fancy-with-parent won't return. "List of groups that gnus-registry-split-fancy-with-parent won't return.
The group names are matched, they don't have to be fully The group names are matched, they don't have to be fully
qualified. This parameter tells the Registry 'never split a qualified. This parameter tells the Registry 'never split a
message into a group that matches one of these, regardless of message into a group that matches one of these, regardless of
references.'" references.'
nnmairix groups are specifically excluded because they are ephemeral."
:group 'gnus-registry :group 'gnus-registry
:type '(repeat regexp)) :type '(repeat regexp))
...@@ -1127,6 +1129,7 @@ Returns the first place where the trail finds a group name." ...@@ -1127,6 +1129,7 @@ Returns the first place where the trail finds a group name."
(setq gnus-registry-install t) ; in case it was 'ask or nil (setq gnus-registry-install t) ; in case it was 'ask or nil
(gnus-registry-install-hooks) (gnus-registry-install-hooks)
(gnus-registry-install-shortcuts) (gnus-registry-install-shortcuts)
(gnus-registry-install-nnregistry)
(gnus-registry-read)) (gnus-registry-read))
;;;###autoload ;;;###autoload
...@@ -1143,6 +1146,19 @@ Returns the first place where the trail finds a group name." ...@@ -1143,6 +1146,19 @@ Returns the first place where the trail finds a group name."
(add-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids)) (add-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids))
;;;###autoload
(defun gnus-registry-install-nnregistry ()
"Install the nnregistry refer method in `gnus-refer-article-method'."
(interactive)
(when (featurep 'nnregistry)
(setq gnus-refer-article-method
(delete-dups
(append
(if (listp gnus-refer-article-method)
gnus-refer-article-method
(list gnus-refer-article-method))
(list 'nnregistry))))))
(defun gnus-registry-unload-hook () (defun gnus-registry-unload-hook ()
"Uninstall the registry hooks." "Uninstall the registry hooks."
(interactive) (interactive)
......
...@@ -11327,15 +11327,19 @@ For compatibility with XEmacs." ...@@ -11327,15 +11327,19 @@ For compatibility with XEmacs."
(gnus-remove-overlays (point-min) (point-max) 'invisible 'gnus-sum) (gnus-remove-overlays (point-min) (point-max) 'invisible 'gnus-sum)
(gnus-summary-position-point)) (gnus-summary-position-point))
(defsubst gnus-summary--inv (p)
(and (eq (get-char-property p 'invisible) 'gnus-sum) p))
(defun gnus-summary-show-thread () (defun gnus-summary-show-thread ()
"Show thread subtrees. "Show thread subtrees.
Returns nil if no thread was there to be shown." Returns nil if no thread was there to be shown."
(interactive) (interactive)
(let* ((orig (point)) (let* ((orig (point))
(end (point-at-eol)) (end (point-at-eol))
(end (or (gnus-summary--inv end) (gnus-summary--inv (1- end))))
;; Leave point at bol ;; Leave point at bol
(beg (progn (beginning-of-line) (if (bobp) (point) (1- (point))))) (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point)))))
(eoi (when (eq (get-char-property end 'invisible) 'gnus-sum) (eoi (when end
(if (fboundp 'next-single-char-property-change) (if (fboundp 'next-single-char-property-change)
(or (next-single-char-property-change end 'invisible) (or (next-single-char-property-change end 'invisible)
(point-max)) (point-max))
......
...@@ -1427,7 +1427,7 @@ no need to set this variable." ...@@ -1427,7 +1427,7 @@ no need to set this variable."
:group 'gnus-message :group 'gnus-message
:type '(choice (const :tag "default" nil) :type '(choice (const :tag "default" nil)
string)) string))
(make-obsolete-variable 'gnus-local-domain nil "24.1") (make-obsolete-variable 'gnus-local-domain nil "Emacs 24.1")
(defvar gnus-local-organization nil (defvar gnus-local-organization nil
"String with a description of what organization (if any) the user belongs to. "String with a description of what organization (if any) the user belongs to.
......
...@@ -217,34 +217,6 @@ See Info node `(gnus)Mail Source Specifiers'." ...@@ -217,34 +217,6 @@ See Info node `(gnus)Mail Source Specifiers'."
(const :format "" (const :format ""
:value :dontexpunge) :value :dontexpunge)
(boolean :tag "Dontexpunge")) (boolean :tag "Dontexpunge"))
(group :inline t
(const :format "" :value :plugged)
(boolean :tag "Plugged"))))
(cons :tag "Webmail server"
(const :format "" webmail)
(checklist :tag "Options" :greedy t
(group :inline t
(const :format "" :value :subtype)
;; Should be generated from
;; `webmail-type-definition', but we
;; can't require webmail without W3.
(choice :tag "Subtype"
:value hotmail
(const hotmail)
(const yahoo)
(const netaddress)
(const netscape)
(const my-deja)))
(group :inline t
(const :format "" :value :user)
(string :tag "User"))
(group :inline t
(const :format "" :value :password)
(string :tag "Password"))
(group :inline t
(const :format ""
:value :dontexpunge)
(boolean :tag "Dontexpunge"))
(group :inline t (group :inline t
(const :format "" :value :plugged) (const :format "" :value :plugged)
(boolean :tag "Plugged")))))))) (boolean :tag "Plugged"))))))))
...@@ -387,13 +359,7 @@ Common keywords should be listed here.") ...@@ -387,13 +359,7 @@ Common keywords should be listed here.")
(:prescript) (:prescript)
(:prescript-delay) (:prescript-delay)
(:postscript) (:postscript)
(:dontexpunge)) (:dontexpunge)))
(webmail
(:subtype hotmail)
(:user (or (user-login-name) (getenv "LOGNAME") (getenv "USER")))
(:password)
(:dontexpunge)
(:authentication password)))
"Mapping from keywords to default values. "Mapping from keywords to default values.
All keywords that can be used must be listed here.")) All keywords that can be used must be listed here."))
...@@ -402,8 +368,7 @@ All keywords that can be used must be listed here.")) ...@@ -402,8 +368,7 @@ All keywords that can be used must be listed here."))
(directory mail-source-fetch-directory) (directory mail-source-fetch-directory)
(pop mail-source-fetch-pop) (pop mail-source-fetch-pop)
(maildir mail-source-fetch-maildir) (maildir mail-source-fetch-maildir)
(imap mail-source-fetch-imap) (imap mail-source-fetch-imap))
(webmail mail-source-fetch-webmail))
"A mapping from source type to fetcher function.") "A mapping from source type to fetcher function.")
(defvar mail-source-password-cache nil) (defvar mail-source-password-cache nil)
...@@ -1138,30 +1103,6 @@ This only works when `display-time' is enabled." ...@@ -1138,30 +1103,6 @@ This only works when `display-time' is enabled."
?s server ?P port ?u user)) ?s server ?P port ?u user))
found))) found)))
(autoload 'webmail-fetch "webmail")
(defun mail-source-fetch-webmail (source callback)
"Fetch for webmail source."
(mail-source-bind (webmail source)
(let ((mail-source-string (format "webmail:%s:%s" subtype user))
(webmail-newmail-only dontexpunge)
(webmail-move-to-trash-can (not dontexpunge)))
(when (eq authentication 'password)
(setq password
(or password
(cdr (assoc (format "webmail:%s:%s" subtype user)
mail-source-password-cache))
(read-passwd
(format "Password for %s at %s: " user subtype))))
(when (and password
(not (assoc (format "webmail:%s:%s" subtype user)
mail-source-password-cache)))
(push (cons (format "webmail:%s:%s" subtype user) password)
mail-source-password-cache)))
(webmail-fetch mail-source-crash-box subtype user password)
(mail-source-callback callback (symbol-name subtype))
(mail-source-delete-crash-box))))
(provide 'mail-source) (provide 'mail-source)
;;; mail-source.el ends here ;;; mail-source.el ends here
...@@ -283,7 +283,7 @@ This is a list of regexps and regexp matches." ...@@ -283,7 +283,7 @@ This is a list of regexps and regexp matches."
:link '(custom-manual "(message)Mail Headers") :link '(custom-manual "(message)Mail Headers")
:type 'regexp) :type 'regexp)
(defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-ID:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|^X-Payment:\\|^Approved:" (defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-ID:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|^X-Payment:\\|^Approved:\\|^Injection-Date:\\|^Injection-Info:"
"*Header lines matching this regexp will be deleted before posting. "*Header lines matching this regexp will be deleted before posting.
It's best to delete old Path and Date headers before posting to avoid It's best to delete old Path and Date headers before posting to avoid
any confusion." any confusion."
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
(require 'nnoo) (require 'nnoo)
(require 'netrc) (require 'netrc)
(require 'utf7) (require 'utf7)
(require 'tls)
(require 'parse-time) (require 'parse-time)
(autoload 'auth-source-forget-user-or-password "auth-source") (autoload 'auth-source-forget-user-or-password "auth-source")
...@@ -70,8 +71,11 @@ Values are `ssl', `network', `starttls' or `shell'.") ...@@ -70,8 +71,11 @@ Values are `ssl', `network', `starttls' or `shell'.")
"How mail is split. "How mail is split.
Uses the same syntax as nnmail-split-methods") Uses the same syntax as nnmail-split-methods")
(defvoo nnimap-split-fancy nil
"Uses the same syntax as nnmail-split-fancy.")
(make-obsolete-variable 'nnimap-split-rule "see `nnimap-split-methods'" (make-obsolete-variable 'nnimap-split-rule "see `nnimap-split-methods'"
"Gnus 5.13") "Emacs 24.1")
(defvoo nnimap-authenticator nil (defvoo nnimap-authenticator nil
"How nnimap authenticate itself to the server. "How nnimap authenticate itself to the server.
...@@ -306,9 +310,11 @@ textual parts.") ...@@ -306,9 +310,11 @@ textual parts.")
(setq port (or nnimap-server-port "imap"))) (setq port (or nnimap-server-port "imap")))
'("imap")) '("imap"))
((eq nnimap-stream 'starttls) ((eq nnimap-stream 'starttls)
(starttls-open-stream (let ((tls-program (nnimap-extend-tls-programs)))
"*nnimap*" (current-buffer) nnimap-address (open-tls-stream
(setq port (or nnimap-server-port "imap"))) "*nnimap*" (current-buffer) nnimap-address
(setq port (or nnimap-server-port "imap"))
'starttls))
'("imap")) '("imap"))
((eq nnimap-stream 'ssl) ((eq nnimap-stream 'ssl)
(open-tls-stream (open-tls-stream
...@@ -342,11 +348,23 @@ textual parts.") ...@@ -342,11 +348,23 @@ textual parts.")
#'upcase #'upcase
(nnimap-find-parameter (nnimap-find-parameter
"CAPABILITY" (cdr (nnimap-command "CAPABILITY"))))) "CAPABILITY" (cdr (nnimap-command "CAPABILITY")))))
(when (eq nnimap-stream 'starttls)
(nnimap-command "STARTTLS")
(starttls-negotiate (nnimap-process nnimap-object)))
(when nnimap-server-port (when nnimap-server-port
(push (format "%s" nnimap-server-port) ports)) (push (format "%s" nnimap-server-port) ports))
;; If this is a STARTTLS-capable server, then sever the
;; connection and start a STARTTLS connection instead.
(when (and (eq nnimap-stream 'network)
(member "STARTTLS" (nnimap-capabilities nnimap-object)))
(let ((nnimap-stream 'starttls))
(let ((tls-process
(nnimap-open-connection buffer)))
;; If the STARTTLS connection was successful, we
;; kill our first non-encrypted connection. If it
;; wasn't successful, we just use our unencrypted
;; connection.
(when (memq (process-status tls-process) '(open run))
(delete-process (nnimap-process nnimap-object))
(kill-buffer (current-buffer))
(return tls-process)))))
(unless (equal connection-result "PREAUTH") (unless (equal connection-result "PREAUTH")
(if (not (setq credentials (if (not (setq credentials
(if (eq nnimap-authenticator 'anonymous) (if (eq nnimap-authenticator 'anonymous)
...@@ -378,7 +396,16 @@ textual parts.") ...@@ -378,7 +396,16 @@ textual parts.")
(when nnimap-object (when nnimap-object
(when (member "QRESYNC" (nnimap-capabilities nnimap-object)) (when (member "QRESYNC" (nnimap-capabilities nnimap-object))
(nnimap-command "ENABLE QRESYNC")) (nnimap-command "ENABLE QRESYNC"))
t))))))) (nnimap-process nnimap-object))))))))
(defun nnimap-extend-tls-programs ()
(let ((programs tls-program)