1 ;;; nnimap.el --- imap backend for Gnus
2 ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4 ;; Author: Simon Josefsson <jas@pdc.kth.se>
5 ;; Jim Radford <radford@robby.caltech.edu>
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 ;; Todo, major things:
29 ;; o Fix Gnus to view correct number of unread/total articles in group buffer
30 ;; o Fix Gnus to handle leading '.' in group names (fixed?)
31 ;; o Finish disconnected mode (moving articles between mailboxes unplugged)
33 ;; o MIME (partial article fetches)
34 ;; o Split to other backends, different split rules for different
37 ;; Todo, minor things:
39 ;; o Don't require half of Gnus -- backends should be standalone
40 ;; o Verify that we don't use IMAP4rev1 specific things (RFC2060 App B)
41 ;; o Dont uid fetch 1,* in nnimap-retrive-groups (slow)
42 ;; o Split up big fetches (1,* header especially) in smaller chunks
43 ;; o What do I do with gnus-newsgroup-*?
44 ;; o Tell Gnus about new groups (how can we tell?)
45 ;; o Respooling (fix Gnus?) (unnecessery?)
46 ;; o Add support for the following: (if applicable)
47 ;; request-list-newsgroups, request-regenerate
49 ;; request-associate-buffer, request-restore-buffer,
50 ;; o Do The Right Thing when UIDVALIDITY changes (what's the right thing?)
51 ;; o Support RFC2221 (Login referrals)
52 ;; o IMAP2BIS compatibility? (RFC2061)
53 ;; o ACAP stuff (perhaps a different project, would be nice to ACAPify
55 ;; o What about Gnus's article editing, can we support it? NO!
56 ;; o Use \Draft to support the draft group??
74 (defconst nnimap-version "nnimap 0.131")
76 (defvoo nnimap-address nil
77 "Address of physical IMAP server. If nil, use the virtual server's name.")
79 (defvoo nnimap-server-port nil
80 "Port number on physical IMAP server.
81 If nil, defaults to 993 for SSL connections and 143 otherwise.")
83 ;; Splitting variables
85 (defvar nnimap-split-crosspost t
86 "If non-nil, do crossposting if several split methods match the mail.
87 If nil, the first match found will be used.")
89 (defvar nnimap-split-inbox nil
90 "*Name of mailbox to split mail from.
92 Mail is read from this mailbox and split according to rules in
95 This can be a string or a list of strings.")
97 (defvar nnimap-split-rule nil
98 "*Mail will be split according to theese rules.
100 Mail is read from mailbox(es) specified in `nnimap-split-inbox'.
102 If you'd like, for instance, one mail group for mail from the
103 \"gnus-imap\" mailing list, one group for junk mail and leave
104 everything else in the incoming mailbox, you could do something like
107 (setq nnimap-split-rule '((\"INBOX.gnus-imap\" \"From:.*gnus-imap\")
108 (\"INBOX.junk\" \"Subject:.*buy\")))
110 As you can see, `nnimap-split-rule' is a list of lists, where the first
111 element in each \"rule\" is the name of the IMAP mailbox, and the
112 second is a regexp that nnimap will try to match on the header to find
115 The second element can also be a function. In that case, it will be
116 called narrowed to the headers with the first element of the rule as
117 the argument. It should return a non-nil value if it thinks that the
118 mail belongs in that group.
120 This variable can also have a function as its value, the function will
121 be called with the headers narrowed and should return a group where it
122 thinks the article should be splitted to. See `nnimap-split-fancy'.
124 To allow for different split rules on different virtual servers, and
125 even different split rules in different inboxes on the same server,
126 the syntax of this variable have been extended along the lines of:
128 (setq nnimap-split-rule
129 '((\"my1server\" (\".*\" ((\"ding\" \"ding@gnus.org\")
130 (\"junk\" \"From:.*Simon\")))
131 (\"my2server\" (\"INBOX\" nnimap-split-fancy))
132 (\"my[34]server\" (\".*\" ((\"private\" \"To:.*Simon\")
133 (\"junk\" my-junk-func)))))
135 The virtual server name is in fact a regexp, so that the same rules
136 may apply to several servers. In the example, the servers
137 \"my3server\" and \"my4server\" both use the same rules. Similarly,
138 the inbox string is also a regexp. The actual splitting rules are as
139 before, either a function, or a list with group/regexp or
140 group/function elements.")
142 (defvar nnimap-split-predicate "UNSEEN UNDELETED"
143 "The predicate used to find articles to split.
144 If you use another IMAP client to peek on articles but always would
145 like nnimap to split them once it's started, you could change this to
146 \"UNDELETED\". Other available predicates are available in
147 RFC2060 section 6.4.4.")
149 (defvar nnimap-split-fancy nil
150 "Like `nnmail-split-fancy', which see.")
152 ;; Authorization / Privacy variables
154 (defvoo nnimap-auth-method nil
157 (defvoo nnimap-stream nil
158 "How nnimap will connect to the server.
160 The default, nil, will try to use the \"best\" method the server can
165 1) you want to connect with SSL. The SSL integration with IMAP is
166 brain-dead so you'll have to tell it specifically.
168 2) your server is more capable than your environment -- i.e. your
169 server accept Kerberos login's but you haven't installed the
170 `imtest' program or your machine isn't configured for Kerberos.
172 Possible choices: kerberos4, ssl, network")
174 (defvoo nnimap-authenticator nil
175 "How nnimap authenticate itself to the server.
177 The default, nil, will try to use the \"best\" method the server can
180 There is only one reason for fiddling with this variable, and that is
181 if your server is more capable than your environment -- i.e. you
182 connect to a server that accept Kerberos login's but you haven't
183 installed the `imtest' program or your machine isn't configured for
186 Possible choices: kerberos4, cram-md5, login, anonymous.")
188 (defvoo nnimap-directory (nnheader-concat gnus-directory "overview/")
189 "Directory to keep NOV cache files for nnimap groups.
190 See also `nnimap-nov-file-name'.")
192 (defvoo nnimap-nov-file-name "nnimap."
193 "NOV cache base filename.
194 The group name and `nnimap-nov-file-name-suffix' will be appended. A
195 typical complete file name would be
196 ~/News/overview/nnimap.pdc.INBOX.ding.nov, or
197 ~/News/overview/nnimap/pdc/INBOX/ding/nov if
198 `nnmail-use-long-file-names' is nil")
200 (defvoo nnimap-nov-file-name-suffix ".novcache"
201 "Suffix for NOV cache base filename.")
203 (defvoo nnimap-nov-is-evil nil
204 "If non-nil, nnimap will never generate or use a local nov database for this backend.
205 Using nov databases will speed up header fetching considerably.
206 Unlike other backends, you do not need to take special care if you
207 flip this variable.")
209 (defvoo nnimap-expunge-on-close 'always ; 'ask, 'never
210 "Whether to expunge a group when it is closed.
211 When a IMAP group with articles marked for deletion is closed, this
212 variable determine if nnimap should actually remove the articles or
215 If always, nnimap always perform a expunge when closing the group.
216 If never, nnimap never expunges articles marked for deletion.
217 If ask, nnimap will ask you if you wish to expunge marked articles.
219 When setting this variable to `never', you can only expunge articles
220 by using `G x' (gnus-group-nnimap-expunge) from the Group buffer.")
222 (defvoo nnimap-list-pattern "*"
223 "A string LIMIT or list of strings with mailbox wildcards used to limit available groups.
224 See below for available wildcards.
226 The LIMIT string can be a cons cell (REFERENCE . LIMIT), where
227 REFERENCE will be passed as the first parameter to LIST/LSUB. The
228 semantics of this are server specific, on the University of Washington
229 server you can specify a directory.
232 '(\"INBOX\" \"mail/*\" (\"~friend/mail/\" . \"list/*\"))
234 There are two wildcards * and %. * matches everything, % matches
235 everything in the current hierarchy.")
237 (defvoo nnimap-news-groups nil
238 "IMAP support a news-like mode, also known as bulletin board mode, where replies is sent via IMAP instead of SMTP.
240 This variable should contain a regexp matching groups where you wish
241 replies to be stored to the mailbox directly.
244 '(\"^[^I][^N][^B][^O][^X].*$\")
246 This will match all groups not beginning with \"INBOX\".
248 Note that there is nothing technically different between mail-like and
249 news-like mailboxes. If you wish to have a group with todo items or
250 similar which you wouldn't want to set up a mailing list for, you can
251 use this to make replies go directly to the group.")
253 (defvoo nnimap-server-address nil
254 "Obsolete. Use `nnimap-address'.")
256 (defcustom nnimap-authinfo-file "~/.authinfo"
257 "Authorization information for IMAP servers. In .netrc format."
260 (repeat :tag "Entries"
263 :value ("" ("login" . "") ("password" . ""))
267 (const :format "" "login")
268 (string :format "Login: %v"))
270 (const :format "" "password")
271 (string :format "Password: %v")))))))
273 (defcustom nnimap-prune-cache t
274 "If non-nil, nnimap check whether articles still exist on server before using data stored in NOV cache."
277 (defvar nnimap-request-list-method 'imap-mailbox-list
278 "Method to use to request a list of all folders from the server.
279 If this is 'imap-mailbox-lsub, then use a server-side subscription list to
280 restrict visible folders.")
282 ;; Internal variables:
284 (defvar nnimap-debug nil);; "*nnimap-debug*")
285 (defvar nnimap-current-move-server nil)
286 (defvar nnimap-current-move-group nil)
287 (defvar nnimap-current-move-article nil)
288 (defvar nnimap-length)
289 (defvar nnimap-progress-chars '(?| ?/ ?- ?\\))
290 (defvar nnimap-progress-how-often 20)
291 (defvar nnimap-counter)
292 (defvar nnimap-callback-callback-function nil
293 "Gnus callback the nnimap asynchronous callback should call.")
294 (defvar nnimap-callback-buffer nil
295 "Which buffer the asynchronous article prefetch callback should work in.")
296 (defvar nnimap-server-buffer-alist nil) ;; Map server name to buffers.
297 (defvar nnimap-current-server nil) ;; Current server
298 (defvar nnimap-server-buffer nil) ;; Current servers' buffer
302 (nnoo-define-basics nnimap)
304 ;; Utility functions:
306 (defsubst nnimap-get-server-buffer (server)
307 "Return buffer for SERVER, if nil use current server."
308 (cadr (assoc (or server nnimap-current-server) nnimap-server-buffer-alist)))
310 (defun nnimap-possibly-change-server (server)
311 "Return buffer for SERVER, changing the current server as a side-effect.
312 If SERVER is nil, uses the current server."
313 (setq nnimap-current-server (or server nnimap-current-server)
314 nnimap-server-buffer (nnimap-get-server-buffer nnimap-current-server)))
316 (defun nnimap-verify-uidvalidity (group server)
317 "Verify stored uidvalidity match current one in GROUP on SERVER."
318 (let* ((gnusgroup (gnus-group-prefixed-name
319 group (gnus-server-to-method
320 (format "nnimap:%s" server))))
321 (new-uidvalidity (imap-mailbox-get 'uidvalidity))
322 (old-uidvalidity (gnus-group-get-parameter gnusgroup 'uidvalidity)))
324 (if (not (equal old-uidvalidity new-uidvalidity))
325 nil ;; uidvalidity clash
326 (gnus-group-set-parameter gnusgroup 'uidvalidity new-uidvalidity)
328 (gnus-group-add-parameter gnusgroup (cons 'uidvalidity new-uidvalidity))
331 (defun nnimap-find-minmax-uid (group &optional examine)
332 "Find lowest and highest active article nummber in GROUP.
333 If EXAMINE is non-nil the group is selected read-only."
334 (with-current-buffer nnimap-server-buffer
335 (when (imap-mailbox-select group examine)
337 (when (> (imap-mailbox-get 'exists) 0)
338 (imap-fetch "1,*" "UID" nil 'nouidfetch)
339 (imap-message-map (lambda (uid Uid)
340 (setq minuid (if minuid (min minuid uid) uid)
341 maxuid (if maxuid (max maxuid uid) uid)))
343 (list (imap-mailbox-get 'exists) minuid maxuid)))))
345 (defun nnimap-possibly-change-group (group &optional server)
346 "Make GROUP the current group, and SERVER the current server."
347 (when (nnimap-possibly-change-server server)
348 (with-current-buffer nnimap-server-buffer
349 (if (or (null group) (imap-current-mailbox-p group))
351 (if (imap-mailbox-select group)
352 (if (or (nnimap-verify-uidvalidity
353 group (or server nnimap-current-server))
354 (zerop (imap-mailbox-get 'exists group))
357 "nnimap: Group %s is not uidvalid. Continue? " group)))
359 (imap-mailbox-unselect)
360 (error "nnimap: Group %s is not uid-valid." group))
361 (nnheader-report 'nnimap (imap-error-text)))))))
363 (defun nnimap-replace-whitespace (string)
364 "Return STRING with all whitespace replaced with space."
366 (while (string-match "[\r\n\t]+" string)
367 (setq string (replace-match " " t t string)))
370 ;; Required backend functions
372 (defun nnimap-retrieve-headers-progress ()
373 "Hook to insert NOV line for current article into `nntp-server-buffer'."
374 (and (numberp nnmail-large-newsgroup)
375 (zerop (% (incf nnimap-counter) nnimap-progress-how-often))
376 (> nnimap-length nnmail-large-newsgroup)
377 (nnheader-message 6 "nnimap: Retrieving headers... %c"
378 (nth (/ (% nnimap-counter
379 (* (length nnimap-progress-chars)
380 nnimap-progress-how-often))
381 nnimap-progress-how-often)
382 nnimap-progress-chars)))
383 (with-current-buffer nntp-server-buffer
384 (let (headers lines chars uid mbx)
385 (with-current-buffer nnimap-server-buffer
386 (setq uid imap-current-message
387 mbx imap-current-mailbox
388 headers (if (imap-capability 'IMAP4rev1)
389 ;; xxx don't just use car? alist doesn't contain
390 ;; anything else now, but it might...
391 (nth 2 (car (imap-message-get uid 'BODYDETAIL)))
392 (imap-message-get uid 'RFC822.HEADER))
393 lines (imap-body-lines (imap-message-body imap-current-message))
394 chars (imap-message-get imap-current-message 'RFC822.SIZE)))
397 (buffer-disable-undo)
399 (nnheader-ms-strip-cr)
400 (nnheader-fold-continuation-lines)
401 (subst-char-in-region (point-min) (point-max) ?\t ? )
402 (let ((head (nnheader-parse-head 'naked)))
403 (mail-header-set-number head uid)
404 (mail-header-set-chars head chars)
405 (mail-header-set-lines head lines)
406 (mail-header-set-xref
407 head (format "%s %s:%d" (system-name) mbx uid))
410 (defun nnimap-retrieve-which-headers (articles fetch-old)
411 "Get a range of articles to fetch based on ARTICLES and FETCH-OLD."
412 (with-current-buffer nnimap-server-buffer
413 (if (numberp (car-safe articles))
416 (nnimap-range-to-string
417 (gnus-compress-sequence
418 (append (gnus-uncompress-sequence
420 (cons (if (numberp fetch-old)
421 (max 1 (- (car articles) fetch-old))
423 (1- (car articles)))))
425 (mapcar (lambda (msgid)
427 (format "HEADER Message-Id %s" msgid)))
430 (defun nnimap-group-overview-filename (group server)
431 "Make pathname for GROUP on SERVER."
432 (let ((dir (file-name-as-directory (expand-file-name nnimap-directory)))
433 (file (nnheader-translate-file-chars
434 (concat nnimap-nov-file-name
435 (if (equal server "")
437 server) "." group nnimap-nov-file-name-suffix) t)))
438 (if (or nnmail-use-long-file-names
439 (file-exists-p (concat dir file)))
441 (concat dir (mm-encode-coding-string
442 (nnheader-replace-chars-in-string file ?. ?/)
443 nnmail-pathname-coding-system)))))
445 (defun nnimap-retrieve-headers-from-file (group server)
446 (with-current-buffer nntp-server-buffer
447 (let ((nov (nnimap-group-overview-filename group server)))
448 (when (file-exists-p nov)
449 (mm-insert-file-contents nov)
450 (set-buffer-modified-p nil)
451 (let ((min (progn (goto-char (point-min))
453 (read (current-buffer)))))
454 (max (progn (goto-char (point-max))
457 (read (current-buffer))))))
458 (if (and (numberp min) (numberp max))
460 ;; junk, remove it, it's saved later
464 (defun nnimap-retrieve-headers-from-server (articles group server)
465 (with-current-buffer nnimap-server-buffer
466 (let ((imap-fetch-data-hook '(nnimap-retrieve-headers-progress))
467 (nnimap-length (gnus-range-length articles))
469 (imap-fetch (nnimap-range-to-string articles)
470 (concat "(UID RFC822.SIZE BODY "
472 (append '(Subject From Date Message-Id
473 References In-Reply-To Xref)
475 nnmail-extra-headers))))
476 (if (imap-capability 'IMAP4rev1)
477 (format "BODY.PEEK[HEADER.FIELDS %s])" headers)
478 (format "RFC822.HEADER.LINES %s)" headers)))))
479 (and (numberp nnmail-large-newsgroup)
480 (> nnimap-length nnmail-large-newsgroup)
481 (nnheader-message 6 "nnimap: Retrieving headers...done")))))
483 (defun nnimap-use-nov-p (group server)
484 (or gnus-nov-is-evil nnimap-nov-is-evil
485 (unless (and (gnus-make-directory
487 (nnimap-group-overview-filename group server)))
489 (nnimap-group-overview-filename group server)))
490 (message "nnimap: Nov cache not writable, %s"
491 (nnimap-group-overview-filename group server)))))
493 (deffoo nnimap-retrieve-headers (articles &optional group server fetch-old)
494 (when (nnimap-possibly-change-group group server)
495 (with-current-buffer nntp-server-buffer
497 (if (nnimap-use-nov-p group server)
498 (nnimap-retrieve-headers-from-server
499 (gnus-compress-sequence articles) group server)
500 (let (uids cached low high)
501 (when (setq uids (nnimap-retrieve-which-headers articles fetch-old)
503 high (car (last uids)))
504 (if (setq cached (nnimap-retrieve-headers-from-file group server))
506 ;; fetch articles with uids before cache block
507 (when (< low (car cached))
508 (goto-char (point-min))
509 (nnimap-retrieve-headers-from-server
510 (cons low (1- (car cached))) group server))
511 ;; fetch articles with uids after cache block
512 (when (> high (cdr cached))
513 (goto-char (point-max))
514 (nnimap-retrieve-headers-from-server
515 (cons (1+ (cdr cached)) high) group server))
516 (when nnimap-prune-cache
517 ;; remove nov's for articles which has expired on server
518 (goto-char (point-min))
519 (dolist (uid (gnus-set-difference articles uids))
520 (when (re-search-forward (format "^%d\t" uid) nil t)
521 (gnus-delete-line)))))
522 ;; nothing cached, fetch whole range from server
523 (nnimap-retrieve-headers-from-server
524 (cons low high) group server))
525 (when (buffer-modified-p)
527 1 (point-max) (nnimap-group-overview-filename group server)
529 (nnheader-nov-delete-outside-range low high))))
532 (defun nnimap-open-connection (server)
533 (if (not (imap-open nnimap-address nnimap-server-port nnimap-stream
534 nnimap-authenticator nnimap-server-buffer))
535 (nnheader-report 'nnimap "Can't open connection to server %s" server)
536 (unless (or (imap-capability 'IMAP4 nnimap-server-buffer)
537 (imap-capability 'IMAP4rev1 nnimap-server-buffer))
538 (imap-close nnimap-server-buffer)
539 (nnheader-report 'nnimap "Server %s is not IMAP4 compliant" server))
540 (let* ((list (gnus-parse-netrc nnimap-authinfo-file))
541 (port (if nnimap-server-port
542 (int-to-string nnimap-server-port)
544 (alist (gnus-netrc-machine list (or nnimap-server-address
545 nnimap-address server)
547 (user (gnus-netrc-get alist "login"))
548 (passwd (gnus-netrc-get alist "password")))
549 (if (imap-authenticate user passwd nnimap-server-buffer)
551 (push (list server nnimap-server-buffer)
552 nnimap-server-buffer-alist)
553 (nnimap-possibly-change-server server))
554 (imap-close nnimap-server-buffer)
555 (kill-buffer nnimap-server-buffer)
556 (nnheader-report 'nnimap "Could not authenticate to %s" server)))))
558 (deffoo nnimap-open-server (server &optional defs)
559 (nnheader-init-server-buffer)
560 (if (nnimap-server-opened server)
562 (unless (assq 'nnimap-server-buffer defs)
563 (push (list 'nnimap-server-buffer (concat " *nnimap* " server)) defs))
564 ;; translate `nnimap-server-address' to `nnimap-address' in defs
565 ;; for people that configured nnimap with a very old version
566 (unless (assq 'nnimap-address defs)
567 (if (assq 'nnimap-server-address defs)
568 (push (list 'nnimap-address
569 (cadr (assq 'nnimap-server-address defs))) defs)
570 (push (list 'nnimap-address server) defs)))
571 (nnoo-change-server 'nnimap server defs)
572 (or (and nnimap-server-buffer
573 (imap-opened nnimap-server-buffer))
574 (nnimap-open-connection server))))
576 (deffoo nnimap-server-opened (&optional server)
577 "Whether SERVER is opened.
578 If SERVER is the current virtual server, and the connection to the
579 physical server is alive, this function return a non-nil value. If
580 SERVER is nil, it is treated as the current server."
581 ;; clean up autologouts??
582 (and (or server nnimap-current-server)
583 (nnoo-server-opened 'nnimap (or server nnimap-current-server))
584 (imap-opened (nnimap-get-server-buffer server))))
586 (deffoo nnimap-close-server (&optional server)
587 "Close connection to server and free all resources connected to it.
588 Return nil if the server couldn't be closed for some reason."
589 (let ((server (or server nnimap-current-server)))
590 (when (or (nnimap-server-opened server)
591 (imap-opened (nnimap-get-server-buffer server)))
592 (imap-close (nnimap-get-server-buffer server))
593 (kill-buffer (nnimap-get-server-buffer server))
594 (setq nnimap-server-buffer nil
595 nnimap-current-server nil
596 nnimap-server-buffer-alist
597 (delq server nnimap-server-buffer-alist)))
598 (nnoo-close-server 'nnimap server)))
600 (deffoo nnimap-request-close ()
601 "Close connection to all servers and free all resources that the backend have reserved.
602 All buffers that have been created by that
603 backend should be killed. (Not the nntp-server-buffer, though.) This
604 function is generally only called when Gnus is shutting down."
605 (mapcar (lambda (server) (nnimap-close-server (car server)))
606 nnimap-server-buffer-alist)
607 (setq nnimap-server-buffer-alist nil))
609 (deffoo nnimap-status-message (&optional server)
610 "This function returns the last error message from server."
611 (when (nnimap-possibly-change-server server)
612 (nnoo-status-message 'nnimap server)))
614 (defun nnimap-demule (string)
615 (funcall (if (and (fboundp 'string-as-multibyte)
616 (subrp (symbol-function 'string-as-multibyte)))
621 (defun nnimap-callback ()
622 (remove-hook 'imap-fetch-data-hook 'nnimap-callback)
623 (with-current-buffer nnimap-callback-buffer
625 (with-current-buffer nnimap-server-buffer
627 (if (imap-capability 'IMAP4rev1)
628 ;; xxx don't just use car? alist doesn't contain
629 ;; anything else now, but it might...
630 (nth 2 (car (imap-message-get (imap-current-message) 'BODYDETAIL)))
631 (imap-message-get (imap-current-message) 'RFC822)))))
632 (nnheader-ms-strip-cr)
633 (funcall nnimap-callback-callback-function t)))
635 (defun nnimap-request-article-part (article part prop &optional
636 group server to-buffer detail)
637 (when (nnimap-possibly-change-group group server)
638 (let ((article (if (stringp article)
639 (car-safe (imap-search
640 (format "HEADER Message-Id %s" article)
641 nnimap-server-buffer))
644 (gnus-message 9 "nnimap: Fetching (part of) article %d..." article)
645 (if (not nnheader-callback-function)
646 (with-current-buffer (or to-buffer nntp-server-buffer)
648 (let ((data (imap-fetch article part prop nil
649 nnimap-server-buffer)))
650 (insert (nnimap-demule (if detail
653 (nnheader-ms-strip-cr)
654 (gnus-message 9 "nnimap: Fetching (part of) article %d...done"
657 (nnheader-report 'nnimap "No such article: %s"
658 (imap-error-text nnimap-server-buffer))
659 (cons group article)))
660 (add-hook 'imap-fetch-data-hook 'nnimap-callback)
661 (setq nnimap-callback-callback-function nnheader-callback-function
662 nnimap-callback-buffer nntp-server-buffer)
663 (imap-fetch-asynch article part nil nnimap-server-buffer)
664 (cons group article))))))
666 (deffoo nnimap-asynchronous-p ()
669 (deffoo nnimap-request-article (article &optional group server to-buffer)
670 (if (imap-capability 'IMAP4rev1 nnimap-server-buffer)
671 (nnimap-request-article-part
672 article "BODY.PEEK[]" 'BODYDETAIL group server to-buffer 'detail)
673 (nnimap-request-article-part
674 article "RFC822.PEEK" 'RFC822 group server to-buffer)))
676 (deffoo nnimap-request-head (article &optional group server to-buffer)
677 (if (imap-capability 'IMAP4rev1 nnimap-server-buffer)
678 (nnimap-request-article-part
679 article "BODY.PEEK[HEADER]" 'BODYDETAIL group server to-buffer 'detail)
680 (nnimap-request-article-part
681 article "RFC822.HEADER" 'RFC822.HEADER group server to-buffer)))
683 (deffoo nnimap-request-body (article &optional group server to-buffer)
684 (if (imap-capability 'IMAP4rev1 nnimap-server-buffer)
685 (nnimap-request-article-part
686 article "BODY.PEEK[TEXT]" 'BODYDETAIL group server to-buffer 'detail)
687 (nnimap-request-article-part
688 article "RFC822.TEXT.PEEK" 'RFC822.TEXT group server to-buffer)))
690 (deffoo nnimap-request-group (group &optional server fast)
691 (nnimap-request-update-info-internal
693 (gnus-get-info (gnus-group-prefixed-name
694 group (gnus-server-to-method (format "nnimap:%s" server))))
696 (when (nnimap-possibly-change-group group server)
699 ((null (setq info (nnimap-find-minmax-uid group t)))
700 (nnheader-report 'nnimap "Could not get active info for %s"
703 (nnheader-insert "211 %d %d %d %s\n" (or (nth 0 info) 0)
704 (max 1 (or (nth 1 info) 1))
705 (or (nth 2 info) 0) group)
706 (nnheader-report 'nnimap "Group %s selected" group)
709 (defun nnimap-close-group (group &optional server)
710 (with-current-buffer nnimap-server-buffer
711 (when (and (imap-opened)
712 (nnimap-possibly-change-group group server))
713 (case nnimap-expunge-on-close
714 ('always (imap-mailbox-expunge)
715 (imap-mailbox-close))
716 ('ask (if (and (imap-search "DELETED")
717 (gnus-y-or-n-p (format
718 "Expunge articles in group `%s'? "
719 imap-current-mailbox)))
720 (progn (imap-mailbox-expunge)
721 (imap-mailbox-close))
722 (imap-mailbox-unselect)))
723 (t (imap-mailbox-unselect)))
724 (not imap-current-mailbox))))
726 (defun nnimap-pattern-to-list-arguments (pattern)
728 (cons (car-safe p) (or (cdr-safe p) p)))
729 (if (and (listp pattern)
730 (listp (cdr pattern)))
734 (deffoo nnimap-request-list (&optional server)
735 (when (nnimap-possibly-change-server server)
736 (with-current-buffer nntp-server-buffer
738 (gnus-message 5 "nnimap: Generating active list%s..."
739 (if (> (length server) 0) (concat " for " server) ""))
740 (with-current-buffer nnimap-server-buffer
741 (dolist (pattern (nnimap-pattern-to-list-arguments nnimap-list-pattern))
742 (dolist (mbx (funcall nnimap-request-list-method
743 (cdr pattern) (car pattern)))
744 (or (member "\\NoSelect" (imap-mailbox-get 'list-flags mbx))
745 (let ((info (nnimap-find-minmax-uid mbx 'examine)))
747 (with-current-buffer nntp-server-buffer
748 (insert (format "\"%s\" %d %d y\n"
749 mbx (or (nth 2 info) 0)
750 (max 1 (or (nth 1 info) 1)))))))))))
751 (gnus-message 5 "nnimap: Generating active list%s...done"
752 (if (> (length server) 0) (concat " for " server) ""))
755 (deffoo nnimap-request-post (&optional server)
757 (dolist (mbx (message-unquote-tokens
758 (message-tokenize-header
759 (message-fetch-field "Newsgroups") ", ")) success)
760 (let ((to-newsgroup (gnus-group-prefixed-name mbx gnus-command-method)))
761 (or (gnus-active to-newsgroup)
762 (gnus-activate-group to-newsgroup)
763 (if (gnus-y-or-n-p (format "No such group: %s. Create it? "
765 (or (and (gnus-request-create-group
766 to-newsgroup gnus-command-method)
767 (gnus-activate-group to-newsgroup nil nil
768 gnus-command-method))
769 (error "Couldn't create group %s" to-newsgroup)))
770 (error "No such group: %s" to-newsgroup))
771 (unless (nnimap-request-accept-article mbx (nth 1 gnus-command-method))
772 (setq success nil))))))
774 ;; Optional backend functions
776 (deffoo nnimap-retrieve-groups (groups &optional server)
777 (when (nnimap-possibly-change-server server)
778 (gnus-message 5 "nnimap: Checking mailboxes...")
779 (with-current-buffer nntp-server-buffer
781 (dolist (group groups)
782 (gnus-message 7 "nnimap: Checking mailbox %s" group)
783 (or (member "\\NoSelect"
784 (imap-mailbox-get 'list-flags group nnimap-server-buffer))
785 (let ((info (nnimap-find-minmax-uid group 'examine)))
786 (insert (format "\"%s\" %d %d y\n" group
788 (max 1 (or (nth 1 info) 1))))))))
789 (gnus-message 5 "nnimap: Checking mailboxes...done")
792 (deffoo nnimap-request-update-info-internal (group info &optional server)
793 (when (nnimap-possibly-change-group group server)
794 (when info;; xxx what does this mean? should we create a info?
795 (with-current-buffer nnimap-server-buffer
796 (gnus-message 5 "nnimap: Updating info for %s..."
797 (gnus-info-group info))
799 (when (nnimap-mark-permanent-p 'read)
801 ;; read info could contain articles marked unread by other
802 ;; imap clients! we correct this
803 (setq seen (gnus-uncompress-range (gnus-info-read info))
804 unseen (imap-search "UNSEEN UNDELETED")
805 seen (gnus-set-difference seen unseen)
806 ;; seen might lack articles marked as read by other
807 ;; imap clients! we correct this
808 seen (append seen (imap-search "SEEN"))
811 seen (gnus-compress-sequence seen t)
812 ;; we can't return '(1) since this isn't a "list of ranges",
813 ;; and we can't return '((1)) since g-list-of-unread-articles
814 ;; is buggy so we return '((1 . 1)).
815 seen (if (and (integerp (car seen))
817 (list (cons (car seen) (car seen)))
819 (gnus-info-set-read info seen)))
821 (mapcar (lambda (pred)
822 (when (and (nnimap-mark-permanent-p (cdr pred))
823 (member (nnimap-mark-to-flag (cdr pred))
824 (imap-mailbox-get 'flags)))
827 (nnimap-update-alist-soft
829 (gnus-compress-sequence
830 (imap-search (nnimap-mark-to-predicate (cdr pred))))
831 (gnus-info-marks info))
833 gnus-article-mark-lists)
835 (gnus-message 5 "nnimap: Updating info for %s...done"
836 (gnus-info-group info))
840 (deffoo nnimap-request-type (group &optional article)
841 (if (and nnimap-news-groups (string-match nnimap-news-groups group))
845 (deffoo nnimap-request-set-mark (group actions &optional server)
846 (when (nnimap-possibly-change-group group server)
847 (with-current-buffer nnimap-server-buffer
849 (gnus-message 7 "nnimap: Setting marks in %s..." group)
850 (while (setq action (pop actions))
851 (let ((range (nth 0 action))
852 (what (nth 1 action))
853 (cmdmarks (nth 2 action))
855 ;; cache flags are pointless on the server
856 (setq cmdmarks (delq 'cache cmdmarks))
857 ;; flag dormant articles as ticked
858 (if (memq 'dormant cmdmarks)
859 (setq cmdmarks (cons 'tick cmdmarks)))
860 ;; remove stuff we are forbidden to store
861 (mapcar (lambda (mark)
862 (if (imap-message-flag-permanent-p
863 (nnimap-mark-to-flag mark))
864 (setq marks (cons mark marks))))
866 (when (and range marks)
867 (cond ((eq what 'del)
868 (imap-message-flags-del
869 (nnimap-range-to-string range)
870 (nnimap-mark-to-flag marks nil t)))
872 (imap-message-flags-add
873 (nnimap-range-to-string range)
874 (nnimap-mark-to-flag marks nil t)))
876 (imap-message-flags-set
877 (nnimap-range-to-string range)
878 (nnimap-mark-to-flag marks nil t)))))))
879 (gnus-message 7 "nnimap: Setting marks in %s...done" group))))
882 (defun nnimap-split-fancy ()
883 "Like nnmail-split-fancy, but uses nnimap-split-fancy."
884 (let ((nnmail-split-fancy nnimap-split-fancy))
885 (nnmail-split-fancy)))
887 (defun nnimap-split-to-groups (rules)
888 ;; tries to match all rules in nnimap-split-rule against content of
889 ;; nntp-server-buffer, returns a list of groups that matched.
890 (with-current-buffer nntp-server-buffer
891 ;; Fold continuation lines.
892 (goto-char (point-min))
893 (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
894 (replace-match " " t t))
895 (if (functionp rules)
897 (let (to-groups regrepp)
899 (dolist (rule rules to-groups)
900 (let ((group (car rule))
901 (regexp (cadr rule)))
902 (goto-char (point-min))
903 (when (and (if (stringp regexp)
905 (setq regrepp (string-match "\\\\[0-9&]" group))
906 (re-search-forward regexp nil t))
907 (funcall regexp group))
908 ;; Don't enter the article into the same group twice.
909 (not (assoc group to-groups)))
911 (nnmail-expand-newtext group)
914 (or nnimap-split-crosspost
915 (throw 'split-done to-groups))))))))))
917 (defun nnimap-assoc-match (key alist)
919 (while (and alist (not element))
920 (if (string-match (car (car alist)) key)
921 (setq element (car alist)))
922 (setq alist (cdr alist)))
925 (defun nnimap-split-find-rule (server inbox)
926 (if (and (listp nnimap-split-rule) (listp (car nnimap-split-rule))
927 (list (cdar nnimap-split-rule)) (listp (cadar nnimap-split-rule)))
929 (cadr (nnimap-assoc-match inbox (cdr (nnimap-assoc-match
930 server nnimap-split-rule))))
933 (defun nnimap-split-find-inbox (server)
934 (if (listp nnimap-split-inbox)
936 (list nnimap-split-inbox)))
938 (defun nnimap-split-articles (&optional group server)
939 (when (nnimap-possibly-change-server server)
940 (with-current-buffer nnimap-server-buffer
941 (let (rule inbox removeorig (inboxes (nnimap-split-find-inbox server)))
942 ;; iterate over inboxes
943 (while (and (setq inbox (pop inboxes))
944 (nnimap-possibly-change-group inbox));; SELECT
945 ;; find split rule for this server / inbox
946 (when (setq rule (nnimap-split-find-rule server inbox))
947 ;; iterate over articles
948 (dolist (article (imap-search nnimap-split-predicate))
949 (when (nnimap-request-head article)
950 ;; copy article to right group(s)
951 (setq removeorig nil)
952 (dolist (to-group (nnimap-split-to-groups rule))
953 (if (imap-message-copy (number-to-string article)
954 to-group nil 'nocopyuid)
956 (message "IMAP split moved %s:%s:%d to %s" server inbox
959 ;; Add the group-art list to the history list.
960 (push (list (cons to-group 0)) nnmail-split-history))
961 (message "IMAP split failed to move %s:%s:%d to %s" server
962 inbox article to-group)))
963 ;; remove article if it was successfully copied somewhere
965 (imap-message-flags-add (format "%d" article)
966 "\\Seen \\Deleted")))))
967 (when (imap-mailbox-select inbox);; just in case
968 ;; todo: UID EXPUNGE (if available) to remove splitted articles
969 (imap-mailbox-expunge)
970 (imap-mailbox-close)))
973 (deffoo nnimap-request-scan (&optional group server)
974 (nnimap-split-articles group server))
976 (deffoo nnimap-request-newgroups (date &optional server)
977 (when (nnimap-possibly-change-server server)
978 (with-current-buffer nntp-server-buffer
979 (gnus-message 5 "nnimap: Listing subscribed mailboxes%s%s..."
980 (if (> (length server) 0) " on " "") server)
982 (dolist (pattern (nnimap-pattern-to-list-arguments
983 nnimap-list-pattern))
984 (dolist (mbx (imap-mailbox-lsub "*" (car pattern) nil
985 nnimap-server-buffer))
986 (or (member-if (lambda (mailbox)
987 (string= (downcase mailbox) "\\noselect"))
988 (imap-mailbox-get 'list-flags mbx
989 nnimap-server-buffer))
990 (let ((info (nnimap-find-minmax-uid mbx 'examine)))
992 (insert (format "\"%s\" %d %d y\n"
993 mbx (or (nth 2 info) 0)
994 (max 1 (or (nth 1 info) 1)))))))))
995 (gnus-message 5 "nnimap: Listing subscribed mailboxes%s%s...done"
996 (if (> (length server) 0) " on " "") server))
999 (deffoo nnimap-request-create-group (group &optional server args)
1000 (when (nnimap-possibly-change-server server)
1001 (or (imap-mailbox-status group 'uidvalidity nnimap-server-buffer)
1002 (imap-mailbox-create group nnimap-server-buffer))))
1004 (defun nnimap-time-substract (time1 time2)
1005 "Return TIME for TIME1 - TIME2."
1006 (let* ((ms (- (car time1) (car time2)))
1007 (ls (- (nth 1 time1) (nth 1 time2))))
1009 (list (- ms 1) (+ (expt 2 16) ls))
1012 (defun nnimap-date-days-ago (daysago)
1013 "Return date, in format \"3-Aug-1998\", for DAYSAGO days ago."
1014 (let ((date (format-time-string "%d-%b-%Y"
1015 (nnimap-time-substract
1017 (days-to-time daysago)))))
1018 (if (eq ?0 (string-to-char date))
1022 (defun nnimap-request-expire-articles-progress ()
1023 (gnus-message 5 "nnimap: Marking article %d for deletion..."
1024 imap-current-message))
1026 ;; Notice that we don't actually delete anything, we just mark them deleted.
1027 (deffoo nnimap-request-expire-articles (articles group &optional server force)
1028 (let ((artseq (gnus-compress-sequence articles)))
1029 (when (and artseq (nnimap-possibly-change-group group server))
1030 (with-current-buffer nnimap-server-buffer
1032 (and (imap-message-flags-add
1033 (nnimap-range-to-string artseq) "\\Deleted")
1034 (setq articles nil))
1035 (let ((days (or (and nnmail-expiry-wait-function
1036 (funcall nnmail-expiry-wait-function group))
1037 nnmail-expiry-wait)))
1038 (cond ((eq days 'immediate)
1039 (and (imap-message-flags-add
1040 (nnimap-range-to-string artseq) "\\Deleted")
1041 (setq articles nil)))
1043 (let ((oldarts (imap-search
1044 (format "UID %s NOT SINCE %s"
1045 (nnimap-range-to-string artseq)
1046 (nnimap-date-days-ago days))))
1047 (imap-fetch-data-hook
1048 '(nnimap-request-expire-articles-progress)))
1050 (imap-message-flags-add
1051 (nnimap-range-to-string
1052 (gnus-compress-sequence oldarts))
1054 (setq articles (gnus-set-difference
1055 articles oldarts)))))))))))
1056 ;; return articles not deleted
1059 (deffoo nnimap-request-move-article (article group server
1060 accept-form &optional last)
1061 (when (nnimap-possibly-change-server server)
1063 (let ((buf (get-buffer-create " *nnimap move*"))
1064 (nnimap-current-move-article article)
1065 (nnimap-current-move-group group)
1066 (nnimap-current-move-server nnimap-current-server)
1068 (and (nnimap-request-article article group server)
1071 (buffer-disable-undo (current-buffer))
1072 (insert-buffer-substring nntp-server-buffer)
1073 (setq result (eval accept-form))
1076 (nnimap-request-expire-articles (list article) group server t))
1079 (deffoo nnimap-request-accept-article (group &optional server last)
1080 (when (nnimap-possibly-change-server server)
1083 (if (string= nnimap-current-server nnimap-current-move-server)
1084 ;; moving article within same server, speed it up...
1085 (and (nnimap-possibly-change-group
1086 nnimap-current-move-group)
1087 (imap-message-copy (number-to-string
1088 nnimap-current-move-article)
1089 group 'dontcreate nil
1090 nnimap-server-buffer))
1091 ;; turn into rfc822 format (\r\n eol's)
1092 (with-current-buffer (current-buffer)
1093 (goto-char (point-min))
1094 (while (search-forward "\n" nil t)
1095 (replace-match "\r\n")))
1096 ;; this 'or' is for Cyrus server bug
1097 (or (null (imap-current-mailbox nnimap-server-buffer))
1098 (imap-mailbox-unselect nnimap-server-buffer))
1099 (imap-message-append group (current-buffer) nil nil
1100 nnimap-server-buffer)))
1101 (cons group (nth 1 uid))
1102 (nnheader-report 'nnimap (imap-error-text nnimap-server-buffer))))))
1104 (deffoo nnimap-request-delete-group (group force &optional server)
1105 (when (nnimap-possibly-change-server server)
1106 (with-current-buffer nnimap-server-buffer
1108 (or (null (imap-mailbox-status group 'uidvalidity))
1109 (imap-mailbox-delete group))
1113 (deffoo nnimap-request-rename-group (group new-name &optional server)
1114 (when (nnimap-possibly-change-server server)
1115 (imap-mailbox-rename group new-name nnimap-server-buffer)))
1117 (defun nnimap-expunge (mailbox server)
1118 (when (nnimap-possibly-change-group mailbox server)
1119 (imap-mailbox-expunge nnimap-server-buffer)))
1121 (defun nnimap-acl-get (mailbox server)
1122 (when (nnimap-possibly-change-server server)
1123 (imap-mailbox-acl-get mailbox nnimap-server-buffer)))
1125 (defun nnimap-acl-edit (mailbox method old-acls new-acls)
1126 (when (nnimap-possibly-change-server (cadr method))
1127 (unless (imap-capability 'ACL nnimap-server-buffer)
1128 (error "Your server does not support ACL editing"))
1129 (with-current-buffer nnimap-server-buffer
1130 ;; delete all removed identifiers
1131 (mapcar (lambda (old-acl)
1132 (unless (assoc (car old-acl) new-acls)
1133 (or (imap-mailbox-acl-delete (car old-acl) mailbox)
1134 (error "Can't delete ACL for %s" (car old-acl)))))
1136 ;; set all changed acl's
1137 (mapcar (lambda (new-acl)
1138 (let ((new-rights (cdr new-acl))
1139 (old-rights (cdr (assoc (car new-acl) old-acls))))
1140 (unless (and old-rights new-rights
1141 (string= old-rights new-rights))
1142 (or (imap-mailbox-acl-set (car new-acl) new-rights mailbox)
1143 (error "Can't set ACL for %s to %s" (car new-acl)
1149 ;;; Internal functions
1152 ;; This is confusing.
1154 ;; mark => read, tick, draft, reply etc
1155 ;; flag => "\\Seen", "\\Flagged", "\\Draft", "gnus-expire" etc
1156 ;; predicate => "SEEN", "FLAGGED", "DRAFT", "KEYWORD gnus-expire" etc
1158 ;; Mark should not really contain 'read since it's not a "mark" in the Gnus
1159 ;; world, but we cheat. Mark == gnus-article-mark-lists + '(read . read).
1162 (defconst nnimap-mark-to-predicate-alist
1164 (lambda (pair) ; cdr is the mark
1165 (or (assoc (cdr pair)
1169 (reply . "ANSWERED")))
1171 (format "KEYWORD gnus-%s" (symbol-name (cdr pair))))))
1172 (cons '(read . read) gnus-article-mark-lists)))
1174 (defun nnimap-mark-to-predicate (pred)
1175 "Convert a Gnus mark (a symbol such as read, tick, expire) to a IMAP predicate.
1176 This is a string such as \"SEEN\", \"FLAGGED\", \"KEYWORD gnus-expire\",
1177 to be used within a IMAP SEARCH query."
1178 (cdr (assq pred nnimap-mark-to-predicate-alist)))
1180 (defconst nnimap-mark-to-flag-alist
1183 (or (assoc (cdr pair)
1185 (tick . "\\Flagged")
1187 (reply . "\\Answered")))
1189 (format "gnus-%s" (symbol-name (cdr pair))))))
1190 (cons '(read . read) gnus-article-mark-lists)))
1192 (defun nnimap-mark-to-flag-1 (preds)
1193 (if (and (not (null preds)) (listp preds))
1194 (cons (nnimap-mark-to-flag (car preds))
1195 (nnimap-mark-to-flag (cdr preds)))
1196 (cdr (assoc preds nnimap-mark-to-flag-alist))))
1198 (defun nnimap-mark-to-flag (preds &optional always-list make-string)
1199 "Convert a Gnus mark (a symbol such as read, tick, expire) to a IMAP flag.
1200 This is a string such as \"\\Seen\", \"\\Flagged\", \"gnus-expire\", to
1201 be used in a STORE FLAGS command."
1202 (let ((result (nnimap-mark-to-flag-1 preds)))
1203 (setq result (if (and (or make-string always-list)
1204 (not (listp result)))
1208 (mapconcat (lambda (flag)
1210 (mapconcat 'identity flag " ")
1215 (defun nnimap-mark-permanent-p (mark &optional group)
1216 "Return t iff MARK can be permanently (between IMAP sessions) saved on articles, in GROUP."
1217 (imap-message-flag-permanent-p (nnimap-mark-to-flag mark)))
1219 (defun nnimap-remassoc (key alist)
1220 "Delete by side effect any elements of LIST whose car is `equal' to KEY.
1221 The modified LIST is returned. If the first member
1222 of LIST has a car that is `equal' to KEY, there is no way to remove it
1223 by side effect; therefore, write `(setq foo (remassoc key foo))' to be
1224 sure of changing the value of `foo'."
1226 (if (equal key (caar alist))
1228 (setcdr alist (nnimap-remassoc key (cdr alist)))
1231 (defun nnimap-update-alist-soft (key value alist)
1233 (cons (cons key value) (nnimap-remassoc key alist))
1234 (nnimap-remassoc key alist)))
1236 (defun nnimap-range-to-string (range)
1241 (car item) (cdr item))
1242 (format "%d" item)))
1243 (if (and (listp range) (not (listp (cdr range))))
1244 (list range);; make (1 . 2) into ((1 . 2))
1250 (buffer-disable-undo (get-buffer-create nnimap-debug))
1251 (mapcar (lambda (f) (trace-function-background f nnimap-debug))
1253 nnimap-possibly-change-server
1254 nnimap-verify-uidvalidity
1255 nnimap-find-minmax-uid
1256 nnimap-possibly-change-group
1257 ;;nnimap-replace-whitespace
1258 nnimap-retrieve-headers-progress
1259 nnimap-retrieve-which-headers
1260 nnimap-group-overview-filename
1261 nnimap-retrieve-headers-from-file
1262 nnimap-retrieve-headers-from-server
1263 nnimap-retrieve-headers
1264 nnimap-open-connection
1266 nnimap-server-opened
1268 nnimap-request-close
1269 nnimap-status-message
1271 nnimap-request-article-part
1272 nnimap-request-article
1275 nnimap-request-group
1277 nnimap-pattern-to-list-arguments
1280 nnimap-retrieve-groups
1281 nnimap-request-update-info-internal
1283 nnimap-request-set-mark
1284 nnimap-split-to-groups
1285 nnimap-split-find-rule
1286 nnimap-split-find-inbox
1287 nnimap-split-articles
1289 nnimap-request-newgroups
1290 nnimap-request-create-group
1291 nnimap-time-substract
1292 nnimap-date-days-ago
1293 nnimap-request-expire-articles-progress
1294 nnimap-request-expire-articles
1295 nnimap-request-move-article
1296 nnimap-request-accept-article
1297 nnimap-request-delete-group
1298 nnimap-request-rename-group
1299 gnus-group-nnimap-expunge
1300 gnus-group-nnimap-edit-acl
1301 gnus-group-nnimap-edit-acl-done
1302 nnimap-group-mode-hook
1303 nnimap-mark-to-predicate
1304 nnimap-mark-to-flag-1
1306 nnimap-mark-permanent-p
1308 nnimap-update-alist-soft
1309 nnimap-range-to-string
1314 ;;; nnimap.el ends here