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 [EMAIL PROTECTED] (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?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ AMaViS-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/
