Common Lisp Package: CLONSIGNA

Simple IMAP4rev1 client library

README:

FUNCTION

Public

ENDS-WITH (END STR)

Functions that checks if the given STR ends with START regardless char case

MAKE-BODYSTRUCTURE (BODYSTRUCTURE-PLIST)

This function creates a BODYSTRUCTURE object on a PARSE-BODYSTRUCTURE result. See CMD-FETCH-FIELDS for more details.

MAKE-IMAP (&KEY (HOST 127.0.0.1) (PORT 143) (CRLF-P T) (SSL-P NIL))

Creates an IMAP-SOCKET object Paratmers: HOST Remote IMAP server address PORT Remote IMAP server port CRLF-P IMAP line termination (it should always be true as spec. by rfc3501) SSL-P When not null it instructs the client to connect to the server via SSL connection.

MOST-RECENTS-FROM-PARSED-THREAD (PARSED-THREAD)

This function returns the most recent message in a thread (by greatest ID or UID). See PARSE-THREAD documentation for more details.

PARSE-BODYSTRUCTURE (BODYSTRUCTURE)

This function parses a body structure returning a plist where keys are: :BODY :CID :ATTACHMENT :REPORT See CMD-FETCH-FIELDS form more details

PARSE-CAPABILITY (REPLY)

Function used to parse the result of CMD-CAPABILITY that returns a plist like the following: (:ACL2 ("UNION") :ACL (T) :IDLE (T) :QUOTA (T) :SORT (T) :THREAD ("ORDEREDSUBJECT" "REFERENCES") :NAMESPACE (T) :CHILDREN (T) :UIDPLUS (T) :IMAP4REV1 (T)) The result should be assigned to the CAPABILITIES slot of an IMAP-SOCKET object.

PARSE-EXAMINE (REPLY)

This function behaves exactly the same as PARSE-SELECT

PARSE-FETCH-BODY (LINE &KEY CHARSET ENCODING (STREAM NIL))

This function parses the result of a CMD-FETCH-BODY. It may be used to return the decoded body content string or to write it to the STREAM parameter. See CMD-FETCH-BODY fore more info. Parameters: LINE a string contained the body in encoded form. CHARSET when not null and when STREAM parameter is null it's the default charset for the output result. This parameter can be retrieved from the bodystructure of the message. ENCODING the encoding format parameter. This is usually retrieved from the bodystructure of the message. STREAM when not nil the parsing result is directed to this stream and functiono output becomes undefined. Result: When STREAM parameter is null, the decoded message string is returned. See CMD-FETCH-BODY for more info.

PARSE-FETCH-FIELDS (REPLY)

This function is used to parse CMD-FETCH-FIELDS result. See CMD-FETCH-FIELDS documentation for more details.

PARSE-LIST (REPLY)

This function is used to parse the result of CMD-LIST and produces a plist like the following: ((:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.Trash") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.maildir") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.Drafts") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.sent-mail") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.Sent"))

PARSE-LSUB (REPLY)

This function is used to parse the result of CMD-LSUB and produces a plist like the following: ((:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.Trash") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.maildir") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.Drafts") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.sent-mail") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.Sent"))

PARSE-NAMESPACE (REPLY)

This functions is used to parse the result of CMD-NAMESPACE. It returns a plist where keywords are :PERSONAL :OTHERS and :SHARED values are hashtables where key is the reference mailbox name and value is the delimiter.

PARSE-SELECT (REPLY)

This function is used to parse the result of CMD-SELECT and produces a plist like the one produced by CMD-STATUS so a plist with keywords: :EXISTS :RECENT :UNSEEN :PERMANENTFLAGS :UIDNEX :UIDVALIDITY :FLAGS is generated

PARSE-SORT (REPLY)

This function parses the result of a CMD-SORT and produces a list of ID or UID depending by the kind of the command.

PARSE-STATUS (REPLY)

This functions is used to parse the result of CMD-STATUS. It returns a plist that will be then used to update the status of the IMAP-SOCKET object. A parsed status plist is something like: (:MESSAGES 192 :RECENT 2 :UIDNEXT 6793 :UIDVALIDITY 1219826147 :UNSEEN 16)

PARSE-THREAD (REPLY)

This function is used to parse a CMD-THREAD result. a list of threads ID or UID is returned in descending order.

STARTS-WITH (START STR)

Functions that checks if the given STR starts with START regardless char case

Private

Undocumented

%ALTERNATIVE-FROM-TEXT-POSITION (BODYSTRUCTURE TEXT-POSITION)

%ALTERNATIVE-P (BODYSTRUCTURE)

%ATTACHMENT-P (BODYSTRUCTURE)

%ATTACHMENT-SECTIONS-FROM-BODYSTRUCTURE (BODYSTRUCTURE BODY-LIST-SECTION)

%BASE64-DECODE (STRING &KEY (EXTERNAL-FORMAT UTF-8) (STREAM NIL))

%CID-SECTIONS-FROM-BODYSTRUCTURE (BODYSTRUCTURE BODY-LIST-SECTION)

%GET-ID-LIST (REPLY)

%GOTO-SECTION (BODYSTRUCTURE SECTION)

%ID-UID-FLAGS (LINE)

%MAKE-STRUCTURE-ELEMENT (ELEMENT-PLIST)

%MAKE-TEXT-BODYSTRUCTURE (BODYSTRUCTURE-SECTION POSITION)

%MULTIPART-SUBTYPE (BODYSTRUCTURE)

%PARSE-BODY-PARAMETERS (PARAMETERS)

%PARSE-LIST (CMD REPLY)

%PARSE-REPLY-RESULT (LINE-SEPARATOR RESULT)

%PARSE-TAGGED-LINE (LINE MESSAGE-ID)

%QUOTED-CHAR-DECODE (CHAR-CODE &KEY (EXTERNAL-FORMAT UTF-8))

%QUOTED-DECODE (STRING &KEY (EXTERNAL-FORMAT UTF-8) (ATTRIBUTE-P T))

%READ-NAMESPACE-LIST (LINE)

%READ-NAMESPACE-NAMESPACE (LINE)

%REPORT-SECTIONS-FROM-BODYSTRUCTURE (BODYSTRUCTURE BODY-LIST-SECTION)

%SCAN-LINE-FOR-HEADERS (LINE)

%TEXT-POSITION (BODYSTRUCTURE)

%TEXT-SECTION-FROM-ALTERNATIVE (ALT-BODYSTRUCTURE POS)

%TEXT-SECTIONS-FROM-BODYSTRUCTURE (BODYSTRUCTURE)

CONVERT-TO-IMAP-LIST (LIST)

DECODE-HEADER-VALUE (STRING)

DECODE-STRING (STRING)

OCTETS-TO-STRING (VECTOR &KEY (EXTERNAL-FORMAT UTF-8) (START 0) END)

STRING-TO-OCTETS (STRING &KEY (EXTERNAL-FORMAT UTF-8) (START 0) END)

GENERIC-FUNCTION

Public

CMD-APPEND (IMAP-SOCKET MAILBOX-NAME MESSAGE &KEY FLAGS DATE (FLAGS NIL) (DATE NIL))

Performs an IMAP APPEND (rfc3501) command. MAILBOX-NAME The mailbox name where to append the message (can be a pathname) MASSAGE The message string in rfc2822 format. FLAGS A list of strings that are the flags for the message to append. DATE The date of the message (rfc2822) On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-AUTHENTICATE-PLAIN (IMAP-SOCKET LOGIN PASSWORD)

Performs an IMAP AUTHENTICATE PLAIN (rfc3501 and rfc4616) command as an alternative to LOGIN command. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-CAPABILITY (IMAP-SOCKET)

Performs an IMAP CAPABILITY (rfc3501) command. The result should usually be passed to the PARSE-CAPABILITY method that transforms it into a plist that will be then used to update the capabilities slot of the IMAP-SOCKET object. A parsed capability plist is something like: (:ACL2 ("UNION") :ACL (T) :IDLE (T) :QUOTA (T) :SORT (T) :THREAD ("ORDEREDSUBJECT" "REFERENCES") :NAMESPACE (T) :CHILDREN (T) :UIDPLUS (T) :IMAP4REV1 (T)) On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-CHECK (IMAP-SOCKET)

Performs an IMAP CHECK (rfc3501) command. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-CLOSE (IMAP-SOCKET)

Performs an IMAP CLOSE (rfc3501) command. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-CONNECT (IMAP-SOCKET)

This function is required to connect an IMAP-SOCKET object to an IMAP server. Depending on the passed parameter it can connect via IMAP or IMAP over ssl. After the connection has been succeded. The capabilities slot of the parameter object passed is filled. Return: Returns plist of capabilities got from the server like the following: (:STARTTLS (T) :ACL2 ("UNION") :ACL (T) :IDLE (T) :QUOTA (T) :SORT (T) :THREAD ("ORDEREDSUBJECT" "REFERENCES") :NAMESPACE (T) :CHILDREN (T) :UIDPLUS (T) :IMAP4REV1 (T))

CMD-CREATE (IMAP-SOCKET MAILBOX-NAME)

Performs an IMAP CREATE (rfc3501) command. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-DELETE (IMAP-SOCKET MAILBOX-NAME)

Performs an IMAP DELETE (rfc3501) command. MAILBOX-NAME parameter is the mailbox name to delete(can be a pathname). On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-EXAMINE (IMAP-SOCKET MAILBOX-NAME)

Performs an IMAP EXAMINE (rfc3501) command. MAILBOX-NAME parameter is the mailbox name to examine(can be a pathname). On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-EXPUNGE (IMAP-SOCKET)

Performs an IMAP EXPUNGE (rfc3501) command. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-FETCH (IMAP-SOCKET SEQUENCE-NUMBER &KEY CRITERIA UID-P (UID-P NIL))

Performs an IMAP FETCH or UID FETCH (rfc3501) command. SEQUENCE-NUMBER Sequence set as defined in rfc3501 ir a number or a list of numbers CRITERIA The fetching criteria as specified in rfc3501. UID-P When not null performs an UID FETCH instead of a simple FETCH command. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-FETCH-BODY (IMAP-SOCKET SEQUENCE-NUMBER &KEY SECTION UID-P)

