My agentic slop goes here. Not intended for anyone else!

Query 9: Identity Management and Email Sending Configuration#

Use Case Description#

Retrieve all configured email identities and examine recent email submissions to understand which identities are being used for different types of communications. This demonstrates identity management and submission tracking.

Key JMAP Concepts Used#

  • Identity/get: Retrieving all configured sending identities
  • Identity configuration: Understanding sender profiles, signatures, and permissions
  • EmailSubmission correlation: Linking submissions to specific identities
  • Multi-identity workflows: Managing different sending personas
  • Signature and formatting: Understanding identity-specific content

JMAP Request#

{
  "using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"],
  "methodCalls": [
    [
      "Identity/get",
      {
        "accountId": "u12345678",
        "ids": null
      },
      "id0"
    ],
    [
      "EmailSubmission/query", 
      {
        "accountId": "u12345678",
        "filter": {
          "after": "2024-08-20T00:00:00Z"
        },
        "sort": [
          {
            "property": "created",
            "isAscending": false
          }
        ],
        "limit": 20
      },
      "sub0"
    ],
    [
      "EmailSubmission/get",
      {
        "accountId": "u12345678",
        "#ids": {
          "resultOf": "sub0",
          "name": "EmailSubmission/query", 
          "path": "/ids"
        },
        "properties": [
          "id", "emailId", "identityId", "envelope", "created",
          "deliveryStatus"
        ]
      },
      "subg0"
    ],
    [
      "Email/get",
      {
        "accountId": "u12345678",
        "#ids": {
          "resultOf": "subg0",
          "name": "EmailSubmission/get",
          "path": "/list/*/emailId"
        },
        "properties": [
          "id", "from", "to", "cc", "subject", "sentAt", "preview"
        ]
      },
      "eg0"
    ]
  ]
}

Expected Response Structure#

{
  "methodResponses": [
    [
      "Identity/get",
      {
        "accountId": "u12345678",
        "state": "id9876543218",
        "list": [
          {
            "id": "I1",
            "name": "John Doe", 
            "email": "john.doe@company.com",
            "replyTo": null,
            "bcc": null,
            "textSignature": "John Doe\nSenior Software Engineer\nTech Company Inc.\nPhone: (555) 123-4567\njohn.doe@company.com",
            "htmlSignature": "<div style=\"font-family: Arial, sans-serif;\"><strong>John Doe</strong><br>Senior Software Engineer<br>Tech Company Inc.<br>Phone: (555) 123-4567<br><a href=\"mailto:john.doe@company.com\">john.doe@company.com</a></div>",
            "mayDelete": false
          },
          {
            "id": "I2",
            "name": "John D.",
            "email": "j.doe@personal.com", 
            "replyTo": null,
            "bcc": null,
            "textSignature": "Best regards,\nJohn",
            "htmlSignature": "<p><em>Best regards,<br>John</em></p>",
            "mayDelete": true
          },
          {
            "id": "I3", 
            "name": "John Doe - Support Team",
            "email": "support@company.com",
            "replyTo": [{"email": "support@company.com", "name": "Customer Support"}],
            "bcc": [{"email": "support-archive@company.com", "name": "Support Archive"}],
            "textSignature": "John Doe\nCustomer Support Specialist\nTech Company Inc.\n\nFor immediate assistance:\n- Phone: (555) 123-HELP\n- Portal: https://support.company.com\n- Hours: Mon-Fri 9am-6pm EST",
            "htmlSignature": "<div style=\"border-top: 2px solid #0066cc; padding-top: 10px; font-family: Arial, sans-serif;\"><strong>John Doe</strong><br>Customer Support Specialist<br><strong style=\"color: #0066cc;\">Tech Company Inc.</strong><br><br><strong>For immediate assistance:</strong><br>📞 Phone: <a href=\"tel:+15551234357\">(555) 123-HELP</a><br>🌐 Portal: <a href=\"https://support.company.com\">support.company.com</a><br>🕒 Hours: Mon-Fri 9am-6pm EST</div>",
            "mayDelete": true
          }
        ],
        "notFound": []
      },
      "id0"
    ],
    [
      "EmailSubmission/query",
      {
        "accountId": "u12345678",
        "queryState": "sq1234567897",
        "canCalculateChanges": true,
        "position": 0,
        "ids": ["ES301", "ES302", "ES303", "ES304", "ES305"],
        "total": 23,
        "limit": 20
      },
      "sub0"
    ],
    [
      "EmailSubmission/get",
      {
        "accountId": "u12345678",
        "state": "s9876543218",
        "list": [
          {
            "id": "ES301",
            "emailId": "Memail601", 
            "identityId": "I1",
            "envelope": {
              "mailFrom": "john.doe@company.com",
              "rcptTo": ["team@company.com"]
            },
            "created": "2024-08-24T16:30:00Z",
            "deliveryStatus": {
              "team@company.com": "delivered"
            }
          },
          {
            "id": "ES302",
            "emailId": "Memail602",
            "identityId": "I3", 
            "envelope": {
              "mailFrom": "support@company.com",
              "rcptTo": ["customer@client.com", "support-archive@company.com"]
            },
            "created": "2024-08-24T14:15:00Z",
            "deliveryStatus": {
              "customer@client.com": "delivered",
              "support-archive@company.com": "delivered"
            }
          },
          {
            "id": "ES303",
            "emailId": "Memail603",
            "identityId": "I2",
            "envelope": {
              "mailFrom": "j.doe@personal.com",
              "rcptTo": ["friend@personal.net"]
            },
            "created": "2024-08-23T20:45:00Z", 
            "deliveryStatus": {
              "friend@personal.net": "delivered"
            }
          }
        ],
        "notFound": []
      },
      "subg0"
    ],
    [
      "Email/get",
      {
        "accountId": "u12345678",
        "state": "s9876543218",
        "list": [
          {
            "id": "Memail601",
            "from": [{"email": "john.doe@company.com", "name": "John Doe"}],
            "to": [{"email": "team@company.com", "name": "Engineering Team"}],
            "cc": [],
            "subject": "Sprint Planning - Next Week",
            "sentAt": "2024-08-24T16:30:00Z",
            "preview": "Team, let's schedule our sprint planning session for next week. I'll send out calendar invites..."
          },
          {
            "id": "Memail602",
            "from": [{"email": "support@company.com", "name": "John Doe - Support Team"}],
            "to": [{"email": "customer@client.com", "name": "Valued Customer"}], 
            "cc": [],
            "subject": "Re: Product Installation Issues - Resolution Provided",
            "sentAt": "2024-08-24T14:15:00Z",
            "preview": "Thank you for contacting our support team. I've investigated your installation issue and found the solution..."
          },
          {
            "id": "Memail603",
            "from": [{"email": "j.doe@personal.com", "name": "John D."}],
            "to": [{"email": "friend@personal.net", "name": "Mike Friend"}],
            "cc": [],
            "subject": "Weekend Plans", 
            "sentAt": "2024-08-23T20:45:00Z",
            "preview": "Hey Mike, are you still up for hiking this weekend? I found a great new trail..."
          }
        ],
        "notFound": []
      },
      "eg0"
    ]
  ]
}

Explanation of Key Features#

Identity Configuration Patterns#

Professional Identity (I1):

  • Primary work email: john.doe@company.com
  • Full signature: Complete contact information with title and company
  • Corporate branding: Professional signature formatting
  • Non-deletable: mayDelete: false indicates system-required identity

Personal Identity (I2):

  • Personal email: j.doe@personal.com
  • Casual presentation: Shortened name "John D."
  • Simple signature: Minimal, informal closing
  • User-managed: mayDelete: true allows user to remove

Role-Based Identity (I3):

  • Shared address: support@company.com (role-based email)
  • Automatic BCC: Archives all support communications
  • Specialized signature: Support-specific contact information and branding
  • Reply-To override: Ensures responses go to support queue

Identity Usage Patterns Analysis#

The EmailSubmission correlation reveals:

  • I1 (Professional): Used for internal team communications
  • I3 (Support Role): Used for customer support interactions
  • I2 (Personal): Used for personal communications

Advanced Identity Features#

Reply-To Configuration:

{
  "replyTo": [{"email": "support@company.com", "name": "Customer Support"}]
}
  • Overrides the From address for replies
  • Useful for shared/role-based identities
  • Ensures responses reach appropriate inbox

Automatic BCC:

{
  "bcc": [{"email": "support-archive@company.com", "name": "Support Archive"}]
}
  • Automatically copies all emails sent with this identity
  • Essential for compliance and record-keeping
  • Transparent to recipients

Signature Management:

  • Text signatures: Plain text fallback for all email clients
  • HTML signatures: Rich formatting with links, styling, and branding
  • Consistency: Maintains professional appearance across communications

Identity Selection Logic#

Clients typically choose identities based on:

  1. Recipient analysis: Internal vs external recipients
  2. Context matching: Support emails use support identity
  3. User preferences: Manual selection or smart defaults
  4. Domain alignment: Match identity domain to recipient expectations

Identity Management Queries#

Identity Usage Statistics:

{
  "filter": {
    "identityId": "I3",
    "after": "2024-08-01T00:00:00Z"  
  }
}

Failed Submissions by Identity:

{
  "filter": {
    "operator": "AND",
    "conditions": [
      {"identityId": "I1"},
      {"deliveryStatus": "failed"}
    ]
  }
}

Cross-Identity Communication Patterns:

{
  "filter": {
    "operator": "OR",
    "conditions": [
      {"identityId": "I1"},
      {"identityId": "I3"}
    ]
  }
}

Business Applications#

Professional Communication Management:

  • Context-appropriate identities: Different personas for different audiences
  • Brand consistency: Standardized signatures and formatting
  • Compliance tracking: Archive copies for regulatory requirements
  • Response management: Proper Reply-To handling for shared addresses

Identity Lifecycle Management:

  • Onboarding: Create role-based identities for new employees
  • Role changes: Update signatures and permissions as roles evolve
  • Offboarding: Disable or redirect identities when employees leave
  • Audit compliance: Track identity usage for security and compliance

Email Analytics and Optimization:

  • Identity performance: Which identities generate most responses
  • Signature effectiveness: A/B testing different signature formats
  • Communication patterns: Understanding internal vs external email flow
  • Resource allocation: Optimizing support identity configurations based on volume

Security and Permissions#

Identity Protection:

  • mayDelete: false prevents accidental removal of critical identities
  • System identities (like primary work email) are typically protected
  • User-created identities allow customization and deletion

Access Control:

  • Identity permissions may vary by user role
  • Some identities may require approval for creation/modification
  • Audit trails track identity configuration changes