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 ;; response is NO or BAD.
269 (signal 'elmo-authenticate-error
271 (concat "elmo-pop3-auth-"
273 (if (string-match "^\+OK" response)
274 (if (sasl-next-step client step)
276 (signal 'elmo-authenticate-error
278 (concat "elmo-pop3-auth-"
280 ;; The authentication process is finished.
284 (elmo-base64-decode-string
285 (cadr (split-string response " "))))
286 (setq step (sasl-next-step client step))
287 (elmo-pop3-send-command
289 (if (sasl-step-data step)
290 (elmo-base64-encode-string (sasl-step-data step)
294 (luna-define-method elmo-network-setup-session ((session
296 (let ((process (elmo-network-session-process-internal session))
298 (with-current-buffer (process-buffer process)
299 (setq elmo-pop3-size-hash (elmo-make-hash 31))
300 ;; To get obarray of uidl and size
301 (elmo-pop3-send-command process "list")
302 (if (null (elmo-pop3-read-response process))
303 (error "POP LIST command failed"))
304 (if (null (setq response
305 (elmo-pop3-read-contents
306 (current-buffer) process)))
307 (error "POP LIST command failed"))
308 ;; POP server always returns a sequence of serial numbers.
309 (setq count (elmo-pop3-parse-list-response response))
311 (when elmo-pop3-use-uidl
312 (setq elmo-pop3-uidl-number-hash (elmo-make-hash (* count 2)))
313 (setq elmo-pop3-number-uidl-hash (elmo-make-hash (* count 2)))
315 (elmo-pop3-send-command process "uidl")
316 (unless (elmo-pop3-read-response process)
317 (error "POP UIDL failed"))
318 (unless (setq response (elmo-pop3-read-contents
319 (current-buffer) process))
320 (error "POP UIDL failed"))
321 (elmo-pop3-parse-uidl-response response)))))
323 (defun elmo-pop3-read-contents (buffer process)
326 (let ((case-fold-search nil)
328 (goto-char elmo-pop3-read-point)
329 (while (not (re-search-forward "^\\.\r\n" nil t))
330 (accept-process-output process)
331 (goto-char elmo-pop3-read-point))
332 (setq match-end (point))
334 (buffer-substring elmo-pop3-read-point
338 (defun elmo-pop3-list-folders (spec &optional hierarchy) nil)
339 (defun elmo-pop3-append-msg (spec string) nil nil)
340 (defun elmo-pop3-folder-creatable-p (spec) nil)
341 (defun elmo-pop3-create-folder (spec) nil)
343 (defun elmo-pop3-folder-exists-p (spec)
344 (if (and elmo-pop3-exists-exactly
345 (elmo-pop3-plugged-p spec))
347 (let (elmo-auto-change-plugged ; don't change plug status.
348 elmo-pop3-use-uidl ; No need to use uidl.
351 (setq session (elmo-pop3-get-session spec))
353 (elmo-network-close-session session)))))
356 (defun elmo-pop3-parse-uidl-response (string)
357 (let ((buffer (current-buffer))
360 (let (number uid list)
362 (goto-char (point-min))
363 (while (re-search-forward "^\\([0-9]+\\)[\t ]\\([^ \n]+\\)$" nil t)
364 (setq number (elmo-match-buffer 1))
365 (setq uid (elmo-match-buffer 2))
366 (with-current-buffer buffer
367 (elmo-set-hash-val uid number elmo-pop3-uidl-number-hash)
368 (elmo-set-hash-val (concat "#" number) uid
369 elmo-pop3-number-uidl-hash))
370 (setq list (cons uid list)))
371 (with-current-buffer buffer (setq elmo-pop3-uidl-done t))
374 (defun elmo-pop3-parse-list-response (string)
375 (let ((buffer (current-buffer))
380 (goto-char (point-min))
381 (while (re-search-forward "^\\([0-9]+\\)[\t ]\\([0-9]+\\)$" nil t)
384 (cons (elmo-match-buffer 1)
385 (elmo-match-buffer 2))
387 (setq count (1+ count)))
388 (with-current-buffer buffer
389 (setq elmo-pop3-size-hash (elmo-make-hash (* (length alist) 2)))
391 (elmo-set-hash-val (concat "#" (car (car alist)))
394 (setq alist (cdr alist)))
395 (setq elmo-pop3-list-done t))
398 (defun elmo-pop3-list-location (spec)
399 (with-current-buffer (process-buffer
400 (elmo-network-session-process-internal
401 (elmo-pop3-get-session spec)))
403 (if elmo-pop3-uidl-done
407 (setq list (cons (symbol-name atom) list)))
408 elmo-pop3-uidl-number-hash)
410 (error "POP3: Error in UIDL")))))
412 (defun elmo-pop3-list-by-uidl-subr (spec &optional nonsort)
413 (let ((flist (elmo-list-folder-by-location
415 (elmo-pop3-list-location spec))))
417 (cons (elmo-max-of-list flist) (length flist))
420 (defun elmo-pop3-list-by-list (spec)
421 (with-current-buffer (process-buffer
422 (elmo-network-session-process-internal
423 (elmo-pop3-get-session spec)))
425 (if elmo-pop3-list-done
427 (mapatoms (lambda (atom)
428 (setq list (cons (string-to-int
429 (substring (symbol-name atom) 1))
433 (error "POP3: Error in list")))))
435 (defun elmo-pop3-list-folder (spec &optional nohide)
436 (let ((killed (and elmo-use-killed-list
437 (elmo-msgdb-killed-list-load
438 (elmo-msgdb-expand-path spec))))
440 (elmo-pop3-commit spec)
441 (setq numbers (if elmo-pop3-use-uidl
443 (elmo-pop3-list-by-uidl-subr spec))
444 (elmo-pop3-list-by-list spec)))
445 (elmo-living-messages numbers killed)))
447 (defun elmo-pop3-max-of-folder (spec)
448 (elmo-pop3-commit spec)
449 (if elmo-pop3-use-uidl
450 (elmo-pop3-list-by-uidl-subr spec 'nonsort)
452 (elmo-network-session-process-internal
453 (elmo-pop3-get-session spec)))
456 (with-current-buffer (process-buffer process)
457 (elmo-pop3-send-command process "STAT")
458 (setq response (elmo-pop3-read-response process))
459 ;; response: "^\+OK 2 7570$"
460 (if (not (string-match "^\+OK[ \t]*\\([0-9]*\\)" response))
461 (error "POP STAT command failed")
464 (substring response (match-beginning 1)(match-end 1 ))))
465 (cons total total))))))
467 (defvar elmo-pop3-header-fetch-chop-length 200)
469 (defsubst elmo-pop3-next-result-arrived-p ()
471 ((eq (following-char) ?+)
472 (if (re-search-forward "\n\\.\r?\n" nil t)
476 (if (search-forward "\n" nil t)
482 (defun elmo-pop3-retrieve-headers (buffer tobuffer process articles)
486 (let ((number (length articles))
489 (last-point (point-min)))
490 ;; Send HEAD commands.
492 (elmo-pop3-send-command process (format
493 "top %s 0" (car articles))
495 ;;; (accept-process-output process 1)
496 (setq articles (cdr articles))
497 (setq count (1+ count))
498 ;; Every 200 requests we have to read the stream in
499 ;; order to avoid deadlocks.
500 (when (or elmo-pop3-send-command-synchronously
501 (null articles) ;All requests have been sent.
502 (zerop (% count elmo-pop3-header-fetch-chop-length)))
503 (unless elmo-pop3-send-command-synchronously
504 (accept-process-output process 1))
508 (goto-char last-point)
510 (while (elmo-pop3-next-result-arrived-p)
511 (setq last-point (point))
512 (setq received (1+ received)))
514 (when (> number elmo-display-progress-threshold)
515 (if (or (zerop (% received 5)) (= received number))
516 (elmo-display-progress
517 'elmo-pop3-retrieve-headers "Getting headers..."
518 (/ (* received 100) number))))
519 (accept-process-output process 1)
520 ;;; (accept-process-output process)
522 ;; Remove all "\r"'s.
523 (goto-char (point-min))
524 (while (search-forward "\r\n" nil t)
525 (replace-match "\n"))
526 (copy-to-buffer tobuffer (point-min) (point-max)))))
528 (defalias 'elmo-pop3-msgdb-create 'elmo-pop3-msgdb-create-as-numlist)
530 (defun elmo-pop3-sort-overview-by-original-number (overview loc-alist)
534 (< (elmo-pop3-uidl-to-number
535 (cdr (assq (elmo-msgdb-overview-entity-get-number ent1)
537 (elmo-pop3-uidl-to-number
538 (cdr (assq (elmo-msgdb-overview-entity-get-number ent2)
542 (defun elmo-pop3-sort-msgdb-by-original-number (msgdb)
543 (message "Sorting...")
544 (let ((overview (elmo-msgdb-get-overview msgdb)))
545 (setq overview (elmo-pop3-sort-overview-by-original-number
547 (elmo-msgdb-get-location msgdb)))
548 (message "Sorting...done")
549 (list overview (nth 1 msgdb)(nth 2 msgdb)(nth 3 msgdb)(nth 4 msgdb))))
551 (defun elmo-pop3-msgdb-create-as-numlist (spec numlist new-mark
552 already-mark seen-mark
553 important-mark seen-list
556 (let ((process (elmo-network-session-process-internal
557 (elmo-pop3-get-session spec)))
559 (if elmo-pop3-use-uidl
560 (setq loc-alist (if msgdb (elmo-msgdb-get-location msgdb)
561 (elmo-msgdb-location-load
562 (elmo-msgdb-expand-path spec)))))
563 (with-current-buffer (process-buffer process)
564 (elmo-pop3-sort-msgdb-by-original-number
565 (elmo-pop3-msgdb-create-by-header process numlist
566 new-mark already-mark
570 (defun elmo-pop3-uidl-to-number (uidl)
571 (string-to-number (elmo-get-hash-val uidl
572 elmo-pop3-uidl-number-hash)))
574 (defun elmo-pop3-number-to-uidl (number)
575 (elmo-get-hash-val (format "#%d" number)
576 elmo-pop3-number-uidl-hash))
578 (defun elmo-pop3-number-to-size (number)
579 (elmo-get-hash-val (format "#%d" number)
580 elmo-pop3-size-hash))
582 (defun elmo-pop3-msgdb-create-by-header (process numlist
583 new-mark already-mark
587 (let ((tmp-buffer (get-buffer-create " *ELMO Overview TMP*")))
588 (with-current-buffer (process-buffer process)
589 (if loc-alist ; use uidl.
595 (elmo-pop3-uidl-to-number (cdr (assq number loc-alist))))
597 (elmo-pop3-retrieve-headers (process-buffer process)
598 tmp-buffer process numlist)
600 (elmo-pop3-msgdb-create-message
605 new-mark already-mark seen-mark seen-list loc-alist)
606 (kill-buffer tmp-buffer)))))
608 (defun elmo-pop3-msgdb-create-message (buffer
611 numlist new-mark already-mark
616 (let (beg overview number-alist mark-alist
617 entity i number message-id gmark seen size)
619 (elmo-set-buffer-multibyte default-enable-multibyte-characters)
620 (goto-char (point-min))
622 (message "Creating msgdb...")
624 (setq beg (save-excursion (forward-line 1) (point)))
625 (elmo-pop3-next-result-arrived-p)
629 (narrow-to-region beg (point))
631 (elmo-msgdb-create-overview-from-buffer
633 (setq numlist (cdr numlist))
636 (elmo-msgdb-append-element
638 (with-current-buffer (process-buffer process)
639 (elmo-msgdb-overview-entity-set-size
642 (elmo-pop3-number-to-size
643 (elmo-msgdb-overview-entity-get-number entity))))
647 (elmo-pop3-number-to-uidl
648 (elmo-msgdb-overview-entity-get-number entity))
650 (elmo-msgdb-overview-entity-set-number entity number)))
652 (elmo-msgdb-number-add
654 (elmo-msgdb-overview-entity-get-number entity)
656 (setq message-id (car entity))
657 (setq seen (member message-id seen-list))
658 (if (setq gmark (or (elmo-msgdb-global-mark-get message-id)
659 (if (elmo-cache-exists-p
665 (if elmo-pop3-use-cache
669 (elmo-msgdb-mark-append
671 (elmo-msgdb-overview-entity-get-number entity)
673 (when (> num elmo-display-progress-threshold)
675 (if (or (zerop (% i 5)) (= i num))
676 (elmo-display-progress
677 'elmo-pop3-msgdb-create-message "Creating msgdb..."
678 (/ (* i 100) num)))))
679 (list overview number-alist mark-alist loc-alist))))
681 (defun elmo-pop3-read-body (process outbuf)
682 (with-current-buffer (process-buffer process)
683 (let ((start elmo-pop3-read-point)
686 (while (not (re-search-forward "^\\.\r?\n" nil t))
687 (accept-process-output process)
690 (with-current-buffer outbuf
692 (insert-buffer-substring (process-buffer process) start (- end 3))
693 (elmo-delete-cr-get-content-type)))))
695 (defun elmo-pop3-read-msg (spec number outbuf &optional msgdb unread)
696 (let* ((loc-alist (if elmo-pop3-use-uidl
698 (elmo-msgdb-get-location msgdb)
699 (elmo-msgdb-location-load
700 (elmo-msgdb-expand-path spec)))))
701 (process (elmo-network-session-process-internal
702 (elmo-pop3-get-session spec)))
704 (with-current-buffer (process-buffer process)
706 (setq number (elmo-pop3-uidl-to-number
707 (cdr (assq number loc-alist)))))
709 (elmo-pop3-send-command process
710 (format "retr %s" number))
711 (when (null (setq response (elmo-pop3-read-response
713 (error "Fetching message failed"))
714 (setq response (elmo-pop3-read-body process outbuf))
716 (goto-char (point-min))
717 (while (re-search-forward "^\\." nil t)
722 (defun elmo-pop3-delete-msg (process number loc-alist)
723 (with-current-buffer (process-buffer process)
724 (let (response errmsg msg)
726 (setq number (elmo-pop3-uidl-to-number
727 (cdr (assq number loc-alist)))))
730 (elmo-pop3-send-command process
731 (format "dele %s" number))
732 (when (null (setq response (elmo-pop3-read-response
734 (error "Deleting message failed")))
735 (error "Deleting message failed")))))
737 (defun elmo-pop3-delete-msgs (spec msgs &optional msgdb)
738 (let ((loc-alist (if elmo-pop3-use-uidl
740 (elmo-msgdb-get-location msgdb)
741 (elmo-msgdb-location-load
742 (elmo-msgdb-expand-path spec)))))
743 (process (elmo-network-session-process-internal
744 (elmo-pop3-get-session spec))))
745 (mapcar '(lambda (msg) (elmo-pop3-delete-msg
746 process msg loc-alist))
749 (defun elmo-pop3-search (spec condition &optional numlist)
750 (error "Searching in pop3 folder is not implemented yet"))
752 (defun elmo-pop3-use-cache-p (spec number)
755 (defun elmo-pop3-local-file-p (spec number)
758 (defun elmo-pop3-port-label (spec)
760 (if (elmo-pop3-spec-stream-type spec)
761 (concat "!" (symbol-name
762 (elmo-network-stream-type-symbol
763 (elmo-pop3-spec-stream-type spec)))))))
765 (defsubst elmo-pop3-portinfo (spec)
766 (list (elmo-pop3-spec-hostname spec)
767 (elmo-pop3-spec-port spec)))
769 (defun elmo-pop3-plugged-p (spec)
770 (apply 'elmo-plugged-p
771 (append (elmo-pop3-portinfo spec)
772 (list nil (quote (elmo-pop3-port-label spec))))))
774 (defun elmo-pop3-set-plugged (spec plugged add)
775 (apply 'elmo-set-plugged plugged
776 (append (elmo-pop3-portinfo spec)
777 (list nil nil (quote (elmo-pop3-port-label spec)) add))))
779 (defalias 'elmo-pop3-sync-number-alist
780 'elmo-generic-sync-number-alist)
781 (defalias 'elmo-pop3-list-folder-unread
782 'elmo-generic-list-folder-unread)
783 (defalias 'elmo-pop3-list-folder-important
784 'elmo-generic-list-folder-important)
785 (defalias 'elmo-pop3-folder-diff 'elmo-generic-folder-diff)
787 (defun elmo-pop3-commit (spec)
788 (if (elmo-pop3-plugged-p spec)
789 (let ((session (elmo-pop3-get-session spec 'if-exists)))
791 (elmo-network-close-session session)))))
795 (product-provide (provide 'elmo-pop3) (require 'elmo-version))
797 ;;; elmo-pop3.el ends here