MailBridge: Modern Form Submission & Email Response System
MailBridge is a powerful, secure, and efficient system designed to handle form submissions and automate email responses. Built with FastAPI and Docker, it provides a robust solution for managing contact forms and email communications on your website. With dual email delivery options (iCloud SMTP and Postmark API), MailBridge offers flexibility and reliability for your email needs.
Key Features
FastAPI Backend: High-performance asynchronous API for handling form submissions
Docker Containerization: Easy deployment and scaling
Redis Integration: Rate limiting and caching for enhanced security
Dual Email Delivery: Choose between iCloud SMTP and Postmark API
Dynamic Mode Switching: Seamlessly switch between email delivery methods
Automated Email Responses: Customizable templates for different types of inquiries
Form Submission Handling: Secure processing of contact form data
Rate Limiting: Protection against spam and abuse
CORS Support: Secure cross-origin resource sharing
Gzip Compression: Optimized data transfer
CAPTCHA Support: Optional integration with reCAPTCHA or hCaptcha
Multiple Email Alias Support: Manage multiple email addresses from a single instance
Pushover Notifications: Real-time alerts for form submissions and email responses
Email Delivery Options
MailBridge supports two email delivery methods, allowing you to choose the best option for your needs:
iCloud SMTP Mode
Traditional SMTP delivery using iCloud’s infrastructure
Sent folder archiving - all emails are automatically saved to your iCloud Sent Messages folder
Reliable delivery with iCloud’s established email infrastructure
No additional service costs - uses your existing iCloud account
Postmark Mode
API-based delivery using Postmark’s transactional email service
Enhanced deliverability with dedicated IP addresses and reputation management
Detailed analytics and delivery tracking
Professional email infrastructure designed for transactional emails
Identical email content - same formatting and templates as iCloud mode
How It Works
MailBridge operates as a two-part system:
Form Handler: Processes incoming form submissions from your website
Email Daemon: Monitors and responds to incoming emails
Form Submission Flow
User submits a contact form on your website
Form data is securely sent to MailBridge’s API
MailBridge validates the submission and applies rate limiting
The submission is processed and sent via the configured email delivery method
A copy is saved to the Sent Messages folder (iCloud mode) or tracked via Postmark
Email Response Flow
MailBridge monitors specified email accounts
When a new email arrives, it’s processed based on predefined rules
Appropriate response templates are selected based on the email subject
Automated responses are sent using the configured delivery method
All responses are logged and tracked appropriately
Setup and Configuration
Prerequisites
Docker and Docker Compose
iCloud account with app-specific password
(Optional) Postmark account for enhanced email delivery
Domain with SSL certificate
(Optional) CAPTCHA service (reCAPTCHA or hCaptcha)
(Optional) Pushover account for notifications
Configuration Files
config.yml: Defines form settings, allowed domains, and global mode
responses.json: Contains email templates and response configurations
compose.yaml: Docker services configuration
.env: Environment variables (iCloud and Postmark credentials)