james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny Angus" <da...@thought.co.uk>
Subject RE: minor bugs in latest 11-jan source + possible fixes
Date Mon, 04 Feb 2002 10:06:44 GMT
In response to this I've changed James.java (branch 2.0a2candidate1) however
I've made severNames contain lowercase'ed names,
and call o.a.James.contains() with lowercase servername, b'cos..

a) domain names are case insensitive according to rfc1035:
"Note that while upper and lower case letters are allowed in domain
names, no significance is attached to the case.  That is, two names with
the same spelling but different case are to be treated as if identical"

b) it should be faster than iterating where you have more than a handful of
servernames.(correct me if I'm assuming too much here)

I hope that there isn't any other part of James which requires case
sensitive domain comparisons, I don't expect there to be (see a above).

These changes will be merged into the head after the release (today I hope).


> Once this was working it lead to another bug, if the server
> requires SMTP authentication it should only challenge requests
> for hosts outside its local network, and this is tested in
> SMTPHandler.doRCPT which tests the destination host with
> James.isLocalServer(String). The bug here is that the server
> strings comparison is not case-sensitive, so that if I send an
> email to kevin@open-iq.com from outside the local network without
> SMTP authentication and the domain is defined as Open-IQ.com in
> the xml config then the mail is rejected as unauthorised. Heres
> one solution.
>   public boolean isLocalServer(final String serverName) {
>         Iterator eachName = serverNames.iterator();
>         while (eachName.hasNext()) {
>             String thisName = (String) eachName.next();
>             if (thisName.compareToIgnoreCase(serverName) == 0) {
>                 return true;
>             }
>         }
>         return false;
>     }
> bye,
>  Kevin.

To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>

View raw message