1 ;;; pop3.el --- Post Office Protocol (RFC 1460) interface
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
4 ;; Free Software Foundation, Inc.
6 ;; Author: Richard L. Pieri <ratinox@peorth.gweep.net>
7 ;; Daiki Ueno <ueno@ueda.info.waseda.ac.jp>
11 ;; This file is part of GNU Emacs.
13 ;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;; it under the terms of the GNU General Public License as published by
15 ;; the Free Software Foundation; either version 2, or (at your option)
18 ;; GNU Emacs is distributed in the hope that it will be useful,
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;; GNU General Public License for more details.
23 ;; You should have received a copy of the GNU General Public License
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;; Boston, MA 02111-1307, USA.
30 ;; Most of the standard Post Office Protocol version 3 (RFC 1460) commands
31 ;; are implemented. The LIST command has not been implemented due to lack
32 ;; of actual usefulness.
33 ;; The optional POP3 command TOP has not been implemented.
35 ;; This program was inspired by Kyle E. Jones's vm-pop program.
39 (eval-when-compile (require 'cl))
40 (eval-when-compile (require 'static))
44 (defvar pop3-maildrop (or (user-login-name) (getenv "LOGNAME") (getenv "USER") nil)
46 (defvar pop3-mailhost (or (getenv "MAILHOST") nil)
50 (defvar pop3-connection-type nil
51 "*POP3 connection type.")
53 (defvar pop3-password-required t
54 "*Non-nil if a password is required when connecting to POP server.")
55 (defvar pop3-password nil
56 "*Password to use when connecting to POP server.")
58 (defvar pop3-authentication-scheme 'pass
59 "*POP3 authentication scheme.
60 Defaults to 'pass, for the standard USER/PASS authentication. Other valid
63 (defvar pop3-timestamp nil
64 "Timestamp returned when initially connected to the POP server.
65 Used for APOP authentication.")
67 (defvar pop3-leave-mail-on-server nil
68 "Non-nil if mail is to be left on the server and UIDL used for message retrieval.")
70 (defvar pop3-maximum-message-size nil
71 "If non-nil only download messages smaller than this.")
73 (defvar pop3-except-header-regexp nil
74 "If non-nil we do not retrieve messages whose headers are matching this regexp.")
76 (defvar pop3-uidl-file-name "~/.uidls"
77 "File in which to store the UIDL of processed messages.")
79 (defvar pop3-uidl-support 'dont-know
80 "Whether the server supports UIDL.
81 Nil means no, t means yes, not-nil-or-t means yet to be determined.")
83 (defvar pop3-uidl-obarray (make-vector 31 0)
86 (defvar pop3-read-point nil)
87 (defvar pop3-debug nil)
90 (autoload 'open-ssl-stream "ssl")
91 (autoload 'starttls-open-stream "starttls")
92 (autoload 'starttls-negotiate "starttls"))
94 (defvar pop3-ssl-program-name
95 (if (exec-installed-p "openssl")
98 "The program to run in a subprocess to open an SSL connection.")
100 (defvar pop3-ssl-program-arguments
101 '("s_client" "-quiet")
102 "Arguments to be passed to the program `pop3-ssl-program-name'.")
104 (defun pop3-progress-message (format percent &rest args)
105 (apply (function message) format args))
107 (defun pop3-movemail (&optional crashbox)
108 "Transfer contents of a maildrop to the specified CRASHBOX."
109 (or crashbox (setq crashbox (expand-file-name "~/.crashbox")))
110 (let* ((process (pop3-open-server pop3-mailhost pop3-port))
111 (crashbuf (get-buffer-create " *pop3-retr*"))
114 (pop3-password pop3-password)
115 (pop3-uidl-file-name (convert-standard-filename
116 (concat pop3-uidl-file-name "-"
118 retrieved-messages messages)
119 ;; for debugging only
120 (if pop3-debug (switch-to-buffer (process-buffer process)))
121 ;; query for password
122 (if (and pop3-password-required (not pop3-password))
124 (pop3-read-passwd (format "Password for %s: " pop3-maildrop))))
125 (cond ((equal 'apop pop3-authentication-scheme)
126 (pop3-apop process pop3-maildrop))
127 ((equal 'pass pop3-authentication-scheme)
128 (pop3-user process pop3-maildrop)
130 (t (error "Invalid POP3 authentication scheme")))
131 ;; get messages that are suitable for download
132 (message "Retrieving message list...")
133 (setq messages (pop3-get-message-numbers process)
134 message-count (length (cdr messages)))
135 (message "Retrieving message list...%d of %d unread"
136 message-count (pop messages))
138 (unless (not (stringp crashbox))
140 (pop3-progress-message
141 "Retrieving message %d of %d (%d octets) from %s..."
142 (floor (* (/ (float n) message-count) 100))
143 n message-count (cdar messages) pop3-mailhost)
144 (pop3-retr process (caar messages) crashbuf)
145 (push (caar messages) retrieved-messages)
146 (setq messages (cdr messages)
148 (with-current-buffer crashbuf
149 (write-region-as-binary (point-min) (point-max)
150 crashbox 'append 'nomesg))
151 ;; mark messages as read
152 (when pop3-leave-mail-on-server
154 ;; now delete the messages we have retrieved
155 (unless pop3-leave-mail-on-server
156 (dolist (n retrieved-messages)
157 (message "Deleting message %d of %d from %s..."
158 n message-count pop3-mailhost)
159 (pop3-dele process n)))
162 (kill-buffer crashbuf)
165 (defun pop3-get-message-count ()
166 "Return the number of messages in the maildrop."
167 (let* ((process (pop3-open-server pop3-mailhost pop3-port))
169 (pop3-password pop3-password)
171 ;; for debugging only
172 (if pop3-debug (switch-to-buffer (process-buffer process)))
173 ;; query for password
174 (if (and pop3-password-required (not pop3-password))
176 (pop3-read-passwd (format "Password for %s: " pop3-maildrop))))
177 (cond ((equal 'apop pop3-authentication-scheme)
178 (pop3-apop process pop3-maildrop))
179 ((equal 'pass pop3-authentication-scheme)
180 (pop3-user process pop3-maildrop)
182 (t (error "Invalid POP3 authentication scheme")))
183 (setq message-count (car (pop3-stat process)))
187 (defun pop3-open-server (mailhost port)
188 "Open TCP connection to MAILHOST on PORT.
189 Returns the process associated with the connection.
190 Argument PORT specifies connecting port."
193 (set-buffer (get-buffer-create (concat " trace of POP session to "
196 (setq pop3-read-point (point-min))
200 ((eq pop3-connection-type 'ssl)
201 (pop3-open-ssl-stream "POP" (current-buffer) mailhost port))
202 ((eq pop3-connection-type 'tls)
203 (pop3-open-tls-stream "POP" (current-buffer) mailhost port))
205 (open-network-stream-as-binary "POP" (current-buffer)
207 (let ((response (pop3-read-response process t)))
209 (substring response (or (string-match "<" response) 0)
210 (+ 1 (or (string-match ">" response) -1)))))
213 (defun pop3-open-ssl-stream-1 (name buffer host service extra-arg)
215 (let* ((ssl-program-name
216 pop3-ssl-program-name)
217 (ssl-program-arguments
218 `(,@pop3-ssl-program-arguments
220 "-connect" ,(format "%s:%d" host service)))
221 (process (open-ssl-stream name buffer host service)))
223 (with-current-buffer buffer
224 (goto-char (point-min))
225 (while (and (memq (process-status process) '(open run))
226 (goto-char (point-max))
228 (not (looking-at "+OK")))
229 (accept-process-output process 1)
231 (delete-region (point-min) (point)))
232 (and process (memq (process-status process) '(open run))
235 (defun pop3-open-ssl-stream (name buffer host service)
236 "Open a SSL connection for a service to a host.
237 Returns a subprocess-object to represent the connection.
238 Args are NAME BUFFER HOST SERVICE."
239 (cond ((eq system-type 'windows-nt)
240 (let (selective-display
241 (coding-system-for-write 'binary)
242 (coding-system-for-read 'raw-text-dos))
243 (or (pop3-open-ssl-stream-1 name buffer host service "-ssl3")
244 (pop3-open-ssl-stream-1 name buffer host service "-ssl2"))))
247 (or (pop3-open-ssl-stream-1 name buffer host service "-ssl3")
248 (pop3-open-ssl-stream-1 name buffer host service "-ssl2"))))))
250 (defun pop3-open-tls-stream (name buffer host service)
251 "Open a TLSv1 connection for a service to a host.
252 Returns a subprocess-object to represent the connection.
253 Args are NAME BUFFER HOST SERVICE."
255 (as-binary-process (starttls-open-stream
256 name buffer host service))))
258 (starttls-negotiate process)
263 (defun pop3-process-filter (process output)
265 (set-buffer (process-buffer process))
266 (goto-char (point-max))
269 (defun pop3-send-command (process command)
270 (set-buffer (process-buffer process))
271 (goto-char (point-max))
272 ;; (if (= (aref command 0) ?P)
273 ;; (insert "PASS <omitted>\r\n")
274 ;; (insert command "\r\n"))
275 (setq pop3-read-point (point))
276 (goto-char (point-max))
277 (process-send-string process (concat command "\r\n"))
280 (defun pop3-read-response (process &optional return)
281 "Read the response from the server PROCESS.
282 Return the response string if optional second argument RETURN is non-nil."
283 (let ((case-fold-search nil)
286 (set-buffer (process-buffer process))
287 (goto-char pop3-read-point)
288 (while (not (search-forward "\r\n" nil t))
289 (accept-process-output process 3)
290 (goto-char pop3-read-point))
291 (setq match-end (point))
292 (goto-char pop3-read-point)
293 (if (looking-at "-ERR")
294 (error (buffer-substring (point) (- match-end 2)))
295 (if (not (looking-at "+OK"))
296 (progn (setq pop3-read-point match-end) nil)
297 (setq pop3-read-point match-end)
299 (buffer-substring (point) match-end)
303 (defvar pop3-read-passwd nil)
304 (defun pop3-read-passwd (prompt)
305 (if (not pop3-read-passwd)
306 (if (fboundp 'read-passwd)
307 (setq pop3-read-passwd 'read-passwd)
308 (if (load "passwd" t)
309 (setq pop3-read-passwd 'read-passwd)
310 (autoload 'ange-ftp-read-passwd "ange-ftp")
311 (setq pop3-read-passwd 'ange-ftp-read-passwd))))
312 (funcall pop3-read-passwd prompt))
314 (defun pop3-clean-region (start end)
315 (setq end (set-marker (make-marker) end))
318 (while (and (< (point) end) (search-forward "\r\n" end t))
319 (replace-match "\n" t t))
321 (while (re-search-forward "\n\n\\(From \\)" end t)
322 (replace-match "\n\n>\\1" t nil))
324 (while (and (< (point) end) (re-search-forward "^\\." end t))
325 (replace-match "" t t)
327 (set-marker end nil))
329 (eval-when-compile (defvar parse-time-months))
331 ;; Copied from message-make-date.
332 (defun pop3-make-date (&optional now)
333 "Make a valid date header.
334 If NOW, use that time instead."
335 (require 'parse-time)
336 (let* ((now (or now (current-time)))
337 (zone (nth 8 (decode-time now)))
341 (setq zone (- zone)))
343 (format-time-string "%d" now)
344 ;; The month name of the %b spec is locale-specific. Pfff.
346 (capitalize (car (rassoc (nth 4 (decode-time now))
347 parse-time-months))))
348 (format-time-string "%Y %H:%M:%S " now)
349 ;; We do all of this because XEmacs doesn't have the %z spec.
350 (format "%s%02d%02d" sign (/ zone 3600) (/ (% zone 3600) 60)))))
352 (defun pop3-munge-message-separator (start end)
353 "Check to see if a message separator exists. If not, generate one."
356 (narrow-to-region start end)
357 (goto-char (point-min))
358 (if (not (or (looking-at "From .?") ; Unix mail
359 (looking-at "\001\001\001\001\n") ; MMDF
360 (looking-at "BABYL OPTIONS:") ; Babyl
362 (let ((from (mail-strip-quoted-names (mail-fetch-field "From")))
363 (date (split-string (or (mail-fetch-field "Date")
367 ;; sample date formats I have seen
368 ;; Date: Tue, 9 Jul 1996 09:04:21 -0400 (EDT)
369 ;; Date: 08 Jul 1996 23:22:24 -0400
371 ;; Tue Jul 9 09:04:21 1996
373 (cond ((string-match "[A-Z]" (nth 0 date))
374 (format "%s %s %s %s %s"
375 (nth 0 date) (nth 2 date) (nth 1 date)
376 (nth 4 date) (nth 3 date)))
378 ;; this really needs to be better but I don't feel
379 ;; like writing a date to day converter.
380 (format "Sun %s %s %s %s"
381 (nth 1 date) (nth 0 date)
382 (nth 3 date) (nth 2 date)))
384 (setq From_ (format "\nFrom %s %s\n" from date))
385 (while (string-match "," From_)
386 (setq From_ (concat (substring From_ 0 (match-beginning 0))
387 (substring From_ (match-end 0)))))
388 (goto-char (point-min))
390 (if (search-forward "\n\n" nil t)
392 (goto-char (point-max))
394 (narrow-to-region (point) (point-max))
395 (let ((size (- (point-max) (point-min))))
396 (goto-char (point-min))
399 (insert (format "Content-Length: %s\n" size)))
404 (defun pop3-get-message-numbers (process)
405 "Get the list of message numbers and lengths to retrieve via PROCESS."
406 ;; we use the LIST comand first anyway to get the message lengths.
407 ;; then if we're leaving mail on the server, see if the UIDL command
408 ;; is implemented. if so, we use it to get the message number list.
409 (let* ((messages (pop3-list process))
410 (total (or (pop messages) 0))
411 (uidl (if pop3-leave-mail-on-server
412 (pop3-get-uidl process)))
415 ;; only retrieve messages matching our regexp or in the uidl list
417 ;; remove elements not in the uidl, this assumes the uidl is short
418 (or (not (eq pop3-uidl-support t))
419 (memq (caar messages) uidl))
421 ;; don't download messages that are too large
422 (not (and pop3-maximum-message-size
423 (> (cdar messages) pop3-maximum-message-size)))
424 (not (and pop3-except-header-regexp
425 (string-match pop3-except-header-regexp
426 (pop3-top process (caar messages) 0)))))
427 (push (car messages) out))
428 (setq messages (cdr messages)))
429 (cons total (reverse out))))
431 (defun pop3-get-uidl (process)
432 "Use PROCESS to get a list of unread message numbers."
433 (let ((messages (pop3-uidl process)) uidl)
434 (if (or (null messages) (null pop3-uidl-support))
435 (setq pop3-uidl-support nil)
436 (setq pop3-uidl-support t)
439 (when (file-readable-p pop3-uidl-file-name)
440 (insert-file-contents pop3-uidl-file-name))
441 (goto-char (point-min))
442 (while (looking-at "\\([^ \n\t]+\\)")
443 (set (intern (match-string 1) pop3-uidl-obarray)
447 (dolist (message (cdr messages))
448 (if (setq uidl (intern-soft (cdr message) pop3-uidl-obarray))
449 (setcar (symbol-value uidl) (car message))
450 (set (intern (cdr message) pop3-uidl-obarray)
451 (cons (car message) nil))))
452 (pop3-get-unread-message-numbers))
455 (defun pop3-get-unread-message-numbers ()
456 "Return a sorted list of unread msg numbers to retrieve."
458 (mapatoms (lambda (atom)
459 (if (not (cdr (symbol-value atom)))
460 (push (car (symbol-value atom)) nums)))
464 (defun pop3-save-uidls ()
465 "Save the updated UIDLs to disk for use next time."
466 (when (and pop3-leave-mail-on-server
467 ;; UIDL hash table is non-empty
468 (let ((len (length pop3-uidl-obarray)))
470 (setq len (if (symbolp (aref pop3-uidl-obarray (1- len)))
473 (when (file-readable-p pop3-uidl-file-name)
474 (copy-file pop3-uidl-file-name
475 (concat pop3-uidl-file-name ".old")
476 'overwrite 'keeptime))
478 (with-temp-file pop3-uidl-file-name
481 (when (car (symbol-value atom))
482 (insert (format "%s\n" atom))))
484 (fillarray pop3-uidl-obarray 0)))
489 ;; AUTHORIZATION STATE
491 (defun pop3-user (process user)
492 "Send USER information to POP3 server."
493 (pop3-send-command process (format "USER %s" user))
494 (let ((response (pop3-read-response process t)))
495 (if (not (and response (string-match "+OK" response)))
496 (error (format "USER %s not valid" user)))))
498 (defun pop3-pass (process)
499 "Send authentication information to the server."
500 (pop3-send-command process (format "PASS %s" pop3-password))
501 (let ((response (pop3-read-response process t)))
502 (if (not (and response (string-match "+OK" response)))
503 (pop3-quit process))))
505 (static-unless (and (fboundp 'md5) (subrp (symbol-function 'md5)))
508 (if (module-installed-p 'md5)
510 (autoload 'md5 "md5")
511 (fset 'pop3-md5 'md5))
513 (defvar pop3-md5-program "md5"
514 "*Program to encode its input in MD5.")
516 (defun pop3-md5 (string)
519 (call-process-region (point-min) (point-max)
520 (or shell-file-name "/bin/sh")
521 t (current-buffer) nil
522 "-c" pop3-md5-program)
523 ;; The meaningful output is the first 32 characters.
524 ;; Don't return the newline that follows them!
525 (buffer-substring (point-min) (+ (point-min) 32))))
528 (defun pop3-apop (process user)
529 "Send alternate authentication information to the server."
530 (let ((pass pop3-password))
531 (if (and pop3-password-required (not pass))
533 (pop3-read-passwd (format "Password for %s: " pop3-maildrop))))
535 (let ((hash (static-if (and (fboundp 'md5)
536 (subrp (symbol-function 'md5)))
537 (md5 (concat pop3-timestamp pass))
538 (pop3-md5 (concat pop3-timestamp pass)))))
539 (pop3-send-command process (format "APOP %s %s" user hash))
540 (let ((response (pop3-read-response process t)))
541 (if (not (and response (string-match "+OK" response)))
542 (pop3-quit process)))))
545 (defun pop3-stls (process)
546 "Query whether TLS extension is supported"
547 (pop3-send-command process "STLS")
548 (let ((response (pop3-read-response process t)))
549 (if (not (and response (string-match "+OK" response)))
550 (pop3-quit process))))
554 (defun pop3-stat (process)
555 "Return the number of messages in the maildrop and the maildrop's size."
556 (pop3-send-command process "STAT")
557 (let ((response (pop3-read-response process t)))
558 (list (string-to-int (nth 1 (split-string response " ")))
559 (string-to-int (nth 2 (split-string response " "))))
562 (defun pop3-retr (process msg crashbuf)
563 "Retrieve message-id MSG to buffer CRASHBUF."
564 (pop3-send-command process (format "RETR %s" msg))
565 (pop3-read-response process)
567 (let ((region (pop3-get-extended-response process)))
568 (pop3-munge-message-separator (car region) (cadr region))
569 (append-to-buffer crashbuf (car region) (cadr region))
570 (delete-region (car region) (cadr region))
573 (defun pop3-dele (process msg)
574 "Mark message-id MSG as deleted."
575 (pop3-send-command process (format "DELE %s" msg))
576 (pop3-read-response process))
578 (defun pop3-noop (process msg)
580 (pop3-send-command process "NOOP")
581 (pop3-read-response process))
583 (defun pop3-last (process)
584 "Return highest accessed message-id number for the session."
585 (pop3-send-command process "LAST")
586 (let ((response (pop3-read-response process t)))
587 (string-to-int (nth 1 (split-string response " ")))
590 (defun pop3-rset (process)
591 "Remove all delete marks from current maildrop."
592 (pop3-send-command process "RSET")
593 (pop3-read-response process))
597 (defun pop3-quit (process)
598 "Close connection to POP3 server.
599 Tell server to remove all messages marked as deleted, unlock the maildrop,
600 and close the connection."
601 (pop3-send-command process "QUIT")
602 (pop3-read-response process t)
605 (set-buffer (process-buffer process))
606 (goto-char (point-max))
607 (delete-process process))))
609 (defun pop3-uidl (process &optional msgno)
610 "Return the results of a UIDL command in PROCESS for optional MSGNO.
611 If UIDL is unsupported on this mail server or if msgno is invalid, return nil.
612 Otherwise, return a list in the form
614 (N (1 UIDL-1) (2 UIDL-2) ... (N UIDL-N))
618 N is an integer for the number of UIDLs returned (could be 0)
622 (pop3-send-command process (format "UIDL %d" msgno))
623 (pop3-send-command process "UIDL"))
625 (if (null (pop3-read-response process t))
626 nil ;; UIDL is not supported on this server
630 (apply 'narrow-to-region (pop3-get-extended-response process))
631 (goto-char (point-min))
632 (while (looking-at "\\([^ \n\t]*\\) \\([^ \n\t]*\\)")
633 (setq msgno (string-to-int (match-string 1))
634 uidl (match-string 2))
635 (push (cons msgno uidl) pairs)
636 (beginning-of-line 2))
637 (cons (length pairs) (nreverse pairs))
640 (defun pop3-list (process &optional msgno)
641 "Return the results of a LIST command for PROCESS and optional MSGNO.
642 If (optional) msgno is invalid, return nil. Otherwise, return a list
645 (N (1 LEN-1) (2 LEN-2) ... (N LEN-N))
649 N is an integer for the number of msg/len pairs (could be 0)
650 LEN-n is an integer."
652 (pop3-send-command process (format "LIST %d" msgno))
653 (pop3-send-command process "LIST"))
655 (if (null (pop3-read-response process t))
656 nil ;; MSGNO is not valid number
660 (apply 'narrow-to-region (pop3-get-extended-response process))
661 (goto-char (point-min))
662 (while (looking-at "\\([^ \n\t]*\\) \\([^ \n\t]*\\)")
663 (setq msgno (string-to-int (match-string 1))
664 len (string-to-int (match-string 2)))
665 (push (cons msgno len) pairs)
666 (beginning-of-line 2))
667 (cons (length pairs) (nreverse pairs))
670 (defun pop3-top (process msgno &optional lines)
671 "Return the top LINES of messages for PROCESS and MSGNO.
672 If msgno is invalid, return nil. Otherwise, return a string."
673 (pop3-send-command process (format "TOP %d %d" msgno (or lines 1)))
674 (if (pop3-read-response process t)
675 nil ;; MSGNO is not valid number
677 (apply 'buffer-substring (pop3-get-extended-response process)))
682 (defun pop3-get-extended-response (process)
683 "Get the extended pop3 response in the PROCESS buffer."
684 (let ((start pop3-read-point) end)
685 (set-buffer (process-buffer process))
687 (while (not (re-search-forward "^\\.\r\n" nil t))
688 (accept-process-output process 3)
690 (setq pop3-read-point (point-marker))
691 (goto-char (match-beginning 0))
692 (setq end (point-marker))
693 (pop3-clean-region start end)
697 ;; Summary of POP3 (Post Office Protocol version 3) commands and responses
699 ;;; AUTHORIZATION STATE
701 ;; Initial TCP connection
703 ;; Restrictions: none
704 ;; Possible responses:
705 ;; +OK [POP3 server ready]
708 ;; Arguments: a server specific user-id (required)
709 ;; Restrictions: authorization state [after unsuccessful USER or PASS
710 ;; Possible responses:
711 ;; +OK [valid user-id]
712 ;; -ERR [invalid user-id]
715 ;; Arguments: a server/user-id specific password (required)
716 ;; Restrictions: authorization state, after successful USER
717 ;; Possible responses:
718 ;; +OK [maildrop locked and ready]
719 ;; -ERR [invalid password]
720 ;; -ERR [unable to lock maildrop]
724 ;; Restrictions: authorization state
725 ;; Possible responses:
726 ;; +OK [negotiation is ready]
727 ;; -ERR [security layer is already active]
729 ;;; TRANSACTION STATE
733 ;; Restrictions: transaction state
734 ;; Possible responses:
735 ;; +OK nn mm [# of messages, size of maildrop]
738 ;; Arguments: a message-id (optional)
739 ;; Restrictions: transaction state; msg must not be deleted
740 ;; Possible responses:
741 ;; +OK [scan listing follows]
742 ;; -ERR [no such message]
745 ;; Arguments: a message-id (required), number of lines (optional)
746 ;; Restrictions: transaction state; msg must not be deleted
747 ;; Possible responses:
748 ;; +OK [partial message listing follows]
749 ;; -ERR [no such message]
752 ;; Arguments: a message-id (optional)
753 ;; Restrictions: transaction state; msg must not be deleted
754 ;; Possible responses:
755 ;; +OK [uidl listing follows]
756 ;; -ERR [no such message]
759 ;; Arguments: a message-id (required)
760 ;; Restrictions: transaction state; msg must not be deleted
761 ;; Possible responses:
762 ;; +OK [message contents follow]
763 ;; -ERR [no such message]
766 ;; Arguments: a message-id (required)
767 ;; Restrictions: transaction state; msg must not be deleted
768 ;; Possible responses:
769 ;; +OK [message deleted]
770 ;; -ERR [no such message]
774 ;; Restrictions: transaction state
775 ;; Possible responses:
780 ;; Restrictions: transaction state
781 ;; Possible responses:
782 ;; +OK nn [highest numbered message accessed]
786 ;; Restrictions: transaction state
787 ;; Possible responses:
788 ;; +OK [all delete marks removed]
794 ;; Restrictions: none
795 ;; Possible responses:
796 ;; +OK [TCP connection closed]
800 ;;; pop3.el ends here