The email blog platform includes robust security features to prevent unauthorized posting and email spoofing. This guide explains how to configure and use these security features.
Required Configuration
1. Set Allowed Email Addresses
Configure the ALLOWED_EMAIL_ADDRESSES environment variable with a comma-separated list of email addresses that are allowed to publish posts:
The system sends a professional verification email with:
Clear subject line indicating verification needed
HTML and plain text versions
Secure verification link
Expiration warning (24 hours)
Instructions for non-senders to ignore
Example Verification Email
Subject: Verify your blog post: My Amazing Blog Post
Hello,
We received a blog post submission with the title "My Amazing Blog Post" from this email address.
To confirm that you sent this post and publish it to the blog, please click the verification link below:
[Verify and Publish Post]
Important: This verification link will expire in 24 hours for security reasons.
If you did not send this blog post, please ignore this email.
Troubleshooting
Email Not Processing
Check allowlist: Ensure sender email is in ALLOWED_EMAIL_ADDRESSES
Check logs: Look for "Email from X is not in the allowed list" messages
Verify format: Ensure environment variable is properly formatted
Verification Link Issues
Check expiration: Links expire after 24 hours
Check BASE_URL: Ensure it's set correctly or auto-detection is working
One-time use: Each link can only be used once
Posts Not Publishing
Click verification link: Posts remain as drafts until verified
Check email delivery: Ensure verification emails aren't in spam
Check token validity: Tokens expire after 24 hours
Best Practices
Email Management
Use dedicated email addresses for blog posting
Keep the allowlist minimal (only trusted users)
Regularly review who has posting access
Security Monitoring
Monitor logs for unauthorized posting attempts
Review verification patterns for unusual activity
Keep environment variables secure
Backup Strategy
Regular database backups include draft posts
Consider notification systems for failed verifications
Document your allowed email addresses
API Endpoints
Verification Endpoint
URL: GET /verify-email?token=<verification_token>
Purpose: Handles email verification and post publishing
Responses:
200: Successful verification and publishing
400: Missing or invalid token
404: Token not found
410: Token expired
500: Server error during publishing
Security Headers
All verification pages include:
Proper HTML escaping to prevent XSS
Responsive design for mobile verification
Clear success/error messaging
Links back to the main blog
Migration from Unsecured Version
If upgrading from a version without security:
Set environment variables before receiving new emails
Existing posts remain published (not affected)
New emails will require verification from the first email received
Test thoroughly with a test email before going live
Security is enabled by default. Configure ALLOWED_EMAIL_ADDRESSES to start receiving posts!