HI,

I have added a table in my smtp.conf to reject certain IP addresses;

table shithole file:/etc/mail/blacklist

The file ‘blacklist’ contain the IP addresses that I wish to block, one per 
line. I also have added a reject statement to my ‘smtpd.conf’ like so;

reject from source <shithole> for any

What I notice is that it does not block the IP address and it continues to 
attempt a connection to the mail server. The IP address in question is showing 
up in ‘/var/log/maillog’ like so;

Sep 28 18:22:12 obsd-svr3 smtpd[68949]: b6ab24ef369520cc smtp 
event=failed-command address=185.xxx.xxx.254 host=185.xxx.xxx.254 command="AUTH 
LOGIN" result="503 5.5.1 Invalid command: Command not supported”

Any idea why the reject statement does not work? 

Full smtpd.conf;

pki mail.example.com certificate "/etc/ssl/example.com.fullchain.pem"
pki mail.example.com key "/etc/ssl/private/example.com.key"

table aliases file:/etc/mail/aliases
table vdomains file:/etc/mail/vdomains
table vusers file:/etc/mail/vusers
table passwd passwd:/etc/mail/passwd
table shithole file:/etc/mail/blacklist

listen on lo
listen on lo port 10028 tag DKIM_OUT
listen on egress port smtp tls pki mail.example.com auth-optional <passwd>
listen on egress port submission tls-require pki mail.example.com auth <passwd>

reject from source <shithole> for any

accept from local for local alias <aliases> deliver to lmtp "/var/dovecot/lmtp" 
rcpt-to
accept from any for domain <vdomains> virtual <vusers> deliver to lmtp 
"/var/dovecot/lmtp" rcpt-to
accept tagged DKIM_OUT for any relay
accept from local for any relay via smtp://127.0.0.1:10027



Reply via email to