This guide walks you through setting up email integration with Tarzan, allowing you to transform emails into blog posts seamlessly.
Tarzan integrates with Postmark's inbound email service to process incoming emails and convert them into blog posts. This setup requires:
- Postmark Account: Configure inbound processing
- Domain Configuration: Point your domain's MX records to Postmark
- Webhook Setup: Connect Postmark to your Tarzan instance
- Authentication: Secure your webhook endpoint
- A domain you control (e.g.,
yourdomain.com) - Access to your domain's DNS settings
- A Postmark account (free tier available)
- A running Tarzan instance (see Quick Start)
Use a dedicated subdomain for blog emails:
blog.yourdomain.com
posts.yourdomain.com
Use your main domain directly:
yourdomain.com
Accept emails to any subdomain:
*.yourdomain.com
In your DNS management console, create an MX record:
| Name/Host | Type | Value | Priority | TTL |
|---|---|---|---|---|
| blog | MX | inbound.postmarkapp.com | 10 | 3600 (or default) |
| Name/Host | Type | Value | Priority | TTL |
|---|---|---|---|---|
| @ (or blank) | MX | inbound.postmarkapp.com | 10 | 3600 (or default) |
| Name/Host | Type | Value | Priority | TTL |
|---|---|---|---|---|
| * | MX | inbound.postmarkapp.com | 10 | 3600 (or default) |
- Go to DNS settings
- Click "Add record"
- Select "MX" type
- Enter the values above
- Navigate to Advanced DNS
- Add new record type "MX Record"
- Enter the configuration
- Go to DNS Management
- Add new MX record
- Configure as shown above
- Sign up at Postmark
- Create a new server for inbound processing
- Note your Server ID and API Token
- Go to your server's settings
- Navigate to "Inbound" tab
- Set your inbound domain (e.g.,
blog.yourdomain.com) - Enable "Inbound processing"
Configure the webhook to point to your Tarzan instance:
https://yourdomain.com/webhook
If testing locally, use ngrok or similar:
https://abc123.ngrok.io/webhook
Set the following environment variables for Tarzan:
# Authentication for webhook endpoint
export TARZAN_AUTH_USERNAME=postmarkapp
export TARZAN_AUTH_PASSWORD=your-secure-password
# Base URL for your Tarzan instance
export TARZAN_BASE__URL=https://yourdomain.com
# Path to authorized emails list
export TARZAN_DIR_AUTHORIZED_EMAILS=./authorized-emails.jsonCreate a JSON file listing allowed sender email addresses:
["your-email@gmail.com", "team@yourcompany.com", "admin@yourdomain.com"]Save this as authorized-emails.json in your Tarzan directory.
If using Docker Compose, update your .env file:
TARZAN_AUTH_USERNAME=postmarkapp
TARZAN_AUTH_PASSWORD=SecurePassword123!
TARZAN_BASE__URL=https://yourdomain.com
TARZAN_DIR_AUTHORIZED_EMAILS=/data/authorized-emails.jsonIn your Postmark server settings:
- Go to "Webhooks" section
- Set "Inbound webhook URL":
https://yourdomain.com/webhook - Configure Basic Authentication:
- Username:
postmarkapp(or your custom username) - Password: Your secure password from Step 4
- Username:
Verify your MX record is active:
dig MX blog.yourdomain.comYou should see inbound.postmarkapp.com in the response.
-
Send an email to any address at your configured domain:
To: test@blog.yourdomain.com Subject: My First Blog Post Body: This is my first email-powered blog post! -
Check your Tarzan instance for the new post
-
Monitor logs for any processing errors
- Verify MX record is properly configured
- Check DNS propagation (can take up to 24 hours)
- Ensure sender email is in authorized list
- Verify webhook URL is accessible
- Check authentication credentials match
- Review Tarzan logs for error details
- Confirm username/password in both Postmark and Tarzan
- Ensure no special characters causing issues
Configure multiple domains by:
- Setting up additional MX records
- Using wildcard domains
- Adding multiple inbound domains in Postmark
Customize how emails become posts by:
- Modifying authorized senders list
- Using email filters in Postmark
- Implementing custom parsing logic
- Use HTTPS for webhook URLs
- Implement strong authentication
- Consider IP whitelisting for Postmark IPs
- Maintain a strict authorized senders list
- Monitor for suspicious activity
- Consider SPF/DKIM validation
Ensure your Tarzan instance has a valid SSL certificate:
# Using Let's Encrypt with Certbot
certbot --nginx -d yourdomain.comOpen necessary ports:
# HTTP/HTTPS for webhook
ufw allow 80
ufw allow 443
# Tarzan port (if different)
ufw allow 8000Set up monitoring for:
- Webhook endpoint availability
- Email processing success rate
- Storage space for attachments
The email subject becomes your blog post title:
Subject: How to Build Amazing Web Applications
- Use HTML for rich formatting
- Include images as attachments
- Structure content with headings
To: posts@blog.yourdomain.com
Subject: Welcome to Email-Powered Blogging
<h2>Getting Started</h2>
<p>This is a sample blog post sent via email.</p>
<h3>Features</h3>
<ul>
<li>Easy publishing</li>
<li>Rich formatting</li>
<li>Image attachments</li>
</ul>
For enterprise deployments, consider:
- GitHub Sponsors for priority support
- Custom integration assistance
- Production deployment consulting
Need help? Join our community chat or open an issue on GitHub.