Function: imap-fetch

imap-fetch is a byte-compiled function defined in imap.el.gz.

Signature

(imap-fetch UIDS PROPS &optional RECEIVE NOUIDFETCH BUFFER)

Documentation

Fetch properties PROPS from message set UIDS from server in BUFFER.

UIDS can be a string, number or a list of numbers. If RECEIVE is non-nil, return these properties.

Source Code

;; Defined in /usr/src/emacs/lisp/net/imap.el.gz
(defun imap-fetch (uids props &optional receive nouidfetch buffer)
  "Fetch properties PROPS from message set UIDS from server in BUFFER.
UIDS can be a string, number or a list of numbers.  If RECEIVE is
non-nil, return these properties."
  (with-current-buffer (or buffer (current-buffer))
    (when (imap-ok-p (imap-send-command-wait
		      (format "%sFETCH %s %s" (if nouidfetch "" "UID ")
			      (if (listp uids)
				  (imap-list-to-message-set uids)
				uids)
			      props)))
      (if (or (null receive) (stringp uids))
	  t
	(if (listp uids)
	    (mapcar (lambda (uid)
		      (if (listp receive)
			  (mapcar (lambda (prop)
				    (imap-message-get uid prop))
				  receive)
			(imap-message-get uid receive)))
		    uids)
	  (imap-message-get uids receive))))))