From tutorial to open relay: how a Postfix server relays for strangers

From tutorial to open relay: how a Postfix server relays for strangers A workflow diagram generated by Archify. 01 / Spammer 02 / Your Postfix server EX / Copied from tutorials Connect The relay decision Spammer's bot · scans for open port 25 · Spammer › Connect Spammer's bot scans for open port 25 Stolen password · phished or guessed · Spammer › Connect Stolen password phished or guessed Relay access denied · 454 or 554: a correct answer · Spammer › The relay decision Relay access denied 454 or 554: a correct answer SMTP session · RCPT TO: x@gmail.com · Your Postfix server › Connect SMTP session RCPT TO: x@gmail.com Relay decision · smtpd_relay_restrictions · Your Postfix server › The relay decision · first match wins Relay decision smtpd_relay_restrictions first match wins 250 OK, accepted · for a domain not yours · Your Postfix server › The relay decision 250 OK, accepted for a domain not yours Gateway trusted · Docker or proxy hides IPs · Copied from tutorials › Connect Gateway trusted Docker or proxy hides IPs mynetworks too wide · 0.0.0.0/0 to fix a client · Copied from tutorials › The relay decision mynetworks too wide 0.0.0.0/0 to fix a client permit before reject · unauth check never runs · Copied from tutorials › The relay decision permit before reject unauth check never runs relay for me? AUTH with it connects to port 25 permitted correct config check ends early permit_mynetworks everyone is 172.17.0.1 Legend Postfix stages Relay checks and the mistakes that defeat them Outside actors and consequences