Performs an IMAP FETCH BODY[<section>] or UID FETCH BODY[<section>] (rfc3501) command. The element result list is usually passed to the PARSE-FETCH-BODY function that decodes the reply. SEQUENCE-NUMBER Sequence set as defined in rfc3501 ir a number or a list of numbers SECTION The section to fetch that can passed in list of number form and internally transformed to the section (as described in rfc3501). UID-P When not null performs an UID FETCH instead of a simple FETCH command. Both for CMD-FETCH-BODY and for PARSE-FETCH-BODY a calls to CMD-FETCH-FIELDS -> PARSE-FETCH-FIELDS -> PARSE-BODYSTRUCTURE -> MAKE-BODYSTRUCTURE usually happen. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-FETCH-FIELDS (IMAP-SOCKET SEQUENCE-NUMBER &KEY FIELDS UID-P (FIELDS '(DATE FROM TO CC BCC SUBJECT MESSAGE-ID IN-REPLY-TO REFERENCES)) (UID-P NIL))

Performs an IMAP FETCH (FIELDS param) or UID FETCH (FIELDS param) (rfc3501) command. The result is usually passed to the PARSE-FETCH-FIELDS function that produces a plist like the follofing. ((:ID 1 :UID 7 :FLAGS (SEEN) :BODYSTRUCTURE ("text" "plain" ("charset" "utf-8") NIL NIL "8bit" 298 11 NIL NIL NIL) :HEADERS (:MESSAGE-ID "<200808270928.m7R9SDvK008347@apache-5.foo.com>" :DATE "Wed, 27 Aug 2008 12:28:08 +0300" :FROM "\"StartCom CertMaster\" <certmaster@foo.com>" :TO "destination@yourserver.com" :SUBJECT "Your Authentication Code, 27 Aug 2008 12:28"))) where :HEADERS is a plist of headers fields keywords and values where values are parsed into plain strings (following rfc2822 specs). The :BODYSTRUCTURE value can pe passed to PARSE-BODYSTRUCETURE function that produces a simplification of the bodystructure as a plist like this: (:BODY body-list :CID cid-list :ATTACHMENT attachment-list :REPORT report-list) each property value is in turn a plist. After the bodystructure has been parsed, the result can be passed to function MAKE-BODYSTRUCTURE function that instantiates a bodystructure instance. SEQUENCE-NUMBER Sequence set as defined in rfc3501 ir a number or a list of numbers CRITERIA The fetching criteria as specified in rfc3501. UID-P When not null performs an UID FETCH instead of a simple FETCH command. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-LIST (IMAP-SOCKET REFERENCE-NAME MAILBOX-NAME)

Performs an IMAP LIST (rfc3501) command. The result should usually be passed to the PARSE-LIST method that transforms it into a list of plist like the following: ((:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.Trash") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.maildir") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.Drafts") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.sent-mail") (:NAME-ATTRIBUTES ("HasNoChildren") :HIERARCHY-DELIMITER "." :NAME "INBOX.Sent")) REFERENCE-NAME the reference mailbox name (can be a pathname). MAILBOX-NAME the mailbox name (can be a pathname), or wildcards. If a parameter is null, it's converted to an empty string. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-LOGIN (IMAP-SOCKET LOGIN PASSWORD)

Performs an IMAP LOGIN (rfc3501) command. On success the client will be on an authenticated state and the return will be a triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-LOGOUT (IMAP-SOCKET)

Performs an IMAP LOGOUT (rfc3501) command and so after the connection will be closed. Returns a triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply

CMD-NAMESPACE (IMAP-SOCKET)

Performs an IMAP NAMESPACE (rfc2342) command. The result should usually be passed to the PARSE-NAMESPACE method that transforms it into a plist where keywords are :PERSONAL :OTHERS and :SHARED values are hashtables where key is the reference mailbox name and value is the delimiter. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-NOOP (IMAP-SOCKET)

Performs an IMAP NOOP (rfc3501) command. This command is usually used as a sort of `keep alive` and should be periodically called by a client application. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-RENAME (IMAP-SOCKET MAILBOX-NAME NEW-MAILBOX-NAME)

Performs an IMAP RENAME (rfc3501) command. MAILBOX-NAME parameter is the original mailbox name (can be a pathname). NEW-MAILBOX-NAME is the new mailbox name (can be a pathname). On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-SELECT (IMAP-SOCKET MAILBOX-NAME)

Performs an IMAP SELECT (rfc3501) command. MAILBOX-NAME parameter is the mailbox name to select(can be a pathname). The result can be parsed by the function PARSE-SELECT. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-SORT (IMAP-SOCKET &KEY SORT CRITERIA UID-P CHARSET (SORT ID) (CRITERIA all) (UID-P T) (CHARSET utf-8))

Performs an IMAP SORT or UID SORT (rfc5256) command. The result list is usually passed to the PARSE-SORT function that decodes the reply and returns a list of ID or UID with the given sort program. SORT is the sort program described in rfc5256. CRITERIA is the searching criteria as specified in rfc5256. UID-P when not nil performs an UID THREAD command. CHARSET is the charset specification for the criteria. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-STARTTLS (IMAP-SOCKET)

Performs an IMAP STARTTLS (rfc3501) command and performs the negotiation with the server. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-STATUS (IMAP-SOCKET MAILBOX-NAME &OPTIONAL STATUS-DATA-ITEM-NAMES)

Performs an IMAP STATUS (rfc3501) command. The result should usually be passed to the PARSE-STATUS method that transforms it into a plist that will be then used to update the status of the IMAP-SOCKET object. A parsed status plist is something like: (:MESSAGES 192 :RECENT 2 :UIDNEXT 6793 :UIDVALIDITY 1219826147 :UNSEEN 16) STATUS-DATA-ITEM-NAMES List of keyword for status data item names. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-SUBSCRIBE (IMAP-SOCKET MAILBOX-NAME)

Performs an IMAP SUBSCRIBE (rfc3501) command. MAILBOX-NAME parameter is the mailbox name to subscribe to(can be a pathname). On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-THREAD (IMAP-SOCKET &KEY THREAD CRITERIA UID-P CHARSET (THREAD references) (CRITERIA all) (UID-P T) (CHARSET utf-8))

Performs an IMAP THREAD or UID THREAD (rfc5256) command. The result list is usually passed to the PARSE-THREAD function that decodes the reply. The parsed result is arranged in descending order by ID or UID. THREAD is the threading algorithm that you can find inspecting the server capabilities. CRITERIA is the searching criteria as specified in rfc5256. UID-P when not nil performs an UID THREAD command. CHARSET is the charset specification for the criteria. On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

CMD-UNSUBSCRIBE (IMAP-SOCKET MAILBOX-NAME)

Performs an IMAP UNSUBSCRIBE (rfc3501) command. MAILBOX-NAME parameter is the mailbox name to unsubscribe to (can be a pathname). On success returns triplet of values: 1) reply list of strings 2) result-op alway OK 3) the result-op description (what comes after OK in the IMAP reply. On failure a condition of type OPERATIONAL-ERROR or SERVER-ERROR will be signaled.

IMAP-SOCKET-CONNECTED-P (IMAP-SOCKET)

This function is used to test if an IMAP-SOCKET object is connected to the server

IMAP-SOCKET-FLUSH-BUFFER (IMAP-SOCKET)

This method simply flush server messages discarding the reply. Ususally you will not need it but use the CMD-* command wrappers.

IMAP-SOCKET-HAS-CAPABILITY (IMAP-SOCKET CAPABILITY)

This function returns nil or a list of capabilities that the IMAP-SOCKET has stored from the server. CAPABILITY is a capability keyword. See CMD-CAPABILITY for more details

IMAP-SOCKET-READ-REPLY (IMAP-SOCKET)

This function is a generic function that is used to read a reply from an IMAP server after a command has been called ono the server. Ususally you will not need it but use the CMD-* command wrappers.

IMAP-SOCKET-SEND-COMMAND (IMAP-SOCKET COMMAND &REST ARGS)

This function is used to send generic commands to an IMAP server. It's mainly used by all CMD-* command wrappers.

IMAP-SOCKET-STATUS-CHANGED-P (IMAP-SOCKET STATUS)

This function returns a not null value if the IMAP-SOCKET last stored status is different from the one passed as parameter. Check is done on MESSAGES and UIDNEXT slot values. See CMD-STATUS for more details.

IMAP-SOCKET-UPDATE-STATUS (IMAP-SOCKET STATUS)

This function updates MESSAGES and UIDNEXT slot values of an IMAP-SOCKET object form the STATUS parameter. This function is often called after a call to IMAP-SOCKET-STATUS-CHANGED-P has returned a not null value. See CMD-STATUS for more details.

Undocumented

CMD-LSUB (IS REFERENCE-NAME MAILBOX-NAME)

Private

IMAP-SOCKET-MESSAGE-ID (IMAP-SOCKET)

This function returns the current message sequence number of an IMAP-SOCKET object (see rfc3501)

IMAP-SOCKET-NEXT-MESSAGE (IMAP-SOCKET)

This function increment the message sequence counter.

Undocumented

%EOL-P (IMAP-SOCKET CH)

%PATHNAME-TO-MAILBOX (IMAP-SOCKET PATHNAME &OPTIONAL ENDS-WITH-SEPARATOR-P)

%READ-LINE (IMAP-SOCKET)

%READ-LINE-CONTINUATION (IMAP-SOCKET LINE)

MESSAGE (CONDITION)

SLOT-ACCESSOR

Public

BODYSTRUCTURE-ATTACHMENT-LIST (OBJECT)

Holds the attachment elements in a list of STRUCTURE-ELEMENT objects.

SETFBODYSTRUCTURE-ATTACHMENT-LIST (NEW-VALUE OBJECT)

Holds the attachment elements in a list of STRUCTURE-ELEMENT objects.

BODYSTRUCTURE-BODY-LIST (OBJECT)

Holds the body elements in a list of STRUCTURE-ELEMENT objects.

SETFBODYSTRUCTURE-BODY-LIST (NEW-VALUE OBJECT)

Holds the body elements in a list of STRUCTURE-ELEMENT objects.

BODYSTRUCTURE-CID-LIST (OBJECT)

Holds the reference elements of a body element for inline content (as images) in a list of STRUCTURE-ELEMENT objects.

SETFBODYSTRUCTURE-CID-LIST (NEW-VALUE OBJECT)

Holds the reference elements of a body element for inline content (as images) in a list of STRUCTURE-ELEMENT objects.

IMAP-SOCKET-CAPABILITIES (OBJECT)

Stores the capabilities of the imap server after connection.

SETFIMAP-SOCKET-CAPABILITIES (NEW-VALUE OBJECT)

Stores the capabilities of the imap server after connection.

IMAP-SOCKET-MESSAGES (OBJECT)

Current messages number of the 'inbox' mailbox

IMAP-SOCKET-REMOTE-HOST (OBJECT)

IMAP server address

SETFIMAP-SOCKET-REMOTE-HOST (NEW-VALUE OBJECT)

IMAP server address

IMAP-SOCKET-REMOTE-PORT (OBJECT)

IMAP server port

SETFIMAP-SOCKET-REMOTE-PORT (NEW-VALUE OBJECT)

IMAP server port

IMAP-SOCKET-SOCKET (OBJECT)

Holds the socket stream

SETFIMAP-SOCKET-SOCKET (NEW-VALUE OBJECT)

Holds the socket stream

IMAP-SOCKET-UIDNEXT (OBJECT)

Current uidnext of the 'inbox' mailbox

STRUCTURE-ELEMENT-BODY-DESCRIPTION (OBJECT)

Holds the body description (rfc3501#7.4.2)

SETFSTRUCTURE-ELEMENT-BODY-DESCRIPTION (NEW-VALUE OBJECT)

Holds the body description (rfc3501#7.4.2)

STRUCTURE-ELEMENT-BODY-ENCODING (OBJECT)

Holds the body encoding type (rfc3501#7.4.2, rfc2822)

SETFSTRUCTURE-ELEMENT-BODY-ENCODING (NEW-VALUE OBJECT)

Holds the body encoding type (rfc3501#7.4.2, rfc2822)

STRUCTURE-ELEMENT-BODY-ID (OBJECT)

Holds the body id (rfc3501#7.4.2)

SETFSTRUCTURE-ELEMENT-BODY-ID (NEW-VALUE OBJECT)

Holds the body id (rfc3501#7.4.2)

STRUCTURE-ELEMENT-BODY-PARAMETERS (OBJECT)

Holds body parameters in a plist structure (you'll usually get the :charset from here)

SETFSTRUCTURE-ELEMENT-BODY-PARAMETERS (NEW-VALUE OBJECT)

Holds body parameters in a plist structure (you'll usually get the :charset from here)

STRUCTURE-ELEMENT-MIME-TYPE (OBJECT)

Holds the element mime-type

SETFSTRUCTURE-ELEMENT-MIME-TYPE (NEW-VALUE OBJECT)

Holds the element mime-type

STRUCTURE-ELEMENT-SECTION (OBJECT)

Holds a list of numbers that represents the element section. This list should then be passed to CMD-FETCH-BODY to get the current element.

SETFSTRUCTURE-ELEMENT-SECTION (NEW-VALUE OBJECT)

Holds a list of numbers that represents the element section. This list should then be passed to CMD-FETCH-BODY to get the current element.

Undocumented

IMAP-SOCKET-CRLF-P (OBJECT)

SETFIMAP-SOCKET-CRLF-P (NEW-VALUE OBJECT)

Private

BODYSTRUCTURE-REPORT-LIST (OBJECT)

Holds the repot elements in a list of STRUCTURE-ELEMENT objects.

SETFBODYSTRUCTURE-REPORT-LIST (NEW-VALUE OBJECT)

Holds the repot elements in a list of STRUCTURE-ELEMENT objects.

Undocumented

IMAP-SOCKET-COUNTER (OBJECT)

IMAP-SOCKET-LINE-SEPARATOR (OBJECT)

SETFIMAP-SOCKET-LINE-SEPARATOR (NEW-VALUE OBJECT)

IMAP-SOCKET-OTHERS-NAMESPACES (OBJECT)

SETFIMAP-SOCKET-OTHERS-NAMESPACES (NEW-VALUE OBJECT)

IMAP-SOCKET-PERSONAL-NAMESPACES (OBJECT)

SETFIMAP-SOCKET-PERSONAL-NAMESPACES (NEW-VALUE OBJECT)

IMAP-SOCKET-SHARED-NAMESPACES (OBJECT)

SETFIMAP-SOCKET-SHARED-NAMESPACES (NEW-VALUE OBJECT)

IMAP-SOCKET-SSL-P (OBJECT)

VARIABLE

Public

+DEBUG+

When true it outputs to the standard output the commands sent to the server.

CLASS

Public

BODYSTRUCTURE

After a bodystructure (rfc3501, rfc2822) has been parsed by PARSE-BODYSTRUCTURE function, this class maps the parsed plist. It is usually instantiated by MAKE-BODYSTRUCTURE function. See CMD-FETCH-FIELDS, PARSE-BODYSTRUCTURE, MAKE-BODYSTRUCTURE

IMAP-SOCKET

This class holds the connection to an IMAP server. It's usually instantiated by the MAKE-IMAP function and activated by CMD-CONNECT.

STRUCTURE-ELEMENT

This object may hold body, reference, attachment and message elements and should not be directly instantiated. (rfc3501#7.4.2) See CMD-FETCH-FIELDS, PARSE-BODYSTRUCTURE, MAKE-BODYSTRUCTURE

CONDITION

Public

OPERATIONAL-ERROR

Condition signaled on NO responses

SERVER-ERROR

Condition signaled on BAD responses

Private

Undocumented

ENCODING-ERROR

IMAP-ERROR