You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Danny Angus <da...@thought.co.uk> on 2002/02/04 11:06:44 UTC

RE: minor bugs in latest 11-jan source + possible fixes

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

d.


> 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: minor bugs in latest 11-jan source + possible fixes

Posted by Danny Angus <da...@thought.co.uk>.
sorry the first para of that makes no sense..!

instead try..

I've changed it so that the serverNames Vector contains only lowercase
names, and isLocalServer() calls serverNames.contains() with the servername
argument forced to lower case.

d.

> -----Original Message-----
> From: Danny Angus [mailto:danny@thought.co.uk]
> Sent: Monday, February 04, 2002 10:07 AM
> To: James Developers List; Kevin Holmes
> Subject: RE: minor bugs in latest 11-jan source + possible fixes
>
>
> 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..


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>