[lug] postfix speed optimization
Ben Luey
bluey at iguanaworks.net
Thu May 19 10:06:19 MDT 2011
> Are they either SASL authenticating, or in the "mynetworks"? Because your
> recipient restrictions should short-circuit in those two cases and not fall
> through to the check_recpient_access rule, in:
>
>> smtpd_recipient_restrictions =
>> permit_mynetworks
>> permit_sasl_authenticated,
>> reject_non_fqdn_recipient
>> reject_unauth_destination,
>> check_recipient_access hash:/etc/postfix/access,
Yes, I believe my users are bypassing the check_recipient_access because
they are either local (line 1) or SASL authenticated (line 2). However,
I believe the slow query is not the check_recipient_access but my
(virtual) aliases file (which is a hash, ldap, and sql lookup). So even
for local users, when I connect and say "I'm sending mail to local user
john", postfix does a slow ldap and sql query to see if john is an
alias, when that fails, it says 'oh John is a local user, we are good.
Or if I send mail to john at gmail.com, postfix still does the slow alias
lookup and when that fails, says 'sending to remote user, ok send me the
email message'. I want to delay this query until after accepting the
message -- or at least limit that slow query to run only if recipient is
local and isn't found in an earlier lookup. Or maybe I need to find a
better way to do a mailing list -- currently I'm having postfix look up
aliases against my mailing list db. But the query is slow and sadly
running 99.5% on queries that produce no results as most emails aren't
being sent to the mailing list.
Ben
More information about the LUG
mailing list