1 ;;; elmo-pop3.el -- POP3 Interface for ELMO.
3 ;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
4 ;; Copyright (C) 1999,2000 Kenichi OKADA <okada@opaopa.org>
6 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
7 ;; Kenichi OKADA <okada@opaopa.org>
8 ;; Keywords: mail, net news
10 ;; This file is part of ELMO (Elisp Library for Message Orchestration).
12 ;; This program is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; This program is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
41 (autoload 'md5 "md5"))
43 (defvar elmo-pop3-exists-exactly t)
44 (defvar sasl-mechanism-alist)
46 (defvar elmo-pop3-total-size nil)
48 (luna-define-class elmo-pop3-session (elmo-network-session))
51 (defvar elmo-pop3-read-point nil)
52 (defvar elmo-pop3-number-uidl-hash nil) ; number -> uidl
53 (defvar elmo-pop3-uidl-number-hash nil) ; uidl -> number
54 (defvar elmo-pop3-size-hash nil) ; number -> size
55 (defvar elmo-pop3-uidl-done nil)
56 (defvar elmo-pop3-list-done nil)
58 (defvar elmo-pop3-local-variables '(elmo-pop3-read-point
59 elmo-pop3-uidl-number-hash
60 elmo-pop3-number-uidl-hash
65 (luna-define-method elmo-network-close-session ((session elmo-pop3-session))
66 (when (elmo-network-session-process-internal session)
67 (when (memq (process-status
68 (elmo-network-session-process-internal session))
70 (elmo-pop3-send-command (elmo-network-session-process-internal session)
72 (or (elmo-pop3-read-response
73 (elmo-network-session-process-internal session) t)
74 (error "POP error: QUIT failed")))
75 (kill-buffer (process-buffer
76 (elmo-network-session-process-internal session)))
77 (delete-process (elmo-network-session-process-internal session))))
79 (defun elmo-pop3-get-session (spec &optional if-exists)
80 (elmo-network-get-session
83 (elmo-pop3-spec-hostname spec)
84 (elmo-pop3-spec-port spec)
85 (elmo-pop3-spec-username spec)
86 (elmo-pop3-spec-auth spec)
87 (elmo-pop3-spec-stream-type spec)
90 (defun elmo-pop3-send-command (process command &optional no-erase)
91 (with-current-buffer (process-buffer process)
94 (goto-char (point-min))
95 (setq elmo-pop3-read-point (point))
96 (process-send-string process command)
97 (process-send-string process "\r\n")))
99 (defun elmo-pop3-read-response (process &optional not-command)
100 (with-current-buffer (process-buffer process)
101 (let ((case-fold-search nil)
102 (response-string nil)
103 (response-continue t)
106 (while response-continue
107 (goto-char elmo-pop3-read-point)
108 (while (not (re-search-forward "\r?\n" nil t))
109 (accept-process-output process)
110 (goto-char elmo-pop3-read-point))
111 (setq match-end (point))
112 (setq response-string
113 (buffer-substring elmo-pop3-read-point (- match-end 2)))
114 (goto-char elmo-pop3-read-point)
115 (if (looking-at "\\+.*$")
117 (setq response-continue nil)
118 (setq elmo-pop3-read-point match-end)
121 (concat return-value "\n" response-string)
123 (if (looking-at "\\-.*$")
125 (setq response-continue nil)
126 (setq elmo-pop3-read-point match-end)
127 (setq return-value nil))
128 (setq elmo-pop3-read-point match-end)
130 (setq response-continue nil))
133 (concat return-value "\n" response-string)
135 (setq elmo-pop3-read-point match-end)))
138 (defun elmo-pop3-process-filter (process output)
140 (set-buffer (process-buffer process))
141 (goto-char (point-max))
143 (if elmo-pop3-total-size
144 (message "Retrieving...(%d/%d bytes)."
145 (buffer-size) elmo-pop3-total-size))))
147 (defun elmo-pop3-auth-user (session)
148 (let ((process (elmo-network-session-process-internal session)))
150 (elmo-pop3-send-command
152 (format "user %s" (elmo-network-session-user-internal session)))
153 (or (elmo-pop3-read-response process t)
154 (signal 'elmo-authenticate-error
155 '(elmo-pop-auth-user)))
156 (elmo-pop3-send-command process
160 (elmo-network-session-password-key session))))
161 (or (elmo-pop3-read-response process t)
162 (signal 'elmo-authenticate-error
163 '(elmo-pop-auth-user)))))
165 (defun elmo-pop3-auth-apop (session)
166 (if (string-match "^\+OK .*\\(<[^\>]+>\\)"
167 (elmo-network-session-greeting-internal session))
168 ;; good, APOP ready server
170 (elmo-pop3-send-command
171 (elmo-network-session-process-internal session)
173 (elmo-network-session-user-internal session)
175 (concat (match-string
177 (elmo-network-session-greeting-internal session))
179 (elmo-network-session-password-key session))))))
180 (or (elmo-pop3-read-response
181 (elmo-network-session-process-internal session)
183 (signal 'elmo-authenticate-error
184 '(elmo-pop3-auth-apop))))
185 (signal 'elmo-open-error '(elmo-pop3-auth-apop))))
187 (luna-define-method elmo-network-initialize-session-buffer :after
188 ((session elmo-pop3-session) buffer)
189 (with-current-buffer buffer
190 (mapcar 'make-variable-buffer-local elmo-pop3-local-variables)))
192 (luna-define-method elmo-network-initialize-session ((session
194 (let ((process (elmo-network-session-process-internal session))
196 (with-current-buffer (process-buffer process)
197 (set-process-filter process 'elmo-pop3-process-filter)
198 (setq elmo-pop3-read-point (point-min))
199 ;; Skip garbage output from process before greeting.
200 (while (and (memq (process-status process) '(open run))
201 (goto-char (point-max))
203 (not (looking-at "+OK")))
204 (accept-process-output process 1))
205 (setq elmo-pop3-read-point (point))
206 (or (elmo-network-session-set-greeting-internal
208 (elmo-pop3-read-response process t))
209 (signal 'elmo-open-error
210 '(elmo-network-intialize-session)))
211 (when (eq (elmo-network-stream-type-symbol
212 (elmo-network-session-stream-type-internal session))
214 (elmo-pop3-send-command process "stls")
215 (if (string-match "^\+OK"
216 (elmo-pop3-read-response process))
217 (starttls-negotiate process)
218 (signal 'elmo-open-error
219 '(elmo-pop3-starttls-error)))))))
221 (luna-define-method elmo-network-authenticate-session ((session
223 (with-current-buffer (process-buffer
224 (elmo-network-session-process-internal session))
225 (let* ((process (elmo-network-session-process-internal session))
226 (auth (elmo-network-session-auth-internal session))
227 (auth (mapcar '(lambda (mechanism) (upcase (symbol-name mechanism)))
228 (if (listp auth) auth (list auth))))
230 client name step response mechanism
231 sasl-read-passphrase)
232 (or (and (string= "USER" (car auth))
233 (elmo-pop3-auth-user session))
234 (and (string= "APOP" (car auth))
235 (elmo-pop3-auth-apop session))
238 (setq sasl-mechanisms (mapcar 'car sasl-mechanism-alist))
239 (setq mechanism (sasl-find-mechanism auth))
241 (signal 'elmo-authenticate-error '(elmo-pop3-auth-no-mechanisms)))
245 (elmo-network-session-user-internal session)
247 (elmo-network-session-host-internal session)))
248 ;;; (if elmo-pop3-auth-user-realm
249 ;;; (sasl-client-set-property client 'realm elmo-pop3-auth-user-realm))
250 (setq name (sasl-mechanism-name mechanism))
251 (elmo-network-session-set-auth-internal session
252 (intern (downcase name)))
253 (setq sasl-read-passphrase
257 (elmo-network-session-password-key session)))))
258 (setq step (sasl-next-step client nil))
259 (elmo-pop3-send-command
262 (and (sasl-step-data step)
265 (elmo-base64-encode-string
266 (sasl-step-data step) 'no-line-break))))) ;)
269 (unless (setq response (elmo-pop3-read-response process t))
270 ;; response is NO or BAD.
271 (signal 'elmo-authenticate-error
273 (concat "elmo-pop3-auth-"
275 (if (string-match "^\+OK" response)
276 (if (sasl-next-step client step)
278 (signal 'elmo-authenticate-error
280 (concat "elmo-pop3-auth-"
282 ;; The authentication process is finished.
286 (elmo-base64-decode-string
287 (cadr (split-string response " "))))
288 (setq step (sasl-next-step client step))
289 (elmo-pop3-send-command
291 (if (sasl-step-data step)
292 (elmo-base64-encode-string (sasl-step-data step)
296 (luna-define-method elmo-network-setup-session ((session
298 (let ((process (elmo-network-session-process-internal session))
300 (with-current-buffer (process-buffer process)
301 (setq elmo-pop3-size-hash (elmo-make-hash 31))
302 ;; To get obarray of uidl and size
303 (elmo-pop3-send-command process "list")
304 (if (null (elmo-pop3-read-response process))
305 (error "POP LIST command failed"))
306 (if (null (setq response
307 (elmo-pop3-read-contents
308 (current-buffer) process)))
309 (error "POP LIST command failed"))
310 ;; POP server always returns a sequence of serial numbers.
311 (setq count (elmo-pop3-parse-list-response response))
313 (when elmo-pop3-use-uidl
314 (setq elmo-pop3-uidl-number-hash (elmo-make-hash (* count 2)))
315 (setq elmo-pop3-number-uidl-hash (elmo-make-hash (* count 2)))
317 (elmo-pop3-send-command process "uidl")
318 (unless (elmo-pop3-read-response process)
319 (error "POP UIDL failed"))
320 (unless (setq response (elmo-pop3-read-contents
321 (current-buffer) process))
322 (error "POP UIDL failed"))
323 (elmo-pop3-parse-uidl-response response)))))
325 (defun elmo-pop3-read-contents (buffer process)
328 (let ((case-fold-search nil)
330 (goto-char elmo-pop3-read-point)
331 (while (not (re-search-forward "^\\.\r\n" nil t))
332 (accept-process-output process)
333 (goto-char elmo-pop3-read-point))
334 (setq match-end (point))
336 (buffer-substring elmo-pop3-read-point
340 (defun elmo-pop3-list-folders (spec &optional hierarchy) nil)
341 (defun elmo-pop3-append-msg (spec string) nil nil)
342 (defun elmo-pop3-folder-creatable-p (spec) nil)
343 (defun elmo-pop3-create-folder (spec) nil)
345 (defun elmo-pop3-folder-exists-p (spec)
346 (if (and elmo-pop3-exists-exactly
347 (elmo-pop3-plugged-p spec))
349 (let (elmo-auto-change-plugged ; don't change plug status.
350 elmo-pop3-use-uidl ; No need to use uidl.
353 (setq session (elmo-pop3-get-session spec))
355 (elmo-network-close-session session)))))
358 (defun elmo-pop3-parse-uidl-response (string)
359 (let ((buffer (current-buffer))
362 (let (number uid list)
364 (goto-char (point-min))
365 (while (re-search-forward "^\\([0-9]+\\)[\t ]\\([^ \n]+\\)$" nil t)
366 (setq number (elmo-match-buffer 1))
367 (setq uid (elmo-match-buffer 2))
368 (with-current-buffer buffer
369 (elmo-set-hash-val uid number elmo-pop3-uidl-number-hash)
370 (elmo-set-hash-val (concat "#" number) uid
371 elmo-pop3-number-uidl-hash))
372 (setq list (cons uid list)))
373 (with-current-buffer buffer (setq elmo-pop3-uidl-done t))
376 (defun elmo-pop3-parse-list-response (string)
377 (let ((buffer (current-buffer))
382 (goto-char (point-min))
383 (while (re-search-forward "^\\([0-9]+\\)[\t ]\\([0-9]+\\)$" nil t)
386 (cons (elmo-match-buffer 1)
387 (elmo-match-buffer 2))
389 (setq count (1+ count)))
390 (with-current-buffer buffer
391 (setq elmo-pop3-size-hash (elmo-make-hash (* (length alist) 2)))
393 (elmo-set-hash-val (concat "#" (car (car alist)))
396 (setq alist (cdr alist)))
397 (setq elmo-pop3-list-done t))
400 (defun elmo-pop3-list-location (spec)
401 (with-current-buffer (process-buffer
402 (elmo-network-session-process-internal
403 (elmo-pop3-get-session spec)))
405 (if elmo-pop3-uidl-done
409 (setq list (cons (symbol-name atom) list)))
410 elmo-pop3-uidl-number-hash)
412 (error "POP3: Error in UIDL")))))
414 (defun elmo-pop3-list-by-uidl-subr (spec &optional nonsort)
415 (let ((flist (elmo-list-folder-by-location
417 (elmo-pop3-list-location spec))))
419 (cons (elmo-max-of-list flist) (length flist))
422 (defun elmo-pop3-list-by-list (spec)
423 (with-current-buffer (process-buffer
424 (elmo-network-session-process-internal
425 (elmo-pop3-get-session spec)))
427 (if elmo-pop3-list-done
429 (mapatoms (lambda (atom)
430 (setq list (cons (string-to-int
431 (substring (symbol-name atom) 1))
435 (error "POP3: Error in list")))))
437 (defun elmo-pop3-list-folder (spec &optional nohide)
438 (let ((killed (and elmo-use-killed-list
439 (elmo-msgdb-killed-list-load
440 (elmo-msgdb-expand-path spec))))
442 (elmo-pop3-commit spec)
443 (setq numbers (if elmo-pop3-use-uidl
445 (elmo-pop3-list-by-uidl-subr spec))
446 (elmo-pop3-list-by-list spec)))
447 (elmo-living-messages numbers killed)))
449 (defun elmo-pop3-max-of-folder (spec)
450 (elmo-pop3-commit spec)
451 (if elmo-pop3-use-uidl
452 (elmo-pop3-list-by-uidl-subr spec 'nonsort)
454 (elmo-network-session-process-internal
455 (elmo-pop3-get-session spec)))
458 (with-current-buffer (process-buffer process)
459 (elmo-pop3-send-command process "STAT")
460 (setq response (elmo-pop3-read-response process))
461 ;; response: "^\+OK 2 7570$"
462 (if (not (string-match "^\+OK[ \t]*\\([0-9]*\\)" response))
463 (error "POP STAT command failed")
466 (substring response (match-beginning 1)(match-end 1 ))))
467 (cons total total))))))
469 (defvar elmo-pop3-header-fetch-chop-length 200)
471 (defsubst elmo-pop3-next-result-arrived-p ()
473 ((eq (following-char) ?+)
474 (if (re-search-forward "\n\\.\r?\n" nil t)
478 (if (search-forward "\n" nil t)
484 (defun elmo-pop3-retrieve-headers (buffer tobuffer process articles)
488 (let ((number (length articles))
491 (last-point (point-min)))
492 ;; Send HEAD commands.
494 (elmo-pop3-send-command process (format
495 "top %s 0" (car articles))
497 ;;; (accept-process-output process 1)
498 (setq articles (cdr articles))
499 (setq count (1+ count))
500 ;; Every 200 requests we have to read the stream in
501 ;; order to avoid deadlocks.
502 (when (or elmo-pop3-send-command-synchronously
503 (null articles) ;All requests have been sent.
504 (zerop (% count elmo-pop3-header-fetch-chop-length)))
505 (unless elmo-pop3-send-command-synchronously
506 (accept-process-output process 1))
510 (goto-char last-point)
512 (while (elmo-pop3-next-result-arrived-p)
513 (setq last-point (point))
514 (setq received (1+ received)))
516 (when (> number elmo-display-progress-threshold)
517 (if (or (zerop (% received 5)) (= received number))
518 (elmo-display-progress
519 'elmo-pop3-retrieve-headers "Getting headers..."
520 (/ (* received 100) number))))
521 (accept-process-output process 1)
522 ;;; (accept-process-output process)
524 ;; Remove all "\r"'s.
525 (goto-char (point-min))
526 (while (search-forward "\r\n" nil t)
527 (replace-match "\n"))
528 (copy-to-buffer tobuffer (point-min) (point-max)))))
530 (defalias 'elmo-pop3-msgdb-create 'elmo-pop3-msgdb-create-as-numlist)
532 (defun elmo-pop3-sort-overview-by-original-number (overview loc-alist)
536 (< (elmo-pop3-uidl-to-number
537 (cdr (assq (elmo-msgdb-overview-entity-get-number ent1)
539 (elmo-pop3-uidl-to-number
540 (cdr (assq (elmo-msgdb-overview-entity-get-number ent2)
544 (defun elmo-pop3-sort-msgdb-by-original-number (msgdb)
545 (message "Sorting...")
546 (let ((overview (elmo-msgdb-get-overview msgdb)))
547 (setq overview (elmo-pop3-sort-overview-by-original-number
549 (elmo-msgdb-get-location msgdb)))
550 (message "Sorting...done")
551 (list overview (nth 1 msgdb)(nth 2 msgdb)(nth 3 msgdb)(nth 4 msgdb))))
553 (defun elmo-pop3-msgdb-create-as-numlist (spec numlist new-mark
554 already-mark seen-mark
555 important-mark seen-list
558 (let ((process (elmo-network-session-process-internal
559 (elmo-pop3-get-session spec)))
561 (if elmo-pop3-use-uidl
562 (setq loc-alist (if msgdb (elmo-msgdb-get-location msgdb)
563 (elmo-msgdb-location-load
564 (elmo-msgdb-expand-path spec)))))
565 (with-current-buffer (process-buffer process)
566 (elmo-pop3-sort-msgdb-by-original-number
567 (elmo-pop3-msgdb-create-by-header process numlist
568 new-mark already-mark
572 (defun elmo-pop3-uidl-to-number (uidl)
573 (string-to-number (elmo-get-hash-val uidl
574 elmo-pop3-uidl-number-hash)))
576 (defun elmo-pop3-number-to-uidl (number)
577 (elmo-get-hash-val (format "#%d" number)
578 elmo-pop3-number-uidl-hash))
580 (defun elmo-pop3-number-to-size (number)
581 (elmo-get-hash-val (format "#%d" number)
582 elmo-pop3-size-hash))
584 (defun elmo-pop3-msgdb-create-by-header (process numlist
585 new-mark already-mark
589 (let ((tmp-buffer (get-buffer-create " *ELMO Overview TMP*")))
590 (with-current-buffer (process-buffer process)
591 (if loc-alist ; use uidl.
597 (elmo-pop3-uidl-to-number (cdr (assq number loc-alist))))
599 (elmo-pop3-retrieve-headers (process-buffer process)
600 tmp-buffer process numlist)
602 (elmo-pop3-msgdb-create-message
607 new-mark already-mark seen-mark seen-list loc-alist)
608 (kill-buffer tmp-buffer)))))
610 (defun elmo-pop3-msgdb-create-message (buffer
613 numlist new-mark already-mark
618 (let (beg overview number-alist mark-alist
619 entity i number message-id gmark seen size)
621 (elmo-set-buffer-multibyte default-enable-multibyte-characters)
622 (goto-char (point-min))
624 (message "Creating msgdb...")
626 (setq beg (save-excursion (forward-line 1) (point)))
627 (elmo-pop3-next-result-arrived-p)
631 (narrow-to-region beg (point))
633 (elmo-msgdb-create-overview-from-buffer
635 (setq numlist (cdr numlist))
638 (elmo-msgdb-append-element
640 (with-current-buffer (process-buffer process)
641 (elmo-msgdb-overview-entity-set-size
644 (elmo-pop3-number-to-size
645 (elmo-msgdb-overview-entity-get-number entity))))
649 (elmo-pop3-number-to-uidl
650 (elmo-msgdb-overview-entity-get-number entity))
652 (elmo-msgdb-overview-entity-set-number entity number)))
654 (elmo-msgdb-number-add
656 (elmo-msgdb-overview-entity-get-number entity)
658 (setq message-id (car entity))
659 (setq seen (member message-id seen-list))
660 (if (setq gmark (or (elmo-msgdb-global-mark-get message-id)
661 (if (elmo-cache-exists-p
667 (if elmo-pop3-use-cache
671 (elmo-msgdb-mark-append
673 (elmo-msgdb-overview-entity-get-number entity)
675 (when (> num elmo-display-progress-threshold)
677 (if (or (zerop (% i 5)) (= i num))
678 (elmo-display-progress
679 'elmo-pop3-msgdb-create-message "Creating msgdb..."
680 (/ (* i 100) num)))))
681 (list overview number-alist mark-alist loc-alist))))
683 (defun elmo-pop3-read-body (process outbuf)
684 (with-current-buffer (process-buffer process)
685 (let ((start elmo-pop3-read-point)
688 (while (not (re-search-forward "^\\.\r?\n" nil t))
689 (accept-process-output process)
692 (with-current-buffer outbuf
694 (insert-buffer-substring (process-buffer process) start (- end 3))
695 (elmo-delete-cr-get-content-type)))))
697 (defun elmo-pop3-read-msg (spec number outbuf &optional msgdb unread)
698 (let* ((loc-alist (if elmo-pop3-use-uidl
700 (elmo-msgdb-get-location msgdb)
701 (elmo-msgdb-location-load
702 (elmo-msgdb-expand-path spec)))))
703 (process (elmo-network-session-process-internal
704 (elmo-pop3-get-session spec)))
705 size response errmsg msg)
706 (with-current-buffer (process-buffer process)
708 (setq number (elmo-pop3-uidl-to-number
709 (cdr (assq number loc-alist)))))
710 (setq size (string-to-number
711 (elmo-pop3-number-to-size number)))
713 (elmo-pop3-send-command process
714 (format "retr %s" number))
715 (setq elmo-pop3-total-size size)
716 (unless elmo-inhibit-display-retrieval-progress
717 (setq elmo-pop3-total-size size)
718 (elmo-display-progress
719 'elmo-pop3-display-retrieval-progress
720 (format "Retrieving (0/%d bytes)..." elmo-pop3-total-size)
724 (when (null (setq response (elmo-pop3-read-response
726 (error "Fetching message failed"))
727 (setq response (elmo-pop3-read-body process outbuf)))
728 (setq elmo-pop3-total-size nil))
729 (unless elmo-inhibit-display-retrieval-progress
730 (elmo-display-progress
731 'elmo-display-retrieval-progress "" 100) ; remove progress bar.
732 (message "Retrieving...done."))
734 (goto-char (point-min))
735 (while (re-search-forward "^\\." nil t)
740 (defun elmo-pop3-delete-msg (process number loc-alist)
741 (with-current-buffer (process-buffer process)
742 (let (response errmsg msg)
744 (setq number (elmo-pop3-uidl-to-number
745 (cdr (assq number loc-alist)))))
748 (elmo-pop3-send-command process
749 (format "dele %s" number))
750 (when (null (setq response (elmo-pop3-read-response
752 (error "Deleting message failed")))
753 (error "Deleting message failed")))))
755 (defun elmo-pop3-delete-msgs (spec msgs &optional msgdb)
756 (let ((loc-alist (if elmo-pop3-use-uidl
758 (elmo-msgdb-get-location msgdb)
759 (elmo-msgdb-location-load
760 (elmo-msgdb-expand-path spec)))))
761 (process (elmo-network-session-process-internal
762 (elmo-pop3-get-session spec))))
763 (mapcar '(lambda (msg) (elmo-pop3-delete-msg
764 process msg loc-alist))
767 (defun elmo-pop3-search (spec condition &optional numlist)
768 (error "Searching in pop3 folder is not implemented yet"))
770 (defun elmo-pop3-use-cache-p (spec number)
773 (defun elmo-pop3-local-file-p (spec number)
776 (defun elmo-pop3-port-label (spec)
778 (if (elmo-pop3-spec-stream-type spec)
779 (concat "!" (symbol-name
780 (elmo-network-stream-type-symbol
781 (elmo-pop3-spec-stream-type spec)))))))
783 (defsubst elmo-pop3-portinfo (spec)
784 (list (elmo-pop3-spec-hostname spec)
785 (elmo-pop3-spec-port spec)))
787 (defun elmo-pop3-plugged-p (spec)
788 (apply 'elmo-plugged-p
789 (append (elmo-pop3-portinfo spec)
790 (list nil (quote (elmo-pop3-port-label spec))))))
792 (defun elmo-pop3-set-plugged (spec plugged add)
793 (apply 'elmo-set-plugged plugged
794 (append (elmo-pop3-portinfo spec)
795 (list nil nil (quote (elmo-pop3-port-label spec)) add))))
797 (defalias 'elmo-pop3-sync-number-alist
798 'elmo-generic-sync-number-alist)
799 (defalias 'elmo-pop3-list-folder-unread
800 'elmo-generic-list-folder-unread)
801 (defalias 'elmo-pop3-list-folder-important
802 'elmo-generic-list-folder-important)
803 (defalias 'elmo-pop3-folder-diff 'elmo-generic-folder-diff)
805 (defun elmo-pop3-commit (spec)
806 (if (elmo-pop3-plugged-p spec)
807 (let ((session (elmo-pop3-get-session spec 'if-exists)))
809 (elmo-network-close-session session)))))
813 (product-provide (provide 'elmo-pop3) (require 'elmo-version))
815 ;;; elmo-pop3.el ends here