james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefano Bagnara (JIRA)" <server-...@james.apache.org>
Subject [jira] Commented: (JAMES-426) Make james use virtual user table domains for servernames
Date Thu, 02 Mar 2006 18:46:42 GMT
    [ http://issues.apache.org/jira/browse/JAMES-426?page=comments#action_12368565 ] 

Stefano Bagnara commented on JAMES-426:
---------------------------------------

Considerations/Notes about current use of servernames inside James:

Servernames are used mainly to provide the isLocalServer method.
"isLocalServer" is a method of both the MailServer and the MailetContext component interfaces
(both implemented by the James component)

the server names are stored in a map and a few components currently depends on this map:
James put this map into the "MailetContext.attributes" and in the Avalon "Context" with the
key "SERVER_NAMES"
UsersLDAPRepository currenlty gets the servernames from the Avalon Context (Contextualize)
RemoteDelivery gets the servernames from the MailetContext (and takes the first entry when
it's unable to retrieve the localhost name)

UsersLDAPRepository uses the map only for logging purpose and publish the first as a public
method: we don't use this class and if it needs the domain names it could lookup the MailServer
component.
RemoteDelivery could be changed to run a lookup of the MailServer and take the first name
there.

Both current direct uses of the servernames map are wrong and an "abuse" of its meaning: we
probably should provide a property containing a fallback hostname for this purpose. If we
don't publish the servernames map then we correctly encapsulate the feature and we can safely
modularize it.

As a reference the MailServer.isLocalServer is currently used by:
smtpserver.RcptCmdHandler 
fetchmail.MessageProcessor (uses sendMail and getId, also)
fetchmail.ParsedConfiguration (as above)

As a reference the MailetContext.isLocalServer is currently used by:
transport.matcher.HostIsLocal
transport.mailet.PostmasterAlias
transport.matcher.AbstractStorageQuota (uses isLocalUser, also)
transport.matcher.RecipientIsLocal (uses isLocalUser, also)
transport.mailet.AbstractVirtualUserTable (uses sendMail, bounce, also)
transport.mailet.BayesianAnalysis (uses getAttribute, also)

----

After that cleaning we could create a new james service to provide the isLocalServer method
(and maybe the isLocalUser method).
We can add this new dependency to the James component and add the lookup code in the service()
method: if we find the service we delegate to that component otherwise we continue with the
current behaviour.
So by default isLocalServer simply check the <servernames> attribute and isLocalUser
simply check the localuserrepository for the localpart but it would be easier to customize
this behaviour.


> Make james use virtual user table domains for servernames
> ---------------------------------------------------------
>
>          Key: JAMES-426
>          URL: http://issues.apache.org/jira/browse/JAMES-426
>      Project: James
>         Type: Improvement
>   Components: James Core
>  Environment: N/A
>     Reporter: Daniel Perry
>     Priority: Trivial
>  Attachments: patch.txt
>
> Attached is a patch that makes james use the virtualusertable database for identifying
local hosts.  It also allows for continued use of servernames block.  It is backwards compatible,
and unless an extra attribute is added in the configuration, it wont affect james's behaviour.
> It is configured by adding the domainTable attribute to the servernames element, eg:
> <servernames autodetect="true" autodetectIP="true" domainTable="db://maildb/VirtualUserTable">
> Please note that the patch i will attach against svn trunk, but has been copied over
directly from 2.2.0, and i havnt had a chance to check if it compiles or works with svn trunk.
> Daniel.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
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