# at.sovrn.mail.email

> One message in a mirrored mail folder, after the JMAP Email (RFC 8621 §4), with the raw RFC 5322 message as a blob. Content is immutable. Header fields longer or more numerous than the limits here are shortened; raw always has the whole message. The record key is the base32 (lowercase, unpadded) of the first 20 bytes of the raw message's SHA-256, so it is the same in every folder and can be recomputed from an export. The folder is the space, so there is no mailboxIds; keywords are not mirrored.

- Kind: record
- Record key: any
- Authority: mail.sovrn.at
- Lexicon: 1
- Published by [sovrn.at](https://lexicon.garden/identity/did:plc:54ba6vxrdbzi6nexczpk5xzb), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:54ba6vxrdbzi6nexczpk5xzb/at.sovrn.mail.email)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:54ba6vxrdbzi6nexczpk5xzb/at.sovrn.mail.email/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:54ba6vxrdbzi6nexczpk5xzb/at.sovrn.mail.email/analytics)

## Record (`at.sovrn.mail.email`)

Type: record · key any

### Properties

- `attachments` (array): JMAP attachments. The bytes are not stored separately: find each part in raw by partId.
  - Constraints: maxLength: 256
  - `items` (ref)
    - Reference: `at.sovrn.mail.defs#bodyPart`
- `bcc` (array)
  - Constraints: maxLength: 1000
  - `items` (ref)
    - Reference: `at.sovrn.mail.defs#emailAddress`
- `cc` (array)
  - Constraints: maxLength: 1000
  - `items` (ref)
    - Reference: `at.sovrn.mail.defs#emailAddress`
- `from` (array)
  - Constraints: maxLength: 128
  - `items` (ref)
    - Reference: `at.sovrn.mail.defs#emailAddress`
- `hasAttachment` (boolean): JMAP hasAttachment.
- `inReplyTo` (array): JMAP inReplyTo, without angle brackets.
  - Constraints: maxLength: 64
  - `items` (string)
    - Constraints: maxLength: 998
- `messageId` (array): JMAP messageId: the Message-ID header's msg-ids, without angle brackets.
  - Constraints: maxLength: 16
  - `items` (string)
    - Constraints: maxLength: 998
- `preview` (string): JMAP preview: plain text from the start of the body.
  - Constraints: maxLength: 1024, maxGraphemes: 256
- `raw` (blob, required): The message exactly as stored (JMAP blobId content). Parse MIME parts and full headers from here.
  - Constraints: maxSize: 104857600, accept: message/rfc822
- `receivedAt` (string · datetime, required): JMAP receivedAt: when the message arrived in the mailbox.
- `references` (array): JMAP references, without angle brackets.
  - Constraints: maxLength: 512
  - `items` (string)
    - Constraints: maxLength: 998
- `replyTo` (array)
  - Constraints: maxLength: 128
  - `items` (ref)
    - Reference: `at.sovrn.mail.defs#emailAddress`
- `sender` (array)
  - Constraints: maxLength: 16
  - `items` (ref)
    - Reference: `at.sovrn.mail.defs#emailAddress`
- `sentAt` (string · datetime): JMAP sentAt: the Date header, as the mail server reports it (it may be in UTC).
- `size` (integer): JMAP size: octets of the raw message.
  - Constraints: minimum: 0
- `source` (ref)
  - Reference: `at.sovrn.mail.defs#emailSource`
- `subject` (string): JMAP subject: the decoded Subject header.
  - Constraints: maxLength: 4096, maxGraphemes: 1000
- `to` (array)
  - Constraints: maxLength: 1000
  - `items` (ref)
    - Reference: `at.sovrn.mail.defs#emailAddress`

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "One message in a mirrored mail folder, after the JMAP Email (RFC 8621 §4), with the raw RFC 5322 message as a blob. Content is immutable. Header fields longer or more numerous than the limits here are shortened; raw always has the whole message. The record key is the base32 (lowercase, unpadded) of the first 20 bytes of the raw message's SHA-256, so it is the same in every folder and can be recomputed from an export. The folder is the space, so there is no mailboxIds; keywords are not mirrored.",
      "key": "any",
      "record": {
        "properties": {
          "attachments": {
            "description": "JMAP attachments. The bytes are not stored separately: find each part in raw by partId.",
            "items": {
              "ref": "at.sovrn.mail.defs#bodyPart",
              "type": "ref"
            },
            "maxLength": 256,
            "type": "array"
          },
          "bcc": {
            "items": {
              "ref": "at.sovrn.mail.defs#emailAddress",
              "type": "ref"
            },
            "maxLength": 1000,
            "type": "array"
          },
          "cc": {
            "items": {
              "ref": "at.sovrn.mail.defs#emailAddress",
              "type": "ref"
            },
            "maxLength": 1000,
            "type": "array"
          },
          "from": {
            "items": {
              "ref": "at.sovrn.mail.defs#emailAddress",
              "type": "ref"
            },
            "maxLength": 128,
            "type": "array"
          },
          "hasAttachment": {
            "description": "JMAP hasAttachment.",
            "type": "boolean"
          },
          "inReplyTo": {
            "description": "JMAP inReplyTo, without angle brackets.",
            "items": {
              "maxLength": 998,
              "type": "string"
            },
            "maxLength": 64,
            "type": "array"
          },
          "messageId": {
            "description": "JMAP messageId: the Message-ID header's msg-ids, without angle brackets.",
            "items": {
              "maxLength": 998,
              "type": "string"
            },
            "maxLength": 16,
            "type": "array"
          },
          "preview": {
            "description": "JMAP preview: plain text from the start of the body.",
            "maxGraphemes": 256,
            "maxLength": 1024,
            "type": "string"
          },
          "raw": {
            "accept": [
              "message/rfc822"
            ],
            "description": "The message exactly as stored (JMAP blobId content). Parse MIME parts and full headers from here.",
            "maxSize": 104857600,
            "type": "blob"
          },
          "receivedAt": {
            "description": "JMAP receivedAt: when the message arrived in the mailbox.",
            "format": "datetime",
            "type": "string"
          },
          "references": {
            "description": "JMAP references, without angle brackets.",
            "items": {
              "maxLength": 998,
              "type": "string"
            },
            "maxLength": 512,
            "type": "array"
          },
          "replyTo": {
            "items": {
              "ref": "at.sovrn.mail.defs#emailAddress",
              "type": "ref"
            },
            "maxLength": 128,
            "type": "array"
          },
          "sender": {
            "items": {
              "ref": "at.sovrn.mail.defs#emailAddress",
              "type": "ref"
            },
            "maxLength": 16,
            "type": "array"
          },
          "sentAt": {
            "description": "JMAP sentAt: the Date header, as the mail server reports it (it may be in UTC).",
            "format": "datetime",
            "type": "string"
          },
          "size": {
            "description": "JMAP size: octets of the raw message.",
            "minimum": 0,
            "type": "integer"
          },
          "source": {
            "ref": "at.sovrn.mail.defs#emailSource",
            "type": "ref"
          },
          "subject": {
            "description": "JMAP subject: the decoded Subject header.",
            "maxGraphemes": 1000,
            "maxLength": 4096,
            "type": "string"
          },
          "to": {
            "items": {
              "ref": "at.sovrn.mail.defs#emailAddress",
              "type": "ref"
            },
            "maxLength": 1000,
            "type": "array"
          }
        },
        "required": [
          "raw",
          "receivedAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "at.sovrn.mail.email",
  "lexicon": 1
}
```
