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-use-uidl t
44 "*If non-nil, use UIDL.")
46 (defvar elmo-pop3-exists-exactly t)
47 (defvar sasl-mechanism-alist)
49 (luna-define-class elmo-pop3-session (elmo-network-session))
52 (defvar elmo-pop3-read-point nil)
53 (defvar elmo-pop3-number-uidl-hash nil) ; number -> uidl
54 (defvar elmo-pop3-uidl-number-hash nil) ; uidl -> number
55 (defvar elmo-pop3-size-hash nil) ; number -> size
56 (defvar elmo-pop3-uidl-done nil)
57 (defvar elmo-pop3-list-done nil)
59 (defvar elmo-pop3-local-variables '(elmo-pop3-read-point
60 elmo-pop3-uidl-number-hash
61 elmo-pop3-number-uidl-hash
66 (luna-define-method elmo-network-close-session ((session elmo-pop3-session))
67 (when (elmo-network-session-process-internal session)
68 (when (memq (process-status
69 (elmo-network-session-process-internal session))
71 (elmo-pop3-send-command (elmo-network-session-process-internal session)
73 (or (elmo-pop3-read-response
74 (elmo-network-session-process-internal session) t)
75 (error "POP error: QUIT failed")))
76 (kill-buffer (process-buffer
77 (elmo-network-session-process-internal session)))
78 (delete-process (elmo-network-session-process-internal session))))
80 (defun elmo-pop3-get-session (spec &optional if-exists)
81 (elmo-network-get-session
84 (elmo-pop3-spec-hostname spec)
85 (elmo-pop3-spec-port spec)
86 (elmo-pop3-spec-username spec)
87 (elmo-pop3-spec-auth spec)
88 (elmo-pop3-spec-stream-type spec)
91 (defun elmo-pop3-send-command (process command &optional no-erase)
92 (with-current-buffer (process-buffer process)
95 (goto-char (point-min))
96 (setq elmo-pop3-read-point (point))
97 (process-send-string process command)
98 (process-send-string process "\r\n")))
100 (defun elmo-pop3-read-response (process &optional not-command)
101 (with-current-buffer (process-buffer process)
102 (let ((case-fold-search nil)
103 (response-string nil)
104 (response-continue t)
107 (while response-continue
108 (goto-char elmo-pop3-read-point)
109 (while (not (re-search-forward "\r?\n" nil t))
110 (accept-process-output process)
111 (goto-char elmo-pop3-read-point))
112 (setq match-end (point))
113 (setq response-string
114 (buffer-substring elmo-pop3-read-point (- match-end 2)))
115 (goto-char elmo-pop3-read-point)
116 (if (looking-at "\\+.*$")
118 (setq response-continue nil)
119 (setq elmo-pop3-read-point match-end)
122 (concat return-value "\n" response-string)
124 (if (looking-at "\\-.*$")
126 (setq response-continue nil)
127 (setq elmo-pop3-read-point match-end)
128 (setq return-value nil))
129 (setq elmo-pop3-read-point match-end)
131 (setq response-continue nil))
134 (concat return-value "\n" response-string)
136 (setq elmo-pop3-read-point match-end)))
139 (defun elmo-pop3-process-filter (process output)
141 (set-buffer (process-buffer process))
142 (goto-char (point-max))
145 (defun elmo-pop3-auth-user (session)
146 (let ((process (elmo-network-session-process-internal session)))
148 (elmo-pop3-send-command
150 (format "user %s" (elmo-network-session-user-internal session)))
151 (or (elmo-pop3-read-response process t)
152 (signal 'elmo-authenticate-error
153 '(elmo-pop-auth-user)))
154 (elmo-pop3-send-command process
158 (elmo-network-session-password-key session))))
159 (or (elmo-pop3-read-response process t)
160 (signal 'elmo-authenticate-error
161 '(elmo-pop-auth-user)))))
163 (defun elmo-pop3-auth-apop (session)
164 (if (string-match "^\+OK .*\\(<[^\>]+>\\)"
165 (elmo-network-session-greeting-internal session))
166 ;; good, APOP ready server
168 (elmo-pop3-send-command
169 (elmo-network-session-process-internal session)
171 (elmo-network-session-user-internal session)
173 (concat (match-string
175 (elmo-network-session-greeting-internal session))
177 (elmo-network-session-password-key session))))))
178 (or (elmo-pop3-read-response
179 (elmo-network-session-process-internal session)
181 (signal 'elmo-authenticate-error
182 '(elmo-pop3-auth-apop))))
183 (signal 'elmo-open-error '(elmo-pop3-auth-apop))))
185 (luna-define-method elmo-network-initialize-session-buffer :after
186 ((session elmo-pop3-session) buffer)
187 (with-current-buffer buffer
188 (mapcar 'make-variable-buffer-local elmo-pop3-local-variables)))
190 (luna-define-method elmo-network-initialize-session ((session
192 (let ((process (elmo-network-session-process-internal session))
194 (with-current-buffer (process-buffer process)
195 (set-process-filter process 'elmo-pop3-process-filter)
196 (setq elmo-pop3-read-point (point-min))
197 ;; Skip garbage output from process before greeting.
198 (while (and (memq (process-status process) '(open run))
199 (goto-char (point-max))
201 (not (looking-at "+OK")))
202 (accept-process-output process 1))
203 (setq elmo-pop3-read-point (point))
204 (or (elmo-network-session-set-greeting-internal
206 (elmo-pop3-read-response process t))
207 (signal 'elmo-open-error
208 '(elmo-network-intialize-session)))
209 (when (eq (elmo-network-stream-type-symbol
210 (elmo-network-session-stream-type-internal session))
212 (elmo-pop3-send-command process "stls")
213 (if (string-match "^\+OK"
214 (elmo-pop3-read-response process))
215 (starttls-negotiate process)
216 (signal 'elmo-open-error
217 '(elmo-pop3-starttls-error)))))))
219 (luna-define-method elmo-network-authenticate-session ((session
221 (with-current-buffer (process-buffer
222 (elmo-network-session-process-internal session))
223 (let* ((process (elmo-network-session-process-internal session))
224 (auth (elmo-network-session-auth-internal session))
225 (auth (mapcar '(lambda (mechanism) (upcase (symbol-name mechanism)))
226 (if (listp auth) auth (list auth))))
228 client name step response mechanism
229 sasl-read-passphrase)
230 (or (and (string= "USER" (car auth))
231 (elmo-pop3-auth-user session))
232 (and (string= "APOP" (car auth))
233 (elmo-pop3-auth-apop session))
236 (setq sasl-mechanisms (mapcar 'car sasl-mechanism-alist))
237 (setq mechanism (sasl-find-mechanism auth))
239 (signal 'elmo-authenticate-error '(elmo-pop3-auth-no-mechanisms)))
243 (elmo-network-session-user-internal session)
245 (elmo-network-session-host-internal session)))
246 ;;; (if elmo-pop3-auth-user-realm
247 ;;; (sasl-client-set-property client 'realm elmo-pop3-auth-user-realm))
248 (setq name (sasl-mechanism-name mechanism))
249 (elmo-network-session-set-auth-internal session
250 (intern (downcase name)))
251 (setq sasl-read-passphrase
255 (elmo-network-session-password-key session)))))
256 (setq step (sasl-next-step client nil))
257 (elmo-pop3-send-command
260 (and (sasl-step-data step)
263 (elmo-base64-encode-string
264 (sasl-step-data step) 'no-line-break))))) ;)
267 (unless (setq response (elmo-pop3-read-response process t))
268 (signal 'elmo-authenticate-error
270 (concat "elmo-pop3-auth-"
272 (if (string-match "^\+OK" response)
273 (if (sasl-next-step client step)
274 (signal 'elmo-authenticate-error
276 (concat "elmo-pop3-auth-"
281 (elmo-base64-decode-string
282 (cadr (split-string response " "))))
283 (setq step (sasl-next-step client step))
284 (elmo-pop3-send-command
286 (if (sasl-step-data step)
287 (elmo-base64-encode-string (sasl-step-data step)
291 (luna-define-method elmo-network-setup-session ((session
293 (let ((process (elmo-network-session-process-internal session))
295 (with-current-buffer (process-buffer process)
296 (setq elmo-pop3-size-hash (elmo-make-hash 31))
297 ;; To get obarray of uidl and size
298 (elmo-pop3-send-command process "list")
299 (if (null (elmo-pop3-read-response process))
300 (error "POP LIST command failed"))
301 (if (null (setq response
302 (elmo-pop3-read-contents
303 (current-buffer) process)))
304 (error "POP LIST command failed"))
305 ;; POP server always returns a sequence of serial numbers.
306 (setq count (elmo-pop3-parse-list-response response))
308 (when elmo-pop3-use-uidl
309 (setq elmo-pop3-uidl-number-hash (elmo-make-hash (* count 2)))
310 (setq elmo-pop3-number-uidl-hash (elmo-make-hash (* count 2)))
312 (elmo-pop3-send-command process "uidl")
313 (unless (elmo-pop3-read-response process)
314 (error "POP UIDL failed"))
315 (unless (setq response (elmo-pop3-read-contents
316 (current-buffer) process))
317 (error "POP UIDL failed"))
318 (elmo-pop3-parse-uidl-response response)))))
320 (defun elmo-pop3-read-contents (buffer process)
323 (let ((case-fold-search nil)
325 (goto-char elmo-pop3-read-point)
326 (while (not (re-search-forward "^\\.\r\n" nil t))
327 (accept-process-output process)
328 (goto-char elmo-pop3-read-point))
329 (setq match-end (point))
331 (buffer-substring elmo-pop3-read-point
335 (defun elmo-pop3-list-folders (spec &optional hierarchy) nil)
336 (defun elmo-pop3-append-msg (spec string) nil nil)
337 (defun elmo-pop3-folder-creatable-p (spec) nil)
338 (defun elmo-pop3-create-folder (spec) nil)
340 (defun elmo-pop3-folder-exists-p (spec)
341 (if (and elmo-pop3-exists-exactly
342 (elmo-pop3-plugged-p spec))
344 (let (elmo-auto-change-plugged ; don't change plug status.
345 elmo-pop3-use-uidl ; No need to use uidl.
348 (setq session (elmo-pop3-get-session spec))
350 (elmo-network-close-session session)))))
353 (defun elmo-pop3-parse-uidl-response (string)
354 (let ((buffer (current-buffer))
357 (let (number uid list)
359 (goto-char (point-min))
360 (while (re-search-forward "^\\([0-9]+\\)[\t ]\\([^ \n]+\\)$" nil t)
361 (setq number (elmo-match-buffer 1))
362 (setq uid (elmo-match-buffer 2))
363 (with-current-buffer buffer
364 (elmo-set-hash-val uid number elmo-pop3-uidl-number-hash)
365 (elmo-set-hash-val (concat "#" number) uid
366 elmo-pop3-number-uidl-hash))
367 (setq list (cons uid list)))
368 (with-current-buffer buffer (setq elmo-pop3-uidl-done t))
371 (defun elmo-pop3-parse-list-response (string)
372 (let ((buffer (current-buffer))
377 (goto-char (point-min))
378 (while (re-search-forward "^\\([0-9]+\\)[\t ]\\([0-9]+\\)$" nil t)
381 (cons (elmo-match-buffer 1)
382 (elmo-match-buffer 2))
384 (setq count (1+ count)))
385 (with-current-buffer buffer
386 (setq elmo-pop3-size-hash (elmo-make-hash (* (length alist) 2)))
388 (elmo-set-hash-val (concat "#" (car (car alist)))
391 (setq alist (cdr alist)))
392 (setq elmo-pop3-list-done t))
395 (defun elmo-pop3-list-location (spec)
396 (with-current-buffer (process-buffer
397 (elmo-network-session-process-internal
398 (elmo-pop3-get-session spec)))
400 (if elmo-pop3-uidl-done
404 (setq list (cons (symbol-name atom) list)))
405 elmo-pop3-uidl-number-hash)
407 (error "POP3: Error in UIDL")))))
409 (defun elmo-pop3-list-by-uidl-subr (spec &optional nonsort)
410 (let ((flist (elmo-list-folder-by-location
412 (elmo-pop3-list-location spec))))
414 (cons (elmo-max-of-list flist) (length flist))
417 (defun elmo-pop3-list-by-list (spec)
418 (with-current-buffer (process-buffer
419 (elmo-network-session-process-internal
420 (elmo-pop3-get-session spec)))
422 (if elmo-pop3-list-done
424 (mapatoms (lambda (atom)
425 (setq list (cons (string-to-int
426 (substring (symbol-name atom) 1))
430 (error "POP3: Error in list")))))
432 (defun elmo-pop3-list-folder (spec &optional nohide)
433 (let ((killed (and elmo-use-killed-list
434 (elmo-msgdb-killed-list-load
435 (elmo-msgdb-expand-path spec))))
437 (elmo-pop3-commit spec)
438 (setq numbers (if elmo-pop3-use-uidl
440 (elmo-pop3-list-by-uidl-subr spec))
441 (elmo-pop3-list-by-list spec)))
442 (elmo-living-messages numbers killed)))
444 (defun elmo-pop3-max-of-folder (spec)
445 (elmo-pop3-commit spec)
446 (if elmo-pop3-use-uidl
447 (elmo-pop3-list-by-uidl-subr spec 'nonsort)
449 (elmo-network-session-process-internal
450 (elmo-pop3-get-session spec)))
453 (with-current-buffer (process-buffer process)
454 (elmo-pop3-send-command process "STAT")
455 (setq response (elmo-pop3-read-response process))
456 ;; response: "^\+OK 2 7570$"
457 (if (not (string-match "^\+OK[ \t]*\\([0-9]*\\)" response))
458 (error "POP STAT command failed")
461 (substring response (match-beginning 1)(match-end 1 ))))
462 (cons total total))))))
464 (defvar elmo-pop3-header-fetch-chop-length 200)
466 (defsubst elmo-pop3-next-result-arrived-p ()
468 ((eq (following-char) ?+)
469 (if (re-search-forward "\n\\.\r?\n" nil t)
473 (if (search-forward "\n" nil t)
479 (defun elmo-pop3-retrieve-headers (buffer tobuffer process articles)
483 (let ((number (length articles))
486 (last-point (point-min)))
487 ;; Send HEAD commands.
489 (elmo-pop3-send-command process (format
490 "top %s 0" (car articles))
492 ;;; (accept-process-output process 1)
493 (setq articles (cdr articles))
494 (setq count (1+ count))
495 ;; Every 200 requests we have to read the stream in
496 ;; order to avoid deadlocks.
497 (when (or elmo-pop3-send-command-synchronously
498 (null articles) ;All requests have been sent.
499 (zerop (% count elmo-pop3-header-fetch-chop-length)))
500 (unless elmo-pop3-send-command-synchronously
501 (accept-process-output process 1))
505 (goto-char last-point)
507 (while (elmo-pop3-next-result-arrived-p)
508 (setq last-point (point))
509 (setq received (1+ received)))
511 (when (> number elmo-display-progress-threshold)
512 (if (or (zerop (% received 5)) (= received number))
513 (elmo-display-progress
514 'elmo-pop3-retrieve-headers "Getting headers..."
515 (/ (* received 100) number))))
516 (accept-process-output process 1)
517 ;;; (accept-process-output process)
519 ;; Remove all "\r"'s.
520 (goto-char (point-min))
521 (while (search-forward "\r\n" nil t)
522 (replace-match "\n"))
523 (copy-to-buffer tobuffer (point-min) (point-max)))))
525 (defalias 'elmo-pop3-msgdb-create 'elmo-pop3-msgdb-create-as-numlist)
527 (defun elmo-pop3-sort-overview-by-original-number (overview loc-alist)
531 (< (elmo-pop3-uidl-to-number
532 (cdr (assq (elmo-msgdb-overview-entity-get-number ent1)
534 (elmo-pop3-uidl-to-number
535 (cdr (assq (elmo-msgdb-overview-entity-get-number ent2)
539 (defun elmo-pop3-sort-msgdb-by-original-number (msgdb)
540 (message "Sorting...")
541 (let ((overview (elmo-msgdb-get-overview msgdb)))
542 (setq overview (elmo-pop3-sort-overview-by-original-number
544 (elmo-msgdb-get-location msgdb)))
545 (message "Sorting...done")
546 (list overview (nth 1 msgdb)(nth 2 msgdb)(nth 3 msgdb)(nth 4 msgdb))))
548 (defun elmo-pop3-msgdb-create-as-numlist (spec numlist new-mark
549 already-mark seen-mark
550 important-mark seen-list
553 (let ((process (elmo-network-session-process-internal
554 (elmo-pop3-get-session spec)))
556 (if elmo-pop3-use-uidl
557 (setq loc-alist (if msgdb (elmo-msgdb-get-location msgdb)
558 (elmo-msgdb-location-load
559 (elmo-msgdb-expand-path spec)))))
560 (with-current-buffer (process-buffer process)
561 (elmo-pop3-sort-msgdb-by-original-number
562 (elmo-pop3-msgdb-create-by-header process numlist
563 new-mark already-mark
567 (defun elmo-pop3-uidl-to-number (uidl)
568 (string-to-number (elmo-get-hash-val uidl
569 elmo-pop3-uidl-number-hash)))
571 (defun elmo-pop3-number-to-uidl (number)
572 (elmo-get-hash-val (format "#%d" number)
573 elmo-pop3-number-uidl-hash))
575 (defun elmo-pop3-number-to-size (number)
576 (elmo-get-hash-val (format "#%d" number)
577 elmo-pop3-size-hash))
579 (defun elmo-pop3-msgdb-create-by-header (process numlist
580 new-mark already-mark
584 (let ((tmp-buffer (get-buffer-create " *ELMO Overview TMP*")))
585 (with-current-buffer (process-buffer process)
586 (if loc-alist ; use uidl.
592 (elmo-pop3-uidl-to-number (cdr (assq number loc-alist))))
594 (elmo-pop3-retrieve-headers (process-buffer process)
595 tmp-buffer process numlist)
597 (elmo-pop3-msgdb-create-message
602 new-mark already-mark seen-mark seen-list loc-alist)
603 (kill-buffer tmp-buffer)))))
605 (defun elmo-pop3-msgdb-create-message (buffer
608 numlist new-mark already-mark
613 (let (beg overview number-alist mark-alist
614 entity i number message-id gmark seen size)
616 (elmo-set-buffer-multibyte default-enable-multibyte-characters)
617 (goto-char (point-min))
619 (message "Creating msgdb...")
621 (setq beg (save-excursion (forward-line 1) (point)))
622 (elmo-pop3-next-result-arrived-p)
626 (narrow-to-region beg (point))
628 (elmo-msgdb-create-overview-from-buffer
630 (setq numlist (cdr numlist))
633 (elmo-msgdb-append-element
635 (with-current-buffer (process-buffer process)
636 (elmo-msgdb-overview-entity-set-size
639 (elmo-pop3-number-to-size
640 (elmo-msgdb-overview-entity-get-number entity))))
644 (elmo-pop3-number-to-uidl
645 (elmo-msgdb-overview-entity-get-number entity))
647 (elmo-msgdb-overview-entity-set-number entity number)))
649 (elmo-msgdb-number-add
651 (elmo-msgdb-overview-entity-get-number entity)
653 (setq message-id (car entity))
654 (setq seen (member message-id seen-list))
655 (if (setq gmark (or (elmo-msgdb-global-mark-get message-id)
656 (if (elmo-cache-exists-p
662 (if elmo-pop3-use-cache
666 (elmo-msgdb-mark-append
668 (elmo-msgdb-overview-entity-get-number entity)
670 (when (> num elmo-display-progress-threshold)
672 (if (or (zerop (% i 5)) (= i num))
673 (elmo-display-progress
674 'elmo-pop3-msgdb-create-message "Creating msgdb..."
675 (/ (* i 100) num)))))
676 (list overview number-alist mark-alist loc-alist))))
678 (defun elmo-pop3-read-body (process outbuf)
679 (with-current-buffer (process-buffer process)
680 (let ((start elmo-pop3-read-point)
683 (while (not (re-search-forward "^\\.\r?\n" nil t))
684 (accept-process-output process)
687 (with-current-buffer outbuf
689 (insert-buffer-substring (process-buffer process) start (- end 3))
690 (elmo-delete-cr-get-content-type)))))
692 (defun elmo-pop3-read-msg (spec number outbuf &optional msgdb unread)
693 (let* ((loc-alist (if elmo-pop3-use-uidl
695 (elmo-msgdb-get-location msgdb)
696 (elmo-msgdb-location-load
697 (elmo-msgdb-expand-path spec)))))
698 (process (elmo-network-session-process-internal
699 (elmo-pop3-get-session spec)))
701 (with-current-buffer (process-buffer process)
703 (setq number (elmo-pop3-uidl-to-number
704 (cdr (assq number loc-alist)))))
706 (elmo-pop3-send-command process
707 (format "retr %s" number))
708 (when (null (setq response (elmo-pop3-read-response
710 (error "Fetching message failed"))
711 (setq response (elmo-pop3-read-body process outbuf))
713 (goto-char (point-min))
714 (while (re-search-forward "^\\." nil t)
719 (defun elmo-pop3-delete-msg (process number loc-alist)
720 (with-current-buffer (process-buffer process)
721 (let (response errmsg msg)
723 (setq number (elmo-pop3-uidl-to-number
724 (cdr (assq number loc-alist)))))
727 (elmo-pop3-send-command process
728 (format "dele %s" number))
729 (when (null (setq response (elmo-pop3-read-response
731 (error "Deleting message failed")))
732 (error "Deleting message failed")))))
734 (defun elmo-pop3-delete-msgs (spec msgs &optional msgdb)
735 (let ((loc-alist (if elmo-pop3-use-uidl
737 (elmo-msgdb-get-location msgdb)
738 (elmo-msgdb-location-load
739 (elmo-msgdb-expand-path spec)))))
740 (process (elmo-network-session-process-internal
741 (elmo-pop3-get-session spec))))
742 (mapcar '(lambda (msg) (elmo-pop3-delete-msg
743 process msg loc-alist))
746 (defun elmo-pop3-search (spec condition &optional numlist)
747 (error "Searching in pop3 folder is not implemented yet"))
749 (defun elmo-pop3-use-cache-p (spec number)
752 (defun elmo-pop3-local-file-p (spec number)
755 (defun elmo-pop3-port-label (spec)
757 (if (elmo-pop3-spec-stream-type spec)
758 (concat "!" (symbol-name
759 (elmo-network-stream-type-symbol
760 (elmo-pop3-spec-stream-type spec)))))))
762 (defsubst elmo-pop3-portinfo (spec)
763 (list (elmo-pop3-spec-hostname spec)
764 (elmo-pop3-spec-port spec)))
766 (defun elmo-pop3-plugged-p (spec)
767 (apply 'elmo-plugged-p
768 (append (elmo-pop3-portinfo spec)
769 (list nil (quote (elmo-pop3-port-label spec))))))
771 (defun elmo-pop3-set-plugged (spec plugged add)
772 (apply 'elmo-set-plugged plugged
773 (append (elmo-pop3-portinfo spec)
774 (list nil nil (quote (elmo-pop3-port-label spec)) add))))
776 (defalias 'elmo-pop3-sync-number-alist
777 'elmo-generic-sync-number-alist)
778 (defalias 'elmo-pop3-list-folder-unread
779 'elmo-generic-list-folder-unread)
780 (defalias 'elmo-pop3-list-folder-important
781 'elmo-generic-list-folder-important)
782 (defalias 'elmo-pop3-folder-diff 'elmo-generic-folder-diff)
784 (defun elmo-pop3-commit (spec)
785 (if (elmo-pop3-plugged-p spec)
786 (let ((session (elmo-pop3-get-session spec 'if-exists)))
788 (elmo-network-close-session session)))))
792 (product-provide (provide 'elmo-pop3) (require 'elmo-version))
794 ;;; elmo-pop3.el ends here