imap

Homepage: https://www.gnu.org/software/emacs

Author: Simon Josefsson

Summary

Imap library

Commentary

imap.el is an elisp library providing an interface for talking to
IMAP servers.

imap.el is roughly divided in two parts, one that parses IMAP
responses from the server and storing data into buffer-local
variables, and one for utility functions which send commands to
server, waits for an answer, and return information.  The latter
part is layered on top of the previous.

The imap.el API consist of the following functions, other functions
in this file should not be called directly and the result of doing
so are at best undefined.

Global commands:

imap-open,       imap-opened,    imap-authenticate, imap-close,
imap-capability, imap-namespace, imap-error-text

Mailbox commands:

imap-mailbox-get,       imap-mailbox-map,         imap-current-mailbox,
imap-current-mailbox-p, imap-search,              imap-mailbox-select,
imap-mailbox-examine,   imap-mailbox-unselect,    imap-mailbox-expunge
imap-mailbox-close,     imap-mailbox-create,      imap-mailbox-delete
imap-mailbox-rename,    imap-mailbox-lsub,        imap-mailbox-list
imap-mailbox-subscribe, imap-mailbox-unsubscribe, imap-mailbox-status
imap-mailbox-acl-get,   imap-mailbox-acl-set,     imap-mailbox-acl-delete

Message commands:

imap-fetch-asynch,                 imap-fetch,
imap-current-message,              imap-list-to-message-set,
imap-message-get,                  imap-message-map
imap-message-envelope-date,        imap-message-envelope-subject,
imap-message-envelope-from,        imap-message-envelope-sender,
imap-message-envelope-reply-to,    imap-message-envelope-to,
imap-message-envelope-cc,          imap-message-envelope-bcc
imap-message-envelope-in-reply-to, imap-message-envelope-message-id
imap-message-body,                 imap-message-flag-permanent-p
imap-message-flags-set,            imap-message-flags-del
imap-message-flags-add,            imap-message-copyuid
imap-message-copy,                 imap-message-appenduid
imap-message-append,               imap-envelope-from
imap-body-lines

It is my hope that these commands should be pretty self
explanatory for someone who knows IMAP.  All functions have
additional documentation on how to invoke them.

imap.el supports RFC1730/2060/RFC3501 (IMAP4/IMAP4rev1).  The implemented
IMAP extensions are RFC2195 (CRAM-MD5), RFC2086 (ACL), RFC2342
(NAMESPACE), RFC2359 (UIDPLUS), the IMAP-part of RFC2595 (STARTTLS,
LOGINDISABLED), and the GSSAPI / Kerberos V4 sections of RFC1731
(with use of external program `imtest'), and RFC2971 (ID).  It also
takes advantage of the UNSELECT extension in Cyrus IMAPD.

Without the work of John McClary Prevost and Jim Radford this library
would not have seen the light of day.  Many thanks.

This is a transcript of a short interactive session for demonstration
purposes.

(imap-open "my.mail.server")
=> " *imap* my.mail.server:0"

The rest are invoked with current buffer as the buffer returned by
`imap-open'.  It is possible to do it all without this, but it would
look ugly here since `buffer' is always the last argument for all
imap.el API functions.

(imap-authenticate "myusername" "mypassword")
=> auth

(imap-mailbox-lsub "*")
=> ("INBOX.sentmail" "INBOX.private" "INBOX.draft" "INBOX.spam")

(imap-mailbox-list "INBOX.n%")
=> ("INBOX.namedroppers" "INBOX.nnimap" "INBOX.ntbugtraq")

(imap-mailbox-select "INBOX.nnimap")
=> "INBOX.nnimap"

(imap-mailbox-get 'exists)
=> 166

(imap-mailbox-get 'uidvalidity)
=> "908992622"

(imap-search "FLAGGED SINCE 18-DEC-98")
=> (235 236)

(imap-fetch 235 "RFC822.PEEK" 'RFC822)
=> "X-Sieve: cmu-sieve 1.3^M\nX-Username: ^M\r...."

Todo:

o Parse UIDs as strings? We need to overcome the 28 bit limit somehow.
  Use IEEE floats (which are effectively exact)?  -- fx
o Don't use `read' at all (important places already fixed)
o Accept list of articles instead of message set string in most
  imap-message-* functions.
o Send strings as literal if they contain, e.g., ".

Revision history:

 - 19991218 added starttls/digest-md5 patch,
            by Daiki Ueno 
            NB! you need SLIM for starttls.el and digest-md5.el
 - 19991023 committed to pgnus

Dependencies

Reverse dependencies