Mail Server Setup: Postfix and Dovecot
Complete guide on Postfix MTA, Dovecot IMAP/POP3, SSL/TLS configuration, virtual domain support, spam filtering, and Docker Mail Server setup.
Blacklist checking, delisting requests, Spamhaus/Barracuda/SORBS procedures, and IP reputation management guide.
Email blacklists (blocklists) are databases that track IP addresses and domains sending spam. When your IP is blacklisted, your emails may be rejected by recipient servers or redirected to spam folders. This guide covers blacklist checking, delisting requests, and IP reputation management.
Being blacklisted seriously affects your email communication. First stop the spam source, then submit a delisting request.
To check your IP's blacklist status:
# Popular checking sites
https://mxtoolbox.com/blacklists.aspx
https://www.dnsbl.info/
https://multirbl.valli.org/
https://check.spamhaus.org/
# Spamhaus ZEN check
dig +short 4.3.2.1.zen.spamhaus.org
# (Reverse the IP: 1.2.3.4 → 4.3.2.1)
# Barracuda check
dig +short 4.3.2.1.b.barracudacentral.org
# SpamCop check
dig +short 4.3.2.1.bl.spamcop.net
# SORBS check
dig +short 4.3.2.1.dnsbl.sorbs.net
# Bulk check script
#!/bin/bash
IP="1.2.3.4"
REVERSE=$(echo $IP | awk -F. '{print $4"."$3"."$2"."$1}')
BLACKLISTS=(
"zen.spamhaus.org"
"b.barracudacentral.org"
"bl.spamcop.net"
"dnsbl.sorbs.net"
"cbl.abuseat.org"
"dnsbl-1.uceprotect.net"
)
for bl in "${BLACKLISTS[@]}"; do
RESULT=$(dig +short $REVERSE.$bl)
if [ -n "$RESULT" ]; then
echo "LISTED: $bl ($RESULT)"
else
echo "CLEAN: $bl"
fi
done
Spamhaus is the most widely used blacklist. It contains three main lists:
| List | Description | Delisting |
|---|---|---|
| SBL | Spam sources | Manual request |
| XBL | Exploit/botnet IPs | Automatic (via CBL) |
| PBL | Dynamic/end-user IPs | Self-service |
# Spamhaus delisting
1. Go to https://check.spamhaus.org/
2. Enter your IP address
3. Review the listing reason
4. Click the "Remove" button
5. Fill in required information
6. Indicate that you've fixed the spam source
Spamhaus SBL delisting typically takes 24-48 hours. XBL/CBL delisting is automatic and occurs within a few hours after stopping the spam source.
# Barracuda delisting
1. Go to http://www.barracudacentral.org/lookups
2. Check your IP address
3. Click "Request Removal"
4. Enter your email address
5. Click the link in the verification email
# SORBS delisting
1. Go to http://www.sorbs.net/
2. Query your IP address
3. Follow the delisting procedure based on listing type
4. Some lists are automatic, others require manual delisting
# SpamCop delisting
# SpamCop performs automatic delisting
# IP is automatically removed 24-48 hours after spam reports stop
# Manual delisting is not possible
# Check mail queue
sudo postqueue -p
# Count queued messages
sudo postqueue -p | tail -1
# Review recently sent emails
sudo tail -100 /var/log/mail.log | grep "status=sent"
# Review rejected emails
sudo tail -100 /var/log/mail.log | grep "reject\|blocked\|blacklist"
# Open relay check
telnet mail.example.com 25
EHLO test
MAIL FROM:<test@test.com>
RCPT TO:<external@gmail.com>
# Should get 550 error (relay denied)
# Sending statistics
sudo pflogsumm /var/log/mail.log
# 1. Create SPF record
example.com TXT "v=spf1 mx ip4:185.x.x.x -all"
# 2. Enable DKIM signing
# (requires opendkim installation)
sudo apt install opendkim opendkim-tools -y
# 3. Set DMARC policy
_dmarc.example.com TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"
# 4. Set PTR record
# Via REXE panel or support ticket
# 5. Apply rate limiting
# /etc/postfix/main.cf
smtpd_client_message_rate_limit = 100
smtpd_client_recipient_rate_limit = 200
anvil_rate_time_unit = 3600s
# Daily blacklist check (cron)
#!/bin/bash
# /usr/local/bin/blacklist-check.sh
IP="185.x.x.x"
REVERSE=$(echo $IP | awk -F. '{print $4"."$3"."$2"."$1}')
RESULT=$(dig +short $REVERSE.zen.spamhaus.org)
if [ -n "$RESULT" ]; then
echo "WARNING: IP $IP listed on Spamhaus!" | \
mail -s "Blacklist Alert" admin@example.com
fi
# Monitor your IP reputation with Google Postmaster Tools
1. Go to https://postmaster.google.com/
2. Verify your domain
3. Monitor IP reputation, spam rate, and authentication status
To maintain your IP reputation, regularly check blacklists, properly configure SPF/DKIM/DMARC records, and monitor mail logs.
Being blacklisted is a serious issue but can be resolved with the right steps. First stop the spam source, then submit delisting requests, and take proactive measures to protect your IP reputation. With regular monitoring and proper configuration, you can prevent blacklist issues.
Use online tools like MXToolbox (mxtoolbox.com/blacklists.aspx) or MultiRBL (multirbl.valli.org). From command line, use 'dig +short REVERSE_IP.zen.spamhaus.org' to check Spamhaus.
Varies by blacklist. Spamhaus SBL: 24-48 hours, XBL/CBL: few hours (automatic), Barracuda: 12-24 hours, SpamCop: 24-48 hours (automatic). Don't submit delisting requests without stopping the spam source.
The spam source may not be fully stopped. Check for compromised accounts, ensure no open relay, scan for malware, and review mail logs in detail.
Other users on a shared IP sending spam can affect you. Contact REXE support to request a dedicated IP or IP change.
Properly configure SPF, DKIM, and DMARC records, set PTR record, apply rate limiting, perform regular blacklist checks, and monitor mail logs. Use strong passwords and 2FA to prevent compromised accounts.
Complete guide on Postfix MTA, Dovecot IMAP/POP3, SSL/TLS configuration, virtual domain support, spam filtering, and Docker Mail Server setup.
Complete guide to configuring SPF records, DKIM signing, DMARC policies, DNS records, and testing tools to improve email deliverability and security.