james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Norman Maurer (JIRA)" <j...@apache.org>
Subject [jira] Commented: (MAILETSTANDARD-5) VirtualUserTable - uses reserve words in MSSQL server
Date Fri, 23 Oct 2009 07:19:59 GMT

    [ https://issues.apache.org/jira/browse/MAILETSTANDARD-5?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769122#action_12769122
] 

Norman Maurer commented on MAILETSTANDARD-5:
--------------------------------------------

You could simply specify the sqlquery string by your own. 
As default it use:

select VirtualUserTable.target_address from VirtualUserTable, VirtualUserTable as VUTDomains
where (VirtualUserTable.user like ? or VirtualUserTable.user like '\\%') and (VirtualUserTable.domain
like ? or (VirtualUserTable.domain like '\\%' and VUTDomains.domain like ?)) order by concat(VirtualUserTable.user,'@',VirtualUserTable.domain)
desc limit 1

just configure JDBCVirtualUserTable with something like this:

<mailet match="All" class="org.apache.james.transport.mailets.JDBCVirtualUserTable">
    <sqlquery>select VirtualUserTable.target_address from VirtualUserTable, VirtualUserTable
as VUTDomains where (VirtualUserTable.$USER like ? or VirtualUserTable.$USER like '\\%') and
(VirtualUserTable.domain like ? or (VirtualUserTable.domain like '\\%' and VUTDomains.domain
like ?)) order by concat(VirtualUserTable.$USER,'@',VirtualUserTable.domain) desc limit 1</sqlquery>
</mailet>

Replace $USER with the column name of your choice..

Hope this helps.

Bye,
Norman




> VirtualUserTable - uses reserve words in MSSQL server 
> ------------------------------------------------------
>
>                 Key: MAILETSTANDARD-5
>                 URL: https://issues.apache.org/jira/browse/MAILETSTANDARD-5
>             Project: JAMES Standard Mailets
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: WindowsXP  MS SQL Server 2005 (James 2.3.2)
>            Reporter: Janaka Paranamanage
>            Assignee: Robert Burrell Donkin
>            Priority: Blocker
>
> When configuring James to work with a db and to support multiple domain it cannot add
new user accounts. 
> James ask to create the virtualusertable in the db with  user as a column name which
is a reserved word in mssql server therefore db saves it as [user]  instead of user. 
> however  class  org.apache.james.transport.mailets.JDBCVirtualUserTable  calls this column
as VirtualUserTable.user 
> I believe it would be great if the table names and column names are defind in a xml file
so mail administrator can change them to suite the environment.
> ***Would be great if I can know how can we fix this quickly till next fixed is released
by James. (Since we are having few mail servers running world wide ) 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message