3.3 KiB
3.3 KiB
Email Blocking Diagnostic Tool
This document explains how to diagnose and fix email blocking issues in the d-mail system.
Problem
A client (r.sadat@humapek.co) cannot receive emails from russel.s@metixco.ae, but can receive emails from other senders.
Solution
A diagnostic endpoint has been added to check if a sender domain is blocked and optionally unblock it.
Usage
Check if a domain is blocked (Diagnostic Mode)
GET /email/diagnose-blocking?recipient=r.sadat@humapek.co&senderDomain=metixco.ae
Response:
{
"recipientEmail": "r.sadat@humapek.co",
"senderDomain": "metixco.ae",
"user": {
"id": "user-id",
"email": "r.sadat@humapek.co",
"wildduckUserId": "wildduck-user-id",
"businessId": "business-id"
},
"domainTag": "business-id",
"blocked": true,
"blockedDomains": [
{
"domain": "metixco.ae",
"description": "Auto-blocked due to spam report",
"created": "2024-01-01T00:00:00Z"
}
],
"blockingFilters": [],
"message": "Domain metixco.ae is blocked. Use unblock=true to unblock it."
}
Unblock a domain
GET /email/diagnose-blocking?recipient=r.sadat@humapek.co&senderDomain=metixco.ae&unblock=true
Response:
{
"recipientEmail": "r.sadat@humapek.co",
"senderDomain": "metixco.ae",
"user": { ... },
"domainTag": "business-id",
"blocked": false,
"unblocked": true,
"message": "Domain metixco.ae has been unblocked successfully"
}
Authentication
This endpoint requires Admin authentication. Make sure you're authenticated as an admin user.
How It Works
- Finds the recipient user by email address
- Determines the domain tag (usually the business ID, or "default")
- Checks blocked domains for that domain tag
- Checks email filters that might be blocking emails from the sender domain
- Optionally unblocks the domain if requested
Common Causes
- Domain Blocking: The sender domain was marked as spam and automatically blocked
- Email Filters: User-created filters that delete or mark as spam emails from specific domains
- WildDuck Configuration: Server-level blocking (less common)
Troubleshooting
If the domain is not blocked but emails still aren't arriving:
- Check the sender's email server logs
- Check WildDuck server logs
- Verify DNS/MX records for both domains
- Check if there are any forwarding rules
- Verify the recipient's email quota isn't exceeded
Example: Fix the Current Issue
To fix the issue with r.sadat@humapek.co not receiving emails from russel.s@metixco.ae:
# First, check the status
curl -X GET "http://your-api-url/email/diagnose-blocking?recipient=r.sadat@humapek.co&senderDomain=metixco.ae" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN"
# If blocked, unblock it
curl -X GET "http://your-api-url/email/diagnose-blocking?recipient=r.sadat@humapek.co&senderDomain=metixco.ae&unblock=true" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN"
Notes
- The domain tag is typically the business ID of the recipient user
- If a user doesn't have a business, the domain tag defaults to "default"
- Unblocking a domain affects all users in the same business (same domain tag)
- The diagnostic also checks for email filters that might be blocking emails