winterbaume-ses 0.3.0

SES v1 (Simple Email Service) mock implementation for winterbaume
Documentation

winterbaume-ses

SES v1 (Simple Email Service) mock implementation for winterbaume.

This crate is part of the winterbaume workspace — a suite of in-process AWS service mocks for Rust. Use the umbrella winterbaume crate to pull in all services at once, or depend on this crate directly for SES v1 only.

Winterbäume is not affiliated with, endorsed by, or sponsored by Amazon Web Services, Inc. or Amazon.com, Inc. Amazon Web Services, AWS, and related marks are trademarks of Amazon.com, Inc. or its affiliates. All other trademarks are the property of their respective owners.

Coverage

Metric Value
Service SES v1
AWS model ses
Protocol awsQuery
winterbaume coverage 38/71 operations (53.5%)
stubs (routed, returns empty/default) 2/71 operations (2.8%)
moto coverage 38/71 operations (53.5%)
floci coverage 0/71 operations (0.0%)
kumo coverage 0/71 operations (0.0%)
Coverage report date 2026-05-17

Coverage is generated from .agents/docs/API_COVERAGE.md by update_readme.py. The winterbaume row counts only operations with real, state-backed logic; stubs counts handlers that route the request and return an empty/default response without real behaviour. Operation-count coverage is a prioritisation signal, not a behavioural guarantee.

See the workspace README.md for setup, usage, and the full cross-service coverage table.

Server-mode usage

Install winterbaume-server from crates.io or run it from a workspace checkout, then point the AWS CLI at it:

# Installed binary ( from crates.io ):
cargo install winterbaume-server
winterbaume-server --host 127.0.0.1 --port 5555

# Or, from a workspace checkout:
cargo run -p winterbaume-server -- --host 127.0.0.1 --port 5555
export AWS_ENDPOINT_URL=http://localhost:5555
aws ses list-identities

Example

use std::sync::Arc;

use aws_sdk_ses::config::BehaviorVersion;
use winterbaume_core::{MockAws, StatefulService};
use winterbaume_ses::SesService;

#[tokio::main]
async fn main() {
    // Keep an Arc<SesService> so we can inspect the mock state after the
    // SendEmail call. The mock builder accepts the Arc directly via the
    // blanket `MockService for Arc<T>` impl in winterbaume-core.
    let svc = Arc::new(SesService::new());
    let mock = MockAws::builder().with_service(Arc::clone(&svc)).build();

    let region = "us-east-1";
    let config = aws_config::defaults(BehaviorVersion::latest())
        .http_client(mock.http_client())
        .credentials_provider(mock.credentials_provider())
        .region(aws_sdk_ses::config::Region::new(region))
        .load()
        .await;

    let client = aws_sdk_ses::Client::from_conf(
        aws_sdk_ses::config::Builder::from(&config)
            .endpoint_url("https://ses.us-east-1.amazonaws.com")
            .build(),
    );

    // Verify the sender so the mock has at least one identity registered.
    client
        .verify_email_identity()
        .email_address("sender@example.com")
        .send()
        .await
        .expect("verify_email_identity should succeed");

    let identities = client
        .list_identities()
        .send()
        .await
        .expect("list_identities should succeed");
    println!("SES v1 identities: {:?}", identities.identities());

    // Send a multipart-style email with both text and HTML bodies.
    let send_resp = client
        .send_email()
        .source("sender@example.com")
        .destination(
            aws_sdk_ses::types::Destination::builder()
                .to_addresses("alice@example.com")
                .cc_addresses("carbon@example.com")
                .build(),
        )
        .message(
            aws_sdk_ses::types::Message::builder()
                .subject(
                    aws_sdk_ses::types::Content::builder()
                        .data("Welcome to winterbaume")
                        .build()
                        .unwrap(),
                )
                .body(
                    aws_sdk_ses::types::Body::builder()
                        .text(
                            aws_sdk_ses::types::Content::builder()
                                .data("Hello from the SES v1 mock.")
                                .build()
                                .unwrap(),
                        )
                        .html(
                            aws_sdk_ses::types::Content::builder()
                                .data("<p>Hello from the <b>SES v1</b> mock.</p>")
                                .build()
                                .unwrap(),
                        )
                        .build(),
                )
                .build(),
        )
        .send()
        .await
        .expect("send_email should succeed");
    let message_id = send_resp.message_id().to_string();
    println!("SES v1 SendEmail message ID: {message_id}");

    // SES v1 has no public API to read individual sent messages, so the
    // mock surfaces them through the snapshot view instead.
    let snapshot = svc.snapshot(mock.account_id(), region).await;
    let sent = snapshot
        .sent_emails
        .iter()
        .find(|e| e.message_id == message_id)
        .expect("sent email should be recorded in mock state");

    assert_eq!(sent.source, "sender@example.com");
    assert_eq!(sent.to_addresses, vec!["alice@example.com".to_string()]);
    assert_eq!(sent.cc_addresses, vec!["carbon@example.com".to_string()]);
    assert_eq!(sent.subject, "Welcome to winterbaume");
    assert_eq!(
        sent.text_body.as_deref(),
        Some("Hello from the SES v1 mock.")
    );
    assert_eq!(
        sent.html_body.as_deref(),
        Some("<p>Hello from the <b>SES v1</b> mock.</p>")
    );

    println!(
        "SES v1 verified sent email: from={} to={:?} subject={:?}",
        sent.source, sent.to_addresses, sent.subject
    );
}

