Hi,

I have an OpenSMTPD on OpenBSD 6.4 MX server which first scans mails with 
Amavis (SpamAssassin + ClamAV) and then delivers it using LMTP to Dovecot. Now 
all mails first go through Amavis which means that even if the mailbox in 
Dovecot does not exist the mail gets processed by Amavis which seems like a 
waste of resources.

Would it possible to have OpenSMTPD first check if the user exists before 
passing the mail to Amavis? I have my valid users defined in a PostgreSQL table 
called vuser and mapped it as the vusers table in OpenSMTPD. I am using the 
table-postgresql extras addon. If the user does not exist then it could abort 
the whole process immediately and return something like User not found. Not 
sure though if this is possible with OpenSMTPD yet?

The relevant part of my smtpd.conf file looks like this:

<...>
table domains postgres:/etc/mail/postgresql.conf
table vusers postgres:/etc/mail/postgresql.conf

action "local" mbox alias <aliases>
action "relay" relay
action "relay_amavis" relay host smtp://127.0.0.1:10024
action "lmtp_dovecot" lmtp "/var/dovecot/lmtp" rcpt-to virtual <vusers>

match for local action "local"
match tag AMAVIS for domain <domains> action "lmtp_dovecot"
match tag AMAVIS for any action "relay"
match from any for domain <domains> action "relay_amavis"
match for any action "relay"
<...>

Regards,
Mabi

--
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to