I am thinking specifically of PostgreSQL where I can write a function (aka stored proceedure) that I could do:
SELECT sieve_cmd(<user_idnr>); The sieve_cmd function could check the sieve tables just like the normal select would, and if nothing came back for the user_idnr, it could find their client_idnr (or the @domain.tld portion, etc) and then look up rules based on that, then even get global rules then return it all in a nice output form that DBMail is expecting it in. These items could be additive or it could be the more specific rule wins, etc. That's the beauty of being able to use a function for it, you can decide on your policy. The other option could also to do a SQL view that does SELECTs and UNIONs to generate the output you desire, but without some logic in there you could get into trouble with this method. -- David A. Niblett | email: [EMAIL PROTECTED] Network Administrator | Phone: (352) 334-3400 Gainesville Regional Utilities | Web: http://www.gru.net/ -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, May 23, 2006 5:04 PM To: DBMail mailinglist Subject: RE: [Dbmail] sieve script for all users David, did you mean function, that executed when dbmail do something like SELECT FROM dbmail_sievecmd WHERE username='username'? and then function should return sieve code to SELECT? really, i don't know sieve-cmd implementation in dbm whery well, but i think, it should be about this. Alexander > Why not just use a conditional union or function (not sure about MySQL > here). We do this now for our Spam rules from Amavis. We just use a > function that selects the specific users rules, or the groups rules, > or the default rules. > > I don't see why the sieve select couldn't work the same > way if you really wanted it to. You could change the select statement > in the code then make your own custom function. > > It would be nice if you could customize your own SQL statements at > runtime. FreeRadius does this which we customized the snot out of > this way. _______________________________________________ Dbmail mailing list [email protected] https://mailman.fastxs.nl/mailman/listinfo/dbmail
