Email Delivery Guide
DealEngineAI Email Delivery Guide
This guide provides information on the email delivery configuration for DealEngineAI, troubleshooting steps, and best practices.
Email Workflow
- Inbound Email Processing:
- Emails sent to:
e4feeee22aa58640824f98b26c79620f@inbound.postmarkapp.com
- This address is provided by Postmark for processing inbound emails
- Postmark forwards these emails as webhook requests to our application
-
The webhook endpoint is:
/webhook/postmark/inbound
-
Analysis Process:
- The application parses the email content to extract property details
- The deal analyzer evaluates the property based on investment criteria
-
Analysis results are sent back to the sender's email address
-
Outbound Email:
- Analysis results are sent using the Postmark API
- The sender address is:
analyze@dealengineai.com
- Email contains analysis verdict, metrics, risk factors, and reasoning
Troubleshooting Email Issues
Inbound Email Processing Issues
- Emails not being processed:
- Verify the Postmark webhook is correctly configured
- Ensure you're sending to the correct inbound email address
- Check webhook logs in the Postmark dashboard
-
Run
test_postmark_webhook.py
to simulate a webhook request -
Email content not being parsed correctly:
- Use the format shown in
EXAMPLE_EMAIL.md
- Include key property details (address, price, rent)
- Run
direct_test_email_processor.py
to test parsing
Outbound Email Delivery Issues
- Analysis emails not being received:
- Check that the Postmark API token is correct
- Verify the sender domain has proper SPF/DKIM setup
- Look for errors in the application logs
-
Run
test_email.py
to test email sending -
Emails being marked as spam:
- Ensure proper domain authentication (SPF, DKIM, DMARC)
- Use a consistent sender address
- Include a proper text version alongside HTML
- Run
check_dns_records.py
to verify DNS configuration
Email Configuration Requirements
Domain Authentication
To improve email deliverability, ensure your domain has proper authentication records:
-
SPF Record:
v=spf1 include:spf.protection.outlook.com include:spf.postmarkapp.com -all
-
DKIM Record:
- CNAME record for
19c6f3f15621a59c8f0._domainkey.dealengineai.com
-
Point to
19c6f3f15621a59c8f0.dkim.postmarkapp.com
-
DMARC Record:
v=DMARC1; p=reject; pct=100; rua=mailto:dmarc@dealengineai.com
Testing Tools
The application includes several testing tools:
test_postmark_webhook.py
: Tests the webhook functionalitydirect_test_email_processor.py
: Tests the email processing chainsend_test_property_email.py
: Sends a test email to the inbound addresscheck_dns_records.py
: Verifies DNS configuration for email authentication
Transitioning to Custom Domain
When transitioning from the Postmark-provided inbound address to a custom domain:
- Configure the DNS records as shown above
- Set up an inbound domain in Postmark (e.g.,
inbound.dealengineai.com
) - Update the MX records to point to Postmark's inbound servers
- Update the inbound webhook URL in Postmark
- Update the inbound email address in the application configuration
Monitoring Email Delivery
The application logs email delivery status:
- Successful deliveries are logged with message IDs
- Failed deliveries include error details
- View email logs in the application dashboard
- Check Postmark's activity feed for detailed delivery status
Best Practices
- Clear Email Format:
- Follow the structure in
EXAMPLE_EMAIL.md
- Include all necessary property details
-
Use a clear subject line
-
Regular Testing:
- Run the test tools regularly
- Monitor delivery rates and spam placement
-
Update domain authentication as needed
-
Consistent Branding:
- Use consistent sender information
- Include company branding in emails
-
Provide clear value in email content
-
Handle Errors Gracefully:
- Log all email processing errors
- Provide clear error messages to users
- Implement retry mechanisms for transient failures
Support
For additional help with email delivery:
- Review the Postmark documentation: https://postmarkapp.com/support
- Check application logs for detailed error messages
- Contact support@dealengineai.com for assistance