Function: imap-parse-greeting

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

Signature

(imap-parse-greeting)

Documentation

Parse an IMAP greeting.

Source Code

;; Defined in /usr/src/emacs/lisp/net/imap.el.gz
;;   greeting        = "*" SP (resp-cond-auth / resp-cond-bye) CRLF
;;
;;   resp-cond-auth  = ("OK" / "PREAUTH") SP resp-text
;;                       ; Authentication condition
;;
;;   resp-cond-bye   = "BYE" SP resp-text

(defun imap-parse-greeting ()
  "Parse an IMAP greeting."
  (cond ((looking-at "\\* OK ")
	 (setq imap-state 'nonauth))
	((looking-at "\\* PREAUTH ")
	 (setq imap-state 'auth))
	((looking-at "\\* BYE ")
	 (setq imap-state 'closed))))