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

nnimap 0.80 -> 0.81 patches.



Index: nnimap/ChangeLog
diff -c nnimap/ChangeLog:1.120 nnimap/ChangeLog:1.126
*** nnimap/ChangeLog:1.120	Tue Dec  1 21:34:02 1998
--- nnimap/ChangeLog	Fri Dec  4 07:18:48 1998
***************
*** 1,3 ****
--- 1,48 ----
+ 1998-12-04 16:16:31  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap 0.81 released.
+ 
+ 1998-12-04 16:13:53  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (nnimap-open-server): Authinfo stuff.
+ 
+ 	* imap.el (imap-authenticate): Optional user/passwd.
+ 
+ 1998-12-04 15:54:52  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* imap.el (imap-cb-response): UIDNOTSTICKY (what the heck is that?).
+ 
+ 1998-12-04 15:43:21  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (nnimap-address): New variable.
+ 	(nnimap-server-address): Obsolete variable.
+ 	(nnimap-open-server): Nnimap-server-address -> nnimap-address.
+ 
+ 	* nnimap.texi: nnimap-server-address -> nnimap-address.
+ 
+ 1998-12-03 23:36:35  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* imap.el (imap-close): Debug more.
+ 	(imap-open): Oops, left debug code.
+ 
+ 1998-12-03 22:51:08  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* imap.el (imap-close): Kill process immediately (after server
+  	OK). Error if it couldn't log out.
+ 
+ 	* imap.el (imap-open): Multiple calls re-open the server. Multiple
+  	calls listens to server and port arguments. Set stream-changed
+  	correctly.
+ 	
+ 1998-12-03 22:08:14  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* imap.el (imap-debug): Trace new functions.
+ 
+ 1998-12-02 22:45:56  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* imap.el (imap-auth-method): 
+ 	(imap-authinfo): Removed.
+ 
  1998-12-02 06:31:48  Simon Josefsson  <jas@pdc.kth.se>
  
  	* nnimap 0.80 released.
Index: nnimap/imap.el
diff -c nnimap/imap.el:1.58 nnimap/imap.el:1.64
*** nnimap/imap.el:1.58	Tue Dec  1 21:21:58 1998
--- nnimap/imap.el	Fri Dec  4 07:15:40 1998
***************
*** 56,73 ****
  
  ;;; New varibles (copyright jas):
  
