Bounce Handling in Mautic - Choosing Between AWS SES and Standard Email Accounts

5 min read
Bounce management is critical for maintaining email deliverability and ensuring your marketing campaigns reach their intended audience. In Mautic, bounce handling involves detecting undelivered emails (bounces) and unsubscribe requests (complaints), then updating contact records accordingly.
This guide explores two approaches: Amazon Web Services (AWS) Simple Email Service (SES) and standard email accounts (e.g., Gmail, Outlook, or hosted email).
Why Bounce Management Matters
- Maintain Sender Reputation: High bounce rates harm your domain’s reputation, increasing the risk of emails being flagged as spam.
- Compliance: Automatically update contact lists to reflect unsubscribes and invalid addresses.
- Efficiency: Save time by automating manual tasks like list cleaning.
AWS SES vs. Normal Email Accounts: Key Differences
| Feature | AWS SES + SNS | Normal Email Account |
|---|---|---|
| Bounce/Unsubscribe Handling | Automated via SNS topics (HTTPS endpoints or email notifications). | Manual folder monitoring (IMAP) for bounce/complaint emails. |
| Bounce Email Flexibility | Any valid email address (e.g., [email protected], [email protected]). | Must use the same email account used for sending. |
| Infrastructure | AWS-managed; scales automatically. | Limited by email provider’s policies and quotas. |
| Deliverability | Optimized with AWS reputation tools. | Dependent on email provider’s domain reputation. |
| Setup Complexity | Requires DNS records, SNS topics, and IAM permissions. | Simple: Just SMTP/IMAP credentials. |
| Cost | Pay-as-you-go (low cost per 1,000 emails). | Often free (if using existing email accounts). |
Why Choose AWS SES?
- Scalability: AWS SES is ideal for high-volume senders, handling millions of emails daily without performance degradation.
- Flexibility: Use any email address (even third-party domains) for bounce notifications.
- Advanced Analytics: Real-time feedback via SNS ensures accurate tracking of bounces, complaints, and delivery status.
- Cost-Effectiveness: Cheaper than services like Mailchimp or SendGrid at scale.
When to Use a Normal Email Account
- Simplicity: No need for AWS configuration—just SMTP/IMAP credentials.
- Low-Volume Needs: Suitable for small businesses or campaigns sending <10,000 emails/month.
- Budget Constraints: Avoid AWS fees by leveraging existing email infrastructure.
Implementing Bounce Management with AWS SES
Prerequisites
- AWS account with SES and SNS access.
- Domain verified in AWS SES (DKIM/SPF records configured).
- A dedicated email address for bounce handling (e.g.,
[email protected]).
AWS Step-by-Step Setup
Step 1: Verify Your Domain in AWS SES
- Log in to the AWS Console.
- Navigate to Amazon SES > Domains under "Identity management."
- Click Verify a New Domain, enter your domain, and check Generate DKIM Settings.
- Add the provided DNS records (TXT and CNAME) to your domain’s DNS settings.
- Wait for verification to complete (up to 72 hours).
Step 2: Create SNS Topics for Bounces and Complaints
- Go to Amazon SNS > Topics.
- Click Create topic (Standard type).
- Name the topic:
ses-bounces-YOUR-DOMAIN. - Repeat to create a second topic:
ses-complaints-YOUR-DOMAIN.
Step 3: Configure SES Feedback Notifications
- Return to Amazon SES > Verified identities > select your domain.
- Under Notifications, click Edit.
- For Bounces:
- Set notification method to SNS.
- Select the
ses-bounces-YOUR-DOMAINtopic. - Enable Include original email headers.
- For Complaints:
- Set notification method to SNS.
- Select the
ses-complaints-YOUR-DOMAINtopic. - Enable Include original email headers.
- Click Save changes.
Step 4: Subscribe Your Bounce Email to SNS Topics
- In Amazon SNS, select the
ses-bounces-YOUR-DOMAINtopic. - Click Subscribe to topic > Protocol: Email > Endpoint:
[email protected]. - Repeat for the
ses-complaints-YOUR-DOMAINtopic. - Confirm subscriptions via verification emails sent to
[email protected].
Step 5: Configure Mautic
- Navigate to Mautic Admin > Settings > Configuration > Email Settings.
- Mail Send Settings (SMTP):
- SMTP Host:
email-smtp.us-west-2.amazonaws.com(region-specific). - Port:
465(SSL). - Username/Password: AWS SES SMTP credentials.
- SMTP Host:
- Monitored Inbox Settings (IMAP):
- Monitored Address:
[email protected]. - IMAP Host:
mail.thirdpartydomain.com. - Port:
993(SSL). - Folders: Create
BouncesandComplaintsin the inbox.
- Monitored Address:
- Test connections and save settings.
Implementing Bounce Management with a Normal Email Account
Prerequisites
- A valid email account (e.g., Gmail, Outlook, or your hosted email).
- IMAP/SMTP access enabled for the account.
Step-by-Step Setup
Step 1: Configure Email Settings in Mautic
- Navigate to Mautic Admin > Settings > Configuration > Email Settings.
- Mail Send Settings (SMTP):
- SMTP Host:
smtp.gmail.com(or your provider’s server). - Port: 465 (SSL). GMAIL might require an APP Password.
- Username/Password: Your email account credentials.
- SMTP Host:
- Monitored Inbox Settings (IMAP):
- Monitored Address:
[email protected](same as sending email). - IMAP Host:
imap.gmail.com(or provider’s server). - Port:
993(SSL). - Folders: Create
BouncesandComplaintsin the inbox.
- Monitored Address:
Step 2: Test Bounce Handling
- Manually move an email to the
Bouncesfolder. - Run the CLI command to process bounces:
php bin/console mautic:email:fetch -v
** use the flag -v for verbose to see any errors - Ensure the contact is marked as "bounced" in Mautic.
- If the above works, then create rules which push these emails to the correct folders. Mautic can use these folders for checking.
Common Issues and Troubleshooting
AWS SES-Specific Issues
| Issue | Solution |
|---|---|
| Bounces Not Recorded | Ensure SNS topics are linked to SES and [email protected] is subscribed. |
| SNS Subscription Failing | Manually confirm via verification emails sent to the bounce email. |
| IMAP Connection Errors | Validate IMAP settings (host, port, encryption) for the bounce email. |
Normal Email-Specific Issues
| Issue | Solution |
|---|---|
| IMAP Extension Missing | Install PHP IMAP extension: sudo apt install php-imap. |
| Folders Not Found | Confirm Bounces and Complaints folders exist in the inbox. |
| Manual Bounce Testing Fails | Ensure emails moved to the Bounces folder match Mautic’s parsing rules (e.g., headers). |
Best Practices
- Monitor Logs Regularly: Use Mautic’s System Info > Log to track any issues related to email fetching.
- Rotate Credentials: Periodically update SMTP/IMAP passwords and AWS access keys.
- Use Dedicated Folders: Keep bounce/complaint traffic isolated from regular email.
- Test with Simulator Emails: Use AWS’s
[email protected]for validation.
Final notes
- AWS SES is optimal for scalability, automation, and flexibility in bounce email configuration.
- Normal Email Accounts suit low-volume senders prioritizing simplicity.
- CLI Commands: Automate bounce processing via cron jobs (e.g., every 15 minutes).
- PHP IMAP Extension: Ensure it’s installed to avoid errors like
Call to undefined function imap_search.
