substack emails blocked by spamcop
how to fix it on your exim4 SMTP server
I haven’t been getting all my substack emails. They use bulk email services like mailgun, which also host spammers, so the IP addresses get regularly added to DNSBLs (public blocklists), which many SMTP servers query for spam filtering. If this happens, it will look like this in your exim4 logs:/var/log/exim4/mainlog:2025-11-29 08:33:13 H=m244-21.mailgun.net [159.112.244.21] F=<bounce+5c3ca9.4d1858-jc=unternet.net@mg2.substack.com> rejected RCPT <jc@unternet.net>: 159.112.244.21 is listed at bl.spamcop.net (127.0.0.2: Blocked - see https://www.spamcop.net/bl.shtml?159.112.244.21)
For a split configuration, here is the patch. If you’re using the default config instead, just modify /etc/exim4/exim4.conf.template.
diff -uNr exim4.20251129.back/conf.d/acl/30_exim4-config_check_rcpt exim4/conf.d/acl/30_exim4-config_check_rcpt
--- exim4.20251129.back/conf.d/acl/30_exim4-config_check_rcpt 2017-02-21 14:38:20.000000000 -0500
+++ exim4/conf.d/acl/30_exim4-config_check_rcpt 2025-11-29 22:25:01.266602614 -0500
@@ -298,6 +298,9 @ # sender IP addresses
.ifdef CHECK_RCPT_IP_DNSBLS
deny
+ !hosts = ${if exists{CONFDIR/local_host_dnsbl_whitelist}\
+ {CONFDIR/local_host_dnsbl_whitelist}\
+ {}}
dnslists = CHECK_RCPT_IP_DNSBLS
add_header = X-Warning: $sender_host_address is listed at $dnslist_domain ($dnslist_value: $dnslist_text)
log_message = $sender_host_address is listed at $dnslist_domain ($dnslist_value: $dnslist_text)
(don’t trust the spacing of the above patch—manually edit the files instead.)
The contents of my /etc/exim4/local_host_dnsbl_whitelist is currently:
159.112.0.0/16 # substack, many IPs blocked by spamcop
You can, of course, add more individual IPs, or CIDR ranges as above, as you see them show up in your rejectlog.


