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

  1. Inbound Email Processing:
  2. Emails sent to: e4feeee22aa58640824f98b26c79620f@inbound.postmarkapp.com
  3. This address is provided by Postmark for processing inbound emails
  4. Postmark forwards these emails as webhook requests to our application
  5. The webhook endpoint is: /webhook/postmark/inbound

  6. Analysis Process:

  7. The application parses the email content to extract property details
  8. The deal analyzer evaluates the property based on investment criteria
  9. Analysis results are sent back to the sender's email address

  10. Outbound Email:

  11. Analysis results are sent using the Postmark API
  12. The sender address is: analyze@dealengineai.com
  13. Email contains analysis verdict, metrics, risk factors, and reasoning

Troubleshooting Email Issues

Inbound Email Processing Issues

  1. Emails not being processed:
  2. Verify the Postmark webhook is correctly configured
  3. Ensure you're sending to the correct inbound email address
  4. Check webhook logs in the Postmark dashboard
  5. Run test_postmark_webhook.py to simulate a webhook request

  6. Email content not being parsed correctly:

  7. Use the format shown in EXAMPLE_EMAIL.md
  8. Include key property details (address, price, rent)
  9. Run direct_test_email_processor.py to test parsing

Outbound Email Delivery Issues

  1. Analysis emails not being received:
  2. Check that the Postmark API token is correct
  3. Verify the sender domain has proper SPF/DKIM setup
  4. Look for errors in the application logs
  5. Run test_email.py to test email sending

  6. Emails being marked as spam:

  7. Ensure proper domain authentication (SPF, DKIM, DMARC)
  8. Use a consistent sender address
  9. Include a proper text version alongside HTML
  10. 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:

  1. SPF Record: v=spf1 include:spf.protection.outlook.com include:spf.postmarkapp.com -all

  2. DKIM Record:

  3. CNAME record for 19c6f3f15621a59c8f0._domainkey.dealengineai.com
  4. Point to 19c6f3f15621a59c8f0.dkim.postmarkapp.com

  5. DMARC Record: v=DMARC1; p=reject; pct=100; rua=mailto:dmarc@dealengineai.com

Testing Tools

The application includes several testing tools:

  1. test_postmark_webhook.py: Tests the webhook functionality
  2. direct_test_email_processor.py: Tests the email processing chain
  3. send_test_property_email.py: Sends a test email to the inbound address
  4. check_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:

  1. Configure the DNS records as shown above
  2. Set up an inbound domain in Postmark (e.g., inbound.dealengineai.com)
  3. Update the MX records to point to Postmark's inbound servers
  4. Update the inbound webhook URL in Postmark
  5. Update the inbound email address in the application configuration

Monitoring Email Delivery

The application logs email delivery status:

  1. Successful deliveries are logged with message IDs
  2. Failed deliveries include error details
  3. View email logs in the application dashboard
  4. Check Postmark's activity feed for detailed delivery status

Best Practices

  1. Clear Email Format:
  2. Follow the structure in EXAMPLE_EMAIL.md
  3. Include all necessary property details
  4. Use a clear subject line

  5. Regular Testing:

  6. Run the test tools regularly
  7. Monitor delivery rates and spam placement
  8. Update domain authentication as needed

  9. Consistent Branding:

  10. Use consistent sender information
  11. Include company branding in emails
  12. Provide clear value in email content

  13. Handle Errors Gracefully:

  14. Log all email processing errors
  15. Provide clear error messages to users
  16. Implement retry mechanisms for transient failures

Support

For additional help with email delivery:

  1. Review the Postmark documentation: https://postmarkapp.com/support
  2. Check application logs for detailed error messages
  3. Contact support@dealengineai.com for assistance
Run a Free Lease Audit
→