amavis-user April 2011 archive
Main Archive Page > Month Archives  > amavis-user archives
amavis-user: Whitelisting via SQL lookup to other address book

Whitelisting via SQL lookup to other address book

From: Geoff Sweet <gorf_at_nospam>
Date: Wed Apr 20 2011 - 23:45:39 GMT
To: amavis-users@amavis.org

  Greetings everyone, I am running amavisd-new 2.6.4. It's been very
stable for me. I would like to try to extend it a little via SQL. The
vast majority of my virtual users read email via a web interface. That
interface (horde) provides a fairly robust address book system. I'm
hoping that someone could help me understand if it would be possible to
tune the $sql_select_white_black_list and %sql_clause to look into that
address book database for whitelisting.

I can see in the structure of the table that the addresses in the
address book are sorted via the address of the user. I also can see in
the documentation how to build a SQL query that will return the same
format of data as described in the README.sql.txt. What I am not
totally clear on is what else I do or don't need to do.

If I add the $sql_select_white_black_list into the amavisd.conf with my
query, I then need to add the %sql_clause lines as well? Something like
this:

$sql_select_white_black_list = 'SELECT SOME STUFF';
%sql_clause = (
'sel_wblist' => \$sql_select_white_black_list
);

Correct? If I understand correctly, anything else in the sql_clause
that is left out defaults back to whatever is in the cofig file? Or do
I have to uncomment the entire %sql_clause block and define the entire
SQL structure?

Thanks for the help,

-Geoff Sweet