Skip to content

Feat: Add integration for MailPit #476

@prom3theu5

Description

@prom3theu5

Related to an existing integration?

Yes

Existing integration

PapercutSmtp

Overview

Add support for a MailPit container resource, supporting data persistence.

MailPit is an alternative to Papercut-SMTP with a larger focus on developers

Some of its features include:

  • Runs entirely from a single static binary or multi-architecture Docker images
  • Modern web UI with advanced mail search to view emails (formatted HTML, highlighted HTML source, text, headers, raw source, and MIME attachments including image thumbnails), including optional HTTPS & authentication
  • SMTP server with optional STARTTLS or SSL/TLS, authentication (including an “accept any” mode)
  • A REST API for integration testing
  • Real-time web UI updates using web sockets for new mail & optional browser notifications when new mail is received
  • Optional POP3 server to download captured message directly into your email client
  • HTML check to test & score mail client compatibility with HTML emails
  • Link check to test message links (HTML & text) & linked images
  • Spam check to test message “spamminess” using a running SpamAssassin server
  • Create screenshots of HTML messages via web UI
  • Mobile and tablet HTML preview toggle in desktop mode
  • Message tagging including manual tagging or automated tagging using filtering and “plus addressing”
  • SMTP relaying (message release) - relay messages via a different SMTP server including an optional allowlist of accepted recipients
  • SMTP forwarding - automatically forward messages via a different SMTP server to predefined email addresses
  • Chaos feature to enable configurable SMTP errors to test application resilience
    Fast message storing & processing - ingesting 100-200 emails per second over SMTP depending on CPU, network speed & email size, easily handling tens of thousands of emails, with automatic email pruning (by default keeping the most recent 500 emails)
  • List-Unsubscribe syntax validation
  • Optional webhook for received messages

Usage example

var builder = DistributedApplication.CreateBuilder(args);

var mailPit = builder.AddMailPit("mailpit");

var sendmail = builder.AddProject<CommunityToolkit_Aspire_Hosting_MailPit_SendMailApi>("sendmail")
    .WithReference(mailPit)
    .WaitFor(mailPit);

builder.Build().Run();
using Projects;

var builder = DistributedApplication.CreateBuilder(args);

var mailPit = builder.AddMailPit("mailpit")
    .WithDataVolume("mailpit-data", isReadOnly: false);

var sendmail = builder.AddProject<CommunityToolkit_Aspire_Hosting_MailPit_SendMailApi>("sendmail")
    .WithReference(mailPit)
    .WaitFor(mailPit);

builder.Build().Run();

Breaking change?

No

Alternatives

using Projects;

var builder = DistributedApplication.CreateBuilder(args);

var papercut = builder.AddPapercutSmtp("papercut");

var sendmail = builder.AddProject<CommunityToolkit_Aspire_Hosting_PapercutSmtp_SendMailApi>("sendmail")
    .WithReference(papercut)
    .WaitFor(papercut);

builder.Build().Run();

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

Metadata

Metadata

Assignees

No one assigned

    Labels

    integrationA new .NET Aspire integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions