Hi,

Here at Quirk we've put together a new SQL query for the JDBCVirtualUserTable. It allows you to use wildcards in the domain column, so

+------+-----------+----------------+
| user | domain    | target_address |
+------+-----------+----------------+
| blue | abc.net   | red            |
| blue | abc.*     | green          |
| blue | abc.co.*  | blue           |
+------+-----------+----------------+

are all possible. Most exact matches are chosen first. Essentially, you just need to add the sqlquery init parameter as below:

         <mailet match="All" class="JDBCVirtualUserTable">
           <table>db://maildb/VirtualUserTable</table>
<sqlquery>select target_address from VirtualUserTable where user = ? and ? like replace(domain, '*', '%') and ? is not null order by length(domain) desc limit 1</sqlquery>
         </mailet>

It may be MySQL specific. I hope it is of use to someone.

Craig

www.quirk.biz

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to