I am implementing some changes to mailzu that will enable a person to
manage multiple email addresses with a master user account. Below are
the queries that I was thinking of using. In sql_select_policy, the
point is to use the master user's policy (if it exists), unless the
master allows overrides, and the sub-user wants to override. In
sql_select_white_black_list, it pools the master's wblist (if it exists)
with all sub-users' wblists. I might add an override to this one too.
My question concerns the priority field. Based on my reading of a few
README's it seems like the only purpose is as convenience to indicate
how specific (or "complete") the email address of interest is. Am I
missing anything? I have not spent a lot of time pondering the
permutations of pooled priorities (alliteration unintended), so I'm
wondering if I'm creating any bizarre side effects by doing this. I'm
also curious as to how exactly the list in %k gets generated, and what
all goes in to it.
$sql_select_policy = q(
select users.*,policy.*,users.id
from users
left join users as u2
on users.parentid = u2.id
left join policy
on if( isnull( u2.over_policy )
|| users.over_policy='Y' && u2.over_policy='Y'
, users.policy_id=policy.id
, u2.policy_id=policy.id
)
where users.email in (%k)
order by users.priority desc
);
$sql_select_white_black_list = q(
SELECT wb
FROM users
left join users as u2
on if( users.parentid
, users.parentid=u2.parentid
, users.id=u2.id
)
left join wblist
on rid=u2.id
LEFT JOIN mailaddr
ON sid=mailaddr.id
WHERE users.id=?
AND ( mailaddr.email IN( %k ))
ORDER BY mailaddr.priority DESC
);
--
Jeff Orrok
LXVI Internet Services LLC
v:866-LXVI-NET
= 866-5984-638
f:888-352-3718
download my public key from http://lxvi.net/security/jefflxvi.pub
-------------------------------------------------------------------------
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/