Domain Filters
Domain filters block all email addresses from a specific domain. Instead of blocking addresses one by one, block the entire domain with a single rule.
When to Use Domain Filters
Block entire domains when:
- A domain consistently sends bad or fraudulent addresses
- You want to exclude competitor domains
- You’re filtering out free email providers (gmail.com, yahoo.com)
- A company is no longer a valid target for your campaigns
- You’ve identified a spam trap or honeypot domain
Adding a Domain Filter
From the dashboard
- Go to Settings → Filters
- Click Add Filter
- Select Domain as the filter type
- Enter the domain to block (without @ or any prefix)
- (Optional) Add a reason for your reference
- Click Save

Via API
curl -X POST https://api.truemail.app/v1/filters \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filter": {
"filter_type": "domain",
"value": "blocked-domain.com",
"reason": "Known spam source"
}
}'
Domain Filter Rules
Format requirements
- Enter the domain only (no @ prefix)
- Automatically converted to lowercase
- Must be a valid domain format
Valid examples
example.com
sub.example.com
company.co.uk
Invalid examples
@example.com # Don't include @
[email protected] # Don't include user part
https://example.com # Don't include protocol
*.example.com # No wildcards
Subdomain handling
Domain filters match the exact domain entered. To block subdomains, add them separately:
# This blocks emails @example.com only
example.com
# To also block subdomains, add them separately
mail.example.com
support.example.com
How Domain Filters Work
When validating an email like [email protected]:
- TrueMail extracts the domain part (
blocked-domain.com) - Checks if it matches any domain filter
- If matched, the email is immediately marked as “bad”
- No credits are charged
Example
You’ve added spam-factory.com to your domain filters.
Any email from that domain is blocked:
{
"email": "[email protected]",
"status": "bad",
"reason": "blocked_by_filter",
"credits_used": 0
}
Viewing Domain Filters
From the dashboard
- Go to Settings → Filters
- Use the filter dropdown to show only Domain filters
- Search by domain name or reason
Via API
curl -X GET "https://api.truemail.app/v1/filters?filter_type=domain" \
-H "Authorization: Bearer YOUR_API_KEY"
Removing Domain Filters
From the dashboard
- Go to Settings → Filters
- Find the domain filter
- Click the Delete button
- Confirm the action
Via API
curl -X DELETE https://api.truemail.app/v1/filters/456 \
-H "Authorization: Bearer YOUR_API_KEY"
Common Use Cases
Block free email providers
For B2B campaigns where you only want business emails:
gmail.com
yahoo.com
hotmail.com
outlook.com
aol.com
icloud.com
mail.com
protonmail.com
Block competitors
Keep competitor employees out of your marketing:
bigcompetitor.com
anothercompetitor.io
Block known spam domains
Domains that frequently appear in fake signups:
tempmail.com
throwaway.email
guerrillamail.com
mailinator.com
Block defunct companies
Former customers whose domain no longer exists:
old-company.com
acquired-startup.io
Bulk Import Domains
For large blocklists, use the API to import in bulk:
Python example
import requests
API_KEY = 'YOUR_API_KEY'
BASE_URL = 'https://api.truemail.app/v1/filters'
domains_to_block = [
('spam-domain1.com', 'Known spam source'),
('spam-domain2.net', 'Fake signups'),
('competitor.com', 'Competitor'),
]
for domain, reason in domains_to_block:
response = requests.post(
BASE_URL,
headers={'Authorization': f'Bearer {API_KEY}'},
json={
'filter': {
'filter_type': 'domain',
'value': domain,
'reason': reason
}
}
)
if response.status_code == 201:
print(f"Blocked: {domain}")
else:
print(f"Failed: {domain} - {response.json()}")
JavaScript example
const domainsToBlock = [
{ domain: 'spam-domain1.com', reason: 'Known spam source' },
{ domain: 'spam-domain2.net', reason: 'Fake signups' },
{ domain: 'competitor.com', reason: 'Competitor' },
];
async function importDomains() {
for (const { domain, reason } of domainsToBlock) {
try {
await fetch('https://api.truemail.app/v1/filters', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filter: {
filter_type: 'domain',
value: domain,
reason: reason
}
})
});
console.log(`Blocked: ${domain}`);
} catch (error) {
console.error(`Failed: ${domain}`, error);
}
}
}
Best Practices
1. Use domains over individual emails
More efficient:
# One domain filter
competitor.com
Less efficient:
# Multiple email filters
[email protected]
[email protected]
[email protected]
...
2. Be careful with common domains
Think twice before blocking large providers like gmail.com—you might block legitimate users.
3. Document everything
Add clear reasons:
Domain: oldclient.com
Reason: "Client churned Jan 2024 - requested removal from all campaigns"
4. Review periodically
Domains can change hands. Review your blocklist to ensure it’s still relevant.
5. Consider your use case
- B2B campaigns: Blocking free email providers makes sense
- B2C campaigns: You probably want gmail.com, etc.
Related
- Email Filters - Block specific addresses
- IP Filters - Block by IP (Premium)
- Filters API - Manage filters via API
- Disposable Emails - Auto-detect temporary domains