Andy,
the installer on windows itself is working...

... but the configured dns server is not set at system startup.

When the system starts up and I do a mx-lookup, it fails.
When I then add the configured dns server through jmx-console and
do the mx-lookup again, it shows a result.

Also with my listDNSServers() method, this produces an empty list of servers 
after startup of the service.

The setDNSServer() operation is not working correctly for several reasons (I 
might be wrong):

- Passed in gets the server-element which is within the attribute tag. So 
getElementsByTagName() won't find anythign, as the server element has no 
elements as children, but only a text node.
- It seems to me that only one server-element will be ever passed in, even if 
more than one server is given in the config. 

A solution could be to surround the server-Elements by a servers-Element, that 
contains 1..n server-Elements


  | <attribute name="DNSServers">
  |   <servers>
  |       <server>1.2.3.4</server>
  |       <server>2.3.4.5</server>
  |   </servers>
  | </attribtue>
  | 

The following patch supports this and works for me:


  | Index: SMTPSender.java
  | ===================================================================
  | RCS file: 
/cvsroot/jboss/jboss-mail/src/java/org/jboss/mail/smtp/sender/SMTPSender.java,v
  | retrieving revision 1.18
  | diff -u -r1.18 SMTPSender.java
  | --- SMTPSender.java 8 Jan 2005 20:32:27 -0000       1.18
  | +++ SMTPSender.java 15 Jan 2005 12:43:13 -0000
  | @@ -75,7 +75,7 @@
  |     };
  |  
  |     public SMTPSender() {
  | -           resolvers = new HashMap();
  | +           resolvers = new HashMap();              
  |     }
  |  
  |     protected void startService() throws Exception {
  | @@ -93,6 +93,8 @@
  |  
  |     public void addDNSServer(String dns) throws UnknownHostException {
  |             SimpleResolver sr = new SimpleResolver(dns);
  | +           if (resolver==null)
  | +                   resolver = new ExtendedResolver(); // setting 
attributes need this and they get set very early in the lifecycle
  |             resolver.addResolver(sr);
  |             resolvers.put(dns, sr);
  |     }
  | @@ -506,20 +508,13 @@
  |      * @see 
org.jboss.mail.smtp.sender.SMTPSenderMBean#setDNSServers(org.w3c.dom.Element)
  |      */
  |     public void setDNSServers(Element servers) throws Exception {
  | -            NodeList list = servers.getElementsByTagName("server");
  | -            for (int k = 0; k < list.getLength(); k++) {
  | -               String server = getNodeText((Node)list.item(k)).trim();
  | -               resolvers.put(server,server);
  | -            }
  | -
  | -                if (resolvers.values().size() > 0) {
  | -                        Resolver[] r =
  | -                                (Resolver[]) resolvers.values().toArray(
  | -                                        new 
Resolver[resolvers.values().size()]);
  | -                        this.resolver = new ExtendedResolver(r);
  | -                } else {
  | -                        this.resolver = new ExtendedResolver();
  | -                }
  | +           
  | +       NodeList list = servers.getElementsByTagName("server");
  | +       for (int k = 0; k < list.getLength(); k++) {
  | +          String server = getNodeText((Node)list.item(k)).trim();
  | +          System.out.println("--> Server found is " + server);
  | +          addDNSServer(server);
  | +       }
  |     }
  |  
  |  //todo move to util class
  | 

If wanted I can commit it to HEAD.
Unfortunately I have no clue on what to do wrt the installer to support this.

 Heiko


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3862247#3862247

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3862247


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to