[ 
https://issues.apache.org/jira/browse/JAMES-796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513089
 ] 

Ralf Hauser commented on JAMES-796:
-----------------------------------

again, sure using a perfect dns server avoids the problem. However a little 
more studying the dns servers without recursive lookup, it appears that the 
solution is the following

    in rawDNSLookup(String namestr, boolean querysent, int type, 
ExtendedResolver reslvr)

extend

   if (rcode == Rcode.NOERROR || rcode == Rcode.NXDOMAIN) {
                                cached = cache.addMessage(response);
                                if (cached != null && cached.isSuccessful()) {
                                        return processSetResponse(cached);
                                }
   }

to 

   if (rcode == Rcode.NOERROR || rcode == Rcode.NXDOMAIN) {
                                cached = cache.addMessage(response);
                                if (cached != null ) { if ( 
cached.isSuccessful()) {
                                        return processSetResponse(cached);
                                }
                                if (cached.isDelegation()) {
                                        RRset rs = cached.getNS();
                                        if (null == rs) {
                                                log.error("null == rs", new 
Exception());
                                        } else {
                                                // log.debug(rs.getDClass());
                                                // log.debug(rs.getName());
                                                // log.debug(rs.getTTL());
                                                // log.debug(rs.getType());
                                                if (0 == rs.size()) {
                                                        log.error("0 == 
rs.size()", new Exception());
                                                } else {
                                                        Iterator it = rs.rrs();
                                                        // it = rs.sigs();
                                                        // log.debug(it);
                                                        String[] authoritatDNS 
= new String[rs.size()];
                                                        int i = 0;
                                                        while (it.hasNext()) {
                                                                
authoritatDNS[i] = ((NSRecord) it.next()).getTarget().toString();
                                                                i++;
                                                        }
                                                        log.debug("found " + i 
+ " new DNS servers");
                                                        ExtendedResolver 
reslvrDom = new ExtendedResolver(authoritatDNS);
                                                        return 
rawDNSLookup(namestr, false, type, reslvrDom);
                                                }
                                        }
                                     }
                                }

ps, it appears, however that not the sunrise.ch dns servers, but 
"194.246.118.118"  and  "212.25.28.55" are the culprits!

> Do also query authoritative nameservers to obtain MX record
> -----------------------------------------------------------
>
>                 Key: JAMES-796
>                 URL: https://issues.apache.org/jira/browse/JAMES-796
>             Project: James
>          Issue Type: Improvement
>            Reporter: Armin Häberling
>
> for example for zunft-oberstrass.ch
> DNSServer.lockup("zunft-oberstrass.ch", Type.MX, "MX")
> will return null, but
> DNSServer.lockup("zunft-oberstrass.ch", Type.NS, "NS")
> will return two authoritative nameservers, which then can be queried and 
> return the MX record for zunft-oberstrass.ch.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to