[AMaViS-user] Custom sql policy? Added MORE load? SQL experts?

This is a discussion on [AMaViS-user] Custom sql policy? Added MORE load? SQL experts? within the Amavis User forums, part of the Anti-Spam and Anti-Virus Related Forums category; Had a custom front end that needed to allow for NULL policy for users (so users policy was derived from ...


Go Back   Usenet Forums > Anti-Spam and Anti-Virus Related Forums > Amavis User

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2007
Michael Scheidell
 
Posts: n/a
Default [AMaViS-user] Custom sql policy? Added MORE load? SQL experts?

Had a custom front end that needed to allow for NULL policy for users
(so users policy was derived from either the @domain.com or the @.
Catchall)

Lots of reasons, if anyone is interested, contact me off list.
It solved some user issues with policies, and was required for me to
actually get whitelisting to NON interactive users to work.

(ie, user logs in, creates a policy, add whitelist, life is fine)

BUT, if user doesn't log in, doesn't create a policy, and I want to add
a whitelist for him I have to create a user entry, and what policy do I
select? @domain.com? @.? What if @. Changes? Do you change users
policy?

Well, once again, the flexibility in amavisd-new comes to the rescue.
Just replace $sql_select_policy in amavisd.conf.

$sql_select_policy =
'select * from '.
'( SELECT policy.* FROM users '.
'left join policy on users.policy_id=policy.id '.
'where users.email in (%k) '.
'and users.policy_id NOT NULL order by users.priority desc) as
DerivedTablea, '.
'(select id from users '.
'where email in (%k) '.
'order by priority desc) as DerivedTableb';


I am ASSUMING, that this DOES add extra overhead, it will actually look
up two different users.id. But, it seems to work.

By allowing a NULL users.policy_id and checking for it, bypassing the
user id on first pass if NULL, this SHOULD allow a 'automatically
generated' users account, without selecting a policy.

The complexity was needed if it selected a derived policy, returned the
@domain.com user id, but the whitelist was actually owned by
user@domain.com

(ok, it SEEMS to work on mysql5.0. haven't tested on sqlite or
postgres, haven't tested on mysqll4.1)

Any comments? Adding .001% overhead? Or 10% overhead?

--
Michael Scheidell, CTO
SECNAP Network Security
See us at SecureWorld in Atlanta
http://www.secnap.com/events

__________________________________________________ _______________________
This email has been scanned and certified safe by SpammerTrap(tm).
For Information please see http://www.spammertrap.com
__________________________________________________ _______________________

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?p...rge&CID=DEVDEV
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/...fo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:21 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0