Last active
October 12, 2018 23:50
-
-
Save evilchili/3795853 to your computer and use it in GitHub Desktop.
blackhole all mail except for one domain using postfix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define a transport for mail you want to deliver | |
echo "$VALID_DOMAIN smtp:[$VALID_RELAYHOST]" > /etc/postfix/transport | |
postconf -e transport_maps = hash:/etc/postfix/transport | |
# everything else goes to a bogus relayhost, which causes a bounce | |
postconf -e relayhost = 169.254.0.0 | |
# immediately throw away all bounces | |
postconf -e maximal_queue_lifetime = 0 | |
postconf -e bounce_queue_lifetime = 0 | |
# optionally record all blackholed mail to a specific address | |
# postconf -e always_bcc = blackhole@$VALID_DOMAIN | |
# time for Jell-O(tm) | |
postmap /etc/postfix/transport | |
postfix reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment