Hello,

For my mailserver I have a blacklist so that I can black annoying
senders. According to smtpd.conf(5) I should be able to block entire
domains by prepending a domain with '@', but this doesn't work for me.
An full email address is blocked.

martijn@

Version: OpenBSD 5.9-stable
$ cat /etc/mail/smtpd.conf
#       $OpenBSD: smtpd.conf,v 1.4 2012/07/16 05:56:16 jmc Exp $

# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.

pki keys certificate "/etc/ssl/mail.imperialat.at.crt"
pki keys key "/etc/ssl/private/mail.imperialat.at.key"

table authdb sqlite:/etc/mail/auth.conf
table rejectdb sqlite:/etc/mail/reject.conf
table blacklist sqlite:/etc/mail/blacklist.conf

filter dkim dkim-signer "-D" "imperialat.at" "-p"
"/etc/mail/dkim/private.key" "-s" "deathstar"

listen on egress tls pki keys auth-optional <authdb>
listen on all port submission filter dkim tls-require pki keys auth <authdb>

# Email addresses
table aliases db:/etc/mail/aliases.db

reject from any sender <blacklist> for any
reject from any for domain <authdb> recipient <rejectdb>
accept from any for domain <authdb> virtual <authdb> userbase <authdb>
deliver to maildir "%{user.directory}/Maildir/%{dest.domain}/%{dest.user:strip}"

accept for local alias <aliases> deliver to mbox
accept for any relay
$ cat /etc/mail/blacklist.conf
dbpath          /etc/mail/storage.db

query_mailaddr SELECT sender FROM blacklist WHERE sender=?;
# sqlite3 /etc/mail/storage.db
sqlite> SELECT * FROM blacklist;
...
@bar.com
f...@bar.com
...
$ telnet mail.imperialat.at smtp
Trying 92.111.209.89...
Connected to imperialat.at.
Escape character is '^]'.
220 mail.imperialat.at ESMTP OpenSMTPD
HELO hackroom.obsd
250 mail.imperialat.at Hello hackroom.obsd [x.x.x.x], pleased to meet you
MAIL FROM: <b...@bar.com>
250 2.0.0: Ok
RCPT TO: <opensm...@list.imperialat.at>
250 2.1.5 Destination address valid: Recipient ok
QUIT
221 2.0.0: Bye
Connection closed by foreign host.
$ telnet mail.imperialat.at smtp
Trying 92.111.209.89...
Connected to imperialat.at.
Escape character is '^]'.
220 mail.imperialat.at ESMTP OpenSMTPD
HELO hackroom.obsd
250 mail.imperialat.at Hello hackroom.bsd [x.x.x.x], pleased to meet you
MAIL FROM: <f...@bar.com>
250 2.0.0: Ok
RCPT TO: <opensm...@.list.imperialat.at>
550 Invalid recipient
QUIT
221 2.0.0: Bye
Connection closed by foreign host.

-- 
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org

Reply via email to