Implemented APIs (38)

  • CloneReceiptRuleSet
  • CreateConfigurationSet
  • CreateConfigurationSetEventDestination
  • CreateReceiptRule
  • CreateReceiptRuleSet
  • CreateTemplate
  • DeleteConfigurationSet
  • DeleteIdentity
  • DeleteReceiptRuleSet
  • DeleteTemplate
  • DescribeActiveReceiptRuleSet
  • DescribeConfigurationSet
  • DescribeReceiptRule
  • DescribeReceiptRuleSet
  • GetIdentityDkimAttributes
  • GetIdentityMailFromDomainAttributes
  • GetIdentityNotificationAttributes
  • GetIdentityVerificationAttributes
  • GetTemplate
  • ListConfigurationSets
  • ListIdentities
  • ListReceiptRuleSets
  • ListTemplates
  • ListVerifiedEmailAddresses
  • SendBulkTemplatedEmail
  • SendEmail
  • SendRawEmail
  • SendTemplatedEmail
  • SetActiveReceiptRuleSet
  • SetIdentityFeedbackForwardingEnabled
  • SetIdentityMailFromDomain
  • SetIdentityNotificationTopic
  • UpdateConfigurationSetReputationMetricsEnabled
  • UpdateReceiptRule
  • UpdateTemplate
  • VerifyDomainIdentity
  • VerifyEmailAddress
  • VerifyEmailIdentity
  • GetSendQuota
  • GetSendStatistics
  • CreateConfigurationSetTrackingOptions
  • CreateCustomVerificationEmailTemplate
  • CreateReceiptFilter
  • DeleteConfigurationSetEventDestination
  • DeleteConfigurationSetTrackingOptions
  • DeleteCustomVerificationEmailTemplate
  • DeleteIdentityPolicy
  • DeleteReceiptFilter
  • DeleteReceiptRule
  • DeleteVerifiedEmailAddress
  • GetAccountSendingEnabled
  • GetCustomVerificationEmailTemplate
  • GetIdentityPolicies
  • ListCustomVerificationEmailTemplates
  • ListIdentityPolicies
  • ListReceiptFilters
  • PutConfigurationSetDeliveryOptions
  • PutIdentityPolicy
  • ReorderReceiptRuleSet
  • SendBounce
  • SendCustomVerificationEmail
  • SetIdentityDkimEnabled
  • SetIdentityHeadersInNotificationsEnabled
  • SetReceiptRulePosition
  • TestRenderTemplate
  • UpdateAccountSendingEnabled
  • UpdateConfigurationSetEventDestination
  • UpdateConfigurationSetSendingEnabled
  • UpdateConfigurationSetTrackingOptions
  • UpdateCustomVerificationEmailTemplate
  • VerifyDomainDkim