- (defvar imap-auth-method nil
-   "*The name of a function to use for loging on to the server. Defaults on
- nil to plain text logins using the LOGIN command.
- 
- Examples; imap-authenticate-cram-md5.
- 
- This can be overried by the server definition imap-auth-method, and
- this is the prefered way of specifying this.")
- 
- (defvar imap-authinfo nil
-   "Buffer local variable which contains (user . password) for server.")
- 
  (defvar imap-data-capability nil
    "Current server's capability list")
  
--- 56,61 ----
***************
*** 225,234 ****
                        imap-data-capability
  		      imap-data-namespace
                        imap-data-folder
- 		      imap-auth-method
                        imap-message-data
                        imap-default-name
- 		      imap-authinfo
                        imap-last-status
                        imap-process
                        imap-tag-num
--- 213,220 ----
***************
*** 442,454 ****
  	  (imap-close buffer)
  	(mapc 'make-variable-buffer-local imap-locals)
  	(mapc 'make-variable-buffer-local imap-local-variables)
- 	(setq imap-server server)
- 	(setq imap-port port)
  	(buffer-disable-undo)
  	(imap-disable-multibyte)) ;; we shouldn't do this
        (if auth (setq imap-auth auth))
        (if stream (setq imap-stream stream))
!       (when (or (null imap-stream) (null imap-auth))
  	;; Determine network stream and/or auth mechanism to use
  	(if (not (let ((imap-stream (or imap-stream imap-default-stream)))
  		   (imap-open-1 buffer)))
--- 428,441 ----
  	  (imap-close buffer)
  	(mapc 'make-variable-buffer-local imap-locals)
  	(mapc 'make-variable-buffer-local imap-local-variables)
  	(buffer-disable-undo)
  	(imap-disable-multibyte)) ;; we shouldn't do this
+       (if server (setq imap-server server))
+       (if port (setq imap-port port))
        (if auth (setq imap-auth auth))
        (if stream (setq imap-stream stream))
!       (if (and imap-stream imap-auth)
! 	  (imap-open-1 buffer)
  	;; Determine network stream and/or auth mechanism to use
  	(if (not (let ((imap-stream (or imap-stream imap-default-stream)))
  		   (imap-open-1 buffer)))
***************
*** 461,467 ****
  	    (let ((streams imap-streams))
  	      (while (setq stream (pop streams))
  		(if (funcall (nth 1 (assq stream imap-stream-alist)) buffer)
! 		    (setq stream-changed (not (eq imap-stream stream))
  			  imap-stream stream
  			  streams nil)))
  	      (unless imap-stream
--- 448,457 ----
  	    (let ((streams imap-streams))
  	      (while (setq stream (pop streams))
  		(if (funcall (nth 1 (assq stream imap-stream-alist)) buffer)
! 		    (setq stream-changed (not (eq
! 					       imap-stream
! 					       (or stream 
! 						   imap-default-stream)))
  			  imap-stream stream
  			  streams nil)))
  	      (unless imap-stream
***************
*** 489,511 ****
  	 (and imap-process
  	      (memq (process-status imap-process) '(open run))))))
  
! (defun imap-authenticate (buffer)
    (with-current-buffer buffer
      (funcall (nth 2 (assq imap-auth imap-authenticator-alist)) buffer)))
    
  (defun imap-close (&optional buffer)
    (with-current-buffer (or buffer (current-buffer))
!     (if (imap-opened)
! 	(imap-send-command-wait "LOGOUT"))
!     (when (get-buffer-process buffer)
!       (message "Couldn't log out from server, reaping process...")
!       (sit-for 1)
!       (delete-process imap-process))
!     (setq imap-current-folder nil
! 	  imap-current-message nil
! 	  imap-process nil)
!     (erase-buffer)
!     t))
  
  (defun imap-capability (&optional identifier buffer)
    "Return a list of identifiers which the server support. If IDENTIFIER,
--- 479,504 ----
  	 (and imap-process
  	      (memq (process-status imap-process) '(open run))))))
  
! (defun imap-authenticate (buffer &optional user passwd)
    (with-current-buffer buffer
+     (make-variable-buffer-local 'imap-username)
+     (make-variable-buffer-local 'imap-password)
+     (if user (setq imap-username user))
+     (if passwd (setq imap-password passwd))
      (funcall (nth 2 (assq imap-auth imap-authenticator-alist)) buffer)))
    
  (defun imap-close (&optional buffer)
    (with-current-buffer (or buffer (current-buffer))
!     (if (not (and (imap-opened)
! 		  (imap-send-command-wait "LOGOUT")))
! 	(error "Server %s didn't let me log out" imap-server)
!       (when (memq (process-status imap-process) '(open run))
! 	(delete-process imap-process))
!       (setq imap-current-folder nil
! 	    imap-current-message nil
! 	    imap-process nil)
!       (erase-buffer)
!       t)))
  
  (defun imap-capability (&optional identifier buffer)
    "Return a list of identifiers which the server support. If IDENTIFIER,
***************
*** 671,678 ****
    (buffer-disable-undo (get-buffer-create imap-debug))
    (imap-disable-multibyte)
    (mapc (lambda (f) (trace-function-background f imap-debug)) 
!         '(imap-open-server
!           imap-close-server
  	  imap-mailbox-select
  	  imap-mailbox-unselect
  	  imap-mailbox-expunge-close
--- 664,689 ----
    (buffer-disable-undo (get-buffer-create imap-debug))
    (imap-disable-multibyte)
    (mapc (lambda (f) (trace-function-background f imap-debug)) 
!         '(imap-kerberos4s-p
! 	  imap-kerberos4-open
! 	  imap-ssl-p
! 	  imap-ssl-open-1
! 	  imap-ssl-open
! 	  imap-network-p
! 	  imap-network-open
! 	  imap-interactive-login
! 	  imap-kerberos4a-p
! 	  imap-kerberos4-auth
! 	  imap-cram-md5-p
! 	  imap-cram-md5-auth
! 	  imap-login-p
! 	  imap-login-auth
! 	  imap-anonymous-p
! 	  imap-anonymous-open
! 	  imap-open-1
! 	  imap-open
! 	  imap-opened
!           imap-close
  	  imap-mailbox-select
  	  imap-mailbox-unselect
  	  imap-mailbox-expunge-close
***************
*** 683,689 ****
  	  imap-wait-for-tag
  	  imap-capability
  	  imap-namespace-get
- 	  imap-authinfo-get
            imap-folder-set
            imap-folder-get
            imap-folder-plist
--- 694,699 ----
***************
*** 1213,1218 ****
--- 1223,1230 ----
  	     (message "IMAP: %s %s" code string))
  	    ((equal var 'UIDNEXT)
  	     (imap-folder-set 'uidnext value))
+ 	    ((equal var 'UIDNOTSTICKY)
+ 	     (imap-folder-set 'uidnotsticky value))
              ((equal var 'UNSEEN)
               (imap-folder-set 'unseen value))
              ((equal var 'UIDVALIDITY) ; We should wipe cache clean here only???
Index: nnimap/nnimap.el
diff -c nnimap/nnimap.el:1.96 nnimap/nnimap.el:1.99
*** nnimap/nnimap.el:1.96	Tue Dec  1 21:19:21 1998
--- nnimap/nnimap.el	Fri Dec  4 07:19:03 1998
***************
*** 27,33 ****
  ;;;  (setq gnus-secondary-select-methods 
  ;;;      '((nnimap 
  ;;;          "yoyo"
! ;;;          (nnimap-server-address "robby.caltech.edu"))))
  
  ;;; And inside Gnus, list all available groups with A A (search for 
  ;;; 'nnimap') and subscribe to the mailboxes you are interested in with U. 
--- 27,33 ----
  ;;;  (setq gnus-secondary-select-methods 
  ;;;      '((nnimap 
  ;;;          "yoyo"
! ;;;          (nnimap-address "robby.caltech.edu"))))
  
  ;;; And inside Gnus, list all available groups with A A (search for 
  ;;; 'nnimap') and subscribe to the mailboxes you are interested in with U. 
***************
*** 96,102 ****
  
  (nnoo-declare nnimap) ; we derive from no one
  
! (defconst nnimap-version "nnimap 0.80")
  
  ;; Various server variables.
  
--- 96,102 ----
  
  (nnoo-declare nnimap) ; we derive from no one
  
! (defconst nnimap-version "nnimap 0.81")
  
  ;; Various server variables.
  
***************
*** 138,146 ****
  \"LIST\". LSUB means only retrieve groups marked on the server as
  subscribed.  LIST means every matching group should be retrieved.")
  
! (defvoo nnimap-server-address nil
    "*The name of the IMAP server.  If nil, uses the virtual server's name.")
  
  (defvoo nnimap-server-port nil
    "*The port of the IMAP server.  If nil, uses the default port. (143).")
  
--- 138,149 ----
  \"LIST\". LSUB means only retrieve groups marked on the server as
  subscribed.  LIST means every matching group should be retrieved.")
  
! (defvoo nnimap-address nil
    "*The name of the IMAP server.  If nil, uses the virtual server's name.")
  
+ (defvoo nnimap-server-address nil
+   "Obsolete. Use `nnimap-address'.")
+ 
  (defvoo nnimap-server-port nil
    "*The port of the IMAP server.  If nil, uses the default port. (143).")
  
***************
*** 408,419 ****
                 (error "this shouldn't happen")
               t))
        (progn
!         (unless (assq 'nnimap-server-address defs)
!           (push (list 'nnimap-server-address server) defs))
          (unless (assq 'nnimap-server-buffer defs)
!           (push (list 'nnimap-server-buffer (concat " *nnimap* " server)) defs))
  	(nnoo-change-server 'nnimap server defs)
! 	(if (not (imap-open nnimap-server-address nnimap-server-port
  			    nnimap-stream nnimap-authenticator 
  			    nnimap-server-buffer))
  	    (nnheader-report 'nnimap "Could not connect to server %s" server)
--- 411,426 ----
                 (error "this shouldn't happen")
               t))
        (progn
!         (unless (assq 'nnimap-address defs)
! 	  (if (assq 'nnimap-server-address defs)
! 	      (push (list 'nnimap-address (cadr (assq 'nnimap-server-address
! 						      defs))) defs)
! 	    (push (list 'nnimap-address server) defs)))
          (unless (assq 'nnimap-server-buffer defs)
!           (push (list 'nnimap-server-buffer (concat " *nnimap* " server))
! 		defs))
  	(nnoo-change-server 'nnimap server defs)
! 	(if (not (imap-open nnimap-address nnimap-server-port
  			    nnimap-stream nnimap-authenticator 
  			    nnimap-server-buffer))
  	    (nnheader-report 'nnimap "Could not connect to server %s" server)
***************
*** 422,433 ****
  		      (imap-capability 'IMAP4REV1 nnimap-server-buffer))
  	    (imap-close nnimap-server-buffer)
  	    (nnheader-report 'nnimap "Server %s not IMAP4" server))
! 	  (if (imap-authenticate nnimap-server-buffer)
! 	      (push (cons server nnimap-server-buffer)
! 		    nnimap-server-buffer-alist)
! 	    (imap-close nnimap-server-buffer)
! 	    (nnheader-report 'nnimap "Could not authenticate to %s"
! 			     server))))))
  
  (deffoo nnimap-close-server (&optional server)
    (let ((s-b (assoc (setq server (or server (nnoo-current-server 'nnimap)))
--- 429,449 ----
  		      (imap-capability 'IMAP4REV1 nnimap-server-buffer))
  	    (imap-close nnimap-server-buffer)
  	    (nnheader-report 'nnimap "Server %s not IMAP4" server))
! 	  (let (list alist user passwd)
! 	    (and (fboundp 'gnus-parse-netrc)
! 		 (setq list (gnus-parse-netrc nnimap-authinfo-file)
! 		       alist (or (and (gnus-netrc-get (gnus-netrc-machine 
! 						       list server) "machine")
! 				      (gnus-netrc-machine list server))
! 				 (gnus-netrc-machine list nnimap-address))
! 		       user (gnus-netrc-get alist "login")
! 		       passwd (gnus-netrc-get alist "password")))
! 	    (if (imap-authenticate nnimap-server-buffer user passwd)
! 		(push (cons server nnimap-server-buffer)
! 		      nnimap-server-buffer-alist)
! 	      (imap-close nnimap-server-buffer)
! 	      (nnheader-report 'nnimap "Could not authenticate to %s"
! 			       server)))))))
  
  (deffoo nnimap-close-server (&optional server)
    (let ((s-b (assoc (setq server (or server (nnoo-current-server 'nnimap)))
Index: nnimap/nnimap.texi
diff -c nnimap/nnimap.texi:1.15 nnimap/nnimap.texi:1.16
*** nnimap/nnimap.texi:1.15	Tue Nov 24 14:20:50 1998
--- nnimap/nnimap.texi	Fri Dec  4 06:44:42 1998
***************
*** 7,13 ****
  @setchapternewpage odd
  @paragraphindent 0
  
! @set VERSION $Revision: 1.1 $
  @set NNIMAP-VERSION 0.33
  
  @ifinfo
--- 7,13 ----
  @setchapternewpage odd
  @paragraphindent 0
  
! @set VERSION $Revision: 1.1 $
  @set NNIMAP-VERSION 0.33
  
  @ifinfo
***************
*** 173,189 ****
  (setq gnus-secondary-select-methods 
        '((nnfolder "")
          (nnimap "dada"
!                 (nnimap-server-address "cyrus.andrew.cmu.edu")
                  (nnimap-list-pattern ("INBOX" "archive.*")))
          (nnimap "yoyo"
                  (nnimap-auth-method cram-md5)
!                 (nnimap-server-address "your.mail.server"))))
  @end lisp
  
  The nnimap server variables used above are described below:
  @itemize @bullet
  @item
! @ref{config-server-address}.
  @item
  @ref{config-list-pattern}.
  @item
--- 173,189 ----
  (setq gnus-secondary-select-methods 
        '((nnfolder "")
          (nnimap "dada"
!                 (nnimap-address "cyrus.andrew.cmu.edu")
                  (nnimap-list-pattern ("INBOX" "archive.*")))
          (nnimap "yoyo"
                  (nnimap-auth-method cram-md5)
!                 (nnimap-address "your.mail.server"))))
  @end lisp
  
  The nnimap server variables used above are described below:
  @itemize @bullet
  @item
! @ref{config-address}.
  @item
  @ref{config-list-pattern}.
  @item
***************
*** 239,245 ****
  @cindex Configuring the server(s)
  @ifinfo
  @menu
! * config-server-address:: nnimap-server-address
  * config-server-port:: nnimap-server-port
  * config-list-method:: nnimap-list-method
  * config-list-pattern:: nnimap-list-pattern
--- 239,245 ----
  @cindex Configuring the server(s)
  @ifinfo
  @menu
! * config-address:: nnimap-address
  * config-server-port:: nnimap-server-port
  * config-list-method:: nnimap-list-method
  * config-list-pattern:: nnimap-list-pattern
***************
*** 249,263 ****
  @end ifinfo
  
  
! @node config-server-address, config-server-port, , config-server
! @subsection @code{nnimap-server-address}
  @cindex Server Address
! @vindex nnimap-server-address
  
  Hostname or IP address of IMAP server to use. Defaults to the Gnus
  server name ("dada" and "yoyo" in the examples above) unless specified.
  
! @node config-server-port, config-list-method, config-server-address, config-server
  @subsection @code{nnimap-server-port}
  @cindex Server port
  @vindex nnimap-server-port
--- 249,263 ----
  @end ifinfo
  
  
! @node config-address, config-server-port, , config-server
! @subsection @code{nnimap-address}
  @cindex Server Address
! @vindex nnimap-address
  
  Hostname or IP address of IMAP server to use. Defaults to the Gnus
  server name ("dada" and "yoyo" in the examples above) unless specified.
  
! @node config-server-port, config-list-method, config-address, config-server
  @subsection @code{nnimap-server-port}
  @cindex Server port
  @vindex nnimap-server-port
***************
*** 285,291 ****
  @lisp
  (setq gnus-secondary-select-methods 
        '((nnimap "nana"
! 		(nnimap-server-address "mail.server")
                  (nnimap-list-method "LSUB"))))
  @end lisp
  
--- 285,291 ----
  @lisp
  (setq gnus-secondary-select-methods 
        '((nnimap "nana"
! 		(nnimap-address "mail.server")
                  (nnimap-list-method "LSUB"))))
  @end lisp
  
***************
*** 314,320 ****
  @lisp
  (setq gnus-secondary-select-methods 
        '((nnimap "nana"
! 		(nnimap-server-address "mail.server")
                  (nnimap-list-pattern ("INBOX" "Mail/*" "alt.sex.*" ("~friend/Mail/" . "list/*"))))))
  @end lisp
  
--- 314,320 ----
  @lisp
  (setq gnus-secondary-select-methods 
        '((nnimap "nana"
! 		(nnimap-address "mail.server")
                  (nnimap-list-pattern ("INBOX" "Mail/*" "alt.sex.*" ("~friend/Mail/" . "list/*"))))))
  @end lisp
  
***************
*** 355,361 ****
  @lisp
  (setq gnus-secondary-select-methods 
        '((nnimap "nana"
! 		(nnimap-server-address "mail.server")
                  (nnimap-auth-method kerberos4))))
  @end lisp
  
--- 355,361 ----
  @lisp
  (setq gnus-secondary-select-methods 
        '((nnimap "nana"
! 		(nnimap-address "mail.server")
                  (nnimap-auth-method kerberos4))))
  @end lisp
  
***************
*** 743,759 ****
  @lisp
  (setq gnus-secondary-select-methods 
        '((nnimap "server1"
! 		(nnimap-server-address "localhost")
                  (nnimap-server-port 4711))
          (nnimap "server2"
! 		(nnimap-server-address "localhost")
                  (nnimap-server-port 4712))
          (nnimap "server3"
                  (nnimap-auth-method 'md5)
  		(nnimap-server-address "localhost")
                  (nnimap-server-port 4713))
          (nnimap "server4"
!                 (nnimap-server-address "localhost"))
                  (nnimap-server-port 4713)))
  @end lisp
  
--- 743,759 ----
  @lisp
  (setq gnus-secondary-select-methods 
        '((nnimap "server1"
! 		(nnimap-address "localhost")
                  (nnimap-server-port 4711))
          (nnimap "server2"
! 		(nnimap-address "localhost")
                  (nnimap-server-port 4712))
          (nnimap "server3"
                  (nnimap-auth-method 'md5)
  		(nnimap-server-address "localhost")
                  (nnimap-server-port 4713))
          (nnimap "server4"
!                 (nnimap-address "localhost"))
                  (nnimap-server-port 4713)))
  @end lisp