Next: , Previous: , Up: guile-email   [Index]


3 Data Types

guile-email provides data types for representing emails and MIME entities.

3.1 email data type

Data Type: <email> headers body

This is the data type representing emails.

Scheme Procedure: email? object
Scheme Procedure: email-headers email
Scheme Procedure: email-body email

Predicate and field accessors for the <email> data type.

Scheme Procedure: make-email headers body

Construct an <email> object. headers is an association list of email headers. body is either a string or a list of <mime-entity> objects.

3.2 mime-entity data type

Data Type: <mime-entity> headers body

This is the data type representing MIME entities.

Scheme Procedure: mime-entity? object
Scheme Procedure: mime-entity-headers mime-entity
Scheme Procedure: mime-entity-body mime-entity

Predicate and field accessors for the <mime-entity> data type.

Scheme Procedure: make-mime-entity headers body

Construct a mime-entity object. headers is an association list of MIME entity headers. body is either a string or a list of <mime-entity> objects.

3.3 email headers

The following descriptions of email headers are only a summary. Please see the relevant RFCs for more details.

3.3.1 email header types

Email Header Type: AssociationList

An association list of key-value pairs (see (guile)Association Lists). Keys are the name of the email header, downcased and converted to symbols. Values are specific to the header and explained below.

Email Header Type: Date

An SRFI-19 date. See (guile)SRFI-19 Date.

Email Header Type: Address

An association list of atmost two keys - ’name’ and ’address’. The values corresponding to these keys are explained below.

name

Display name of the email address. When the email address does not specifiy a display name, this key will be absent.

address

Actual email address.

Email Header Type: AddressList

A list of addresses, each of type ’Address’.

Email Header Type: MessageID

A string containing an email message ID with the surrounding angle brackets (‘<’ and ‘>’) removed. Email message IDs uniquely identify the email.

Email Header Type: MessageIDList

A list of message IDs, each of type MessageID.

3.3.2 email headers

Email Header: Date date

The date the email was sent on, as specified in the Date header.

Email Header: AddressList from

The list of authors of the email, as specified in the From header.

Email Header: Address sender

The sender of the email, as specified in the Sender header.

Email Header: AddressList reply-to

The list of addresses the author of the email suggests replies be sent to, as specified in the Reply-To header.

Email Header: AddressList to

The list of primary recipients of the email, as specified in the To header.

Email Header: AddressList cc

The list of other recipients of the email at whom the content of the email may not be directed, as specified in the Cc header.

Email Header: AddressList bcc

THe list of recipients whose address is not to be revealed to other recipients of the email, as specified in the Bcc header.

Email Header: MessageID message-id

The message ID of the email, as specified in the Message-ID header.

Email Header: MessageIDList in-reply-to

The list of message IDs of emails to which this email is a reply, as specified in the In-Reply-To header.

Email Header: MessageIDList references

The list of message IDs specified in the References header.

Email Header: String subject

A string identifying the topic of the email, as specified in the Subject header.

Email Header: String comments

A string containing additional comments on the body of the email, as specified in the Comments header.

Email Header: StringList keywords

A list of strings each an important word or phrase, as specified in the Keywords header.

Email Header: Date resent-date

The date at which the resent message was dispatched by the resender, as specified in the Resent-Date header.

Email Header: AddressList resent-from

The list of addresses specified in the Resent-From header.

Email Header: Address resent-sender

The address specified in the Resent-Sender header.

Email Header: AddressList resent-to

The list of addresses specified in the Resent-To header.

Email Header: AddressList resent-cc

The list of addresses specified in the Resent-Cc header.

Email Header: AddressList resent-bcc

The list of addresses specified in the Resent-Bcc header.

Email Header: MessageID resent-message-id

The message ID specified in the Resent-Message-ID header.

Email Header: String mime-version

The MIME version specified in the MIME-Version header.

Email Header: AssociationList content-type

The MIME type of the body, as specified in the Content-Type header, as an association list. The following keys always exist in the association list. Any additional parameters will also be listed as key-value pairs. Keys are names of the parameters, downcased and converted to symbols.

type

The primary type

subtype

The secondary type

charset

The charset

If no Content-Type header is present, a type of text, a subtype of plain and a charset of “utf-8” is assumed as the default. That is, the following:

((type . text)
 (subtype . plain)
 (charset . "utf-8"))
Email Header: AssociationList content-disposition

The content disposition type, as specified in the Content-Disposition header, as an association list. The following keys always exist in the association list.

type
inline
attachment

Other optional keys include

filename
creation-date
modification-date
read-date
size

Any additional parameters will also be listed as key-value pairs. Keys are names of the parameters, downcased and converted to symbols.

Email Header: Symbol content-transfer-encoding

The encoding of the body of the email as specified in the Content-Transfer-Encoding header. This can be one of the following symbols.

7bit

The message is 7-bit encoded. This is the default if no Content-Transfer-Encoding header is present.

8bit

The message is 8-bit encoded.

quoted-printable

The message is encoded using Quoted-Printable encoding.

base64

The message is encoded using Base64 encoding.

Note that guile-email automatically decodes the email. The user need not read the content-transfer-encoding and invoke the appropriate decoding procedure. The content-transfer-encoding header is only provided for the sake of completion.


Next: Encoding and Decoding, Previous: Parsing Email, Up: guile-email   [Index]