[lug] postfix speed optimization [Solved]

Ben Luey bluey at iguanaworks.net
Thu May 19 14:15:11 MDT 2011


I found the solution. Simply added the line

domain = mydomain.com

to my sql and ldap query files for postfix. This tells postfix not to do 
the lookup for domains other than mydomain.com. So when sending to 
john at gmail.com, it doesn't do the query. When sending to 
john at mydomain.com john resolves quickly as a virtual user and the query 
isn't run. If I email fakeuser at mydomain.com only then does the query run 
and then the email bounces. (Or maillinglist at mydomain.com where the 
query actually returns the right results).

Thanks for the help,

Ben

> 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
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>




More information about the LUG mailing list