mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #643] Feature Request: API emulation for common email providers (SendGrid/Postmark) #405
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#405
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @atkawa7 on GitHub (Feb 12, 2026).
Original GitHub issue: https://github.com/axllent/mailpit/issues/643
Summary
Add API compatibility / emulation mode for popular transactional email providers such as SendGrid and Postmark, allowing Maipit to act as a drop-in replacement.
Problem
Many applications are already tightly integrated with SendGrid/Postmark APIs and SDKs. Migrating to Maipit currently requires application code changes, which increases adoption friction.
Providing compatible endpoints would allow developers to switch providers with minimal effort.
Proposed Solution
Introduce an API emulation layer that mimics commonly used endpoints and request/response formats of major email providers.
Initial Scope
SendGrid compatibility
Support commonly used endpoints such as:
POST /v3/mail/sendAuthorization: Bearer)Postmark compatibility
Support commonly used endpoints such as:
POST /emailPOST /email/withTemplateX-Postmark-Server-Token)@axllent commented on GitHub (Feb 13, 2026):
Hi @atkawa7 - this topic has been discussed a few times in the past (for example in #167 & #278) and my reasons for rejecting it are explained there. Whilst I completely understand your request, the feasibility of building and maintaining all the various APIs is not realistic. The suggested approach would be to build your own bridge to Mailpit which mocks those APIs.
@atkawa7 commented on GitHub (Feb 13, 2026):
@axllent Thanks for the clarification - that makes sense regarding the maintenance burden of supporting multiple APIs directly in Mailpit.
Instead of adding those APIs into Mailpit itself, would you be open to a different approach: a small plugin framework foundation that allows users to extend Mailpit externally? The idea would be to avoid copying or forking Mailpit and instead let the community build bridges (e.g. SendGrid/Postmark emulation) as plugins that can register additional HTTP routes and integrate with Mailpit at runtime.
This way the core project stays focused and lightweight, while extensions can live and evolve independently. Would this direction be something you’d be open to discussing?
@axllent commented on GitHub (Feb 13, 2026):
@atkawa7 - I may be open to considering it, but I would first need to investigate plugin handling in Go (generally), something I do not have time for in the next couple of months. Furthermore, I expect that with such an approach it will still result in much more overheads and considerations when implementing code changes within Mailpit (compared to now).
Could you please explain to me why a standalone "bridge" is a bad idea? This bridge can be written in any language and simply delivers the message to Mailpit over SMPT. Sure, the downside is it is a standalone service, but other than that I only see advantages.
@atkawa7 commented on GitHub (Feb 22, 2026):
@axllent
I’ve taken some time to explore this further, and the approach looks viable. For the initial implementation, I’m using
github.com/hashicorp/go-pluginas the foundation.Proposed Architecture
The idea is:
plugins//app/bin/pluginsat runtimeUsing this model, plugins are fully isolated from Mailpit. They communicate over
net/rpc, withgo-pluginhandling process lifecycle, handshake validation, and RPC wiring.This keeps Mailpit lightweight while allowing plugins to be developed, built, and deployed independently.
How Mailpit Loads Plugins
At startup, Mailpit would:
/app/bin/pluginsgo-pluginConceptually, something like:
This approach:
/pluginName/...)Example Plugin
A minimal plugin implementation could look like this: