3 Replies Latest reply on Jan 6, 2009 5:59 PM by Noel O'Connor

    IMAP via TLS in JBoss 4.2.2.GA

    Ralf Heydenreich Newbie

      Hi all,
      I'm just trying to connect to an IMAP mailserver from JBoss. But all I get is the following exception:

      15:07:10,484 ERROR [STDERR] javax.mail.MessagingException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target;
       nested exception is:
       javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      15:07:10,499 ERROR [STDERR] at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:479)
      15:07:10,499 ERROR [STDERR] at javax.mail.Service.connect(Service.java:297)
      15:07:10,499 ERROR [STDERR] at javax.mail.Service.connect(Service.java:156)
      15:07:10,499 ERROR [STDERR] at javax.mail.Service.connect(Service.java:105)


      My mail-service.xml looks like following:

       <mbean code="org.jboss.mail.MailService" name="MSTM:service=OrderSMSService">
       <attribute name="JNDIName">java:/ORDERSMS
       </attribute>
       <attribute name="User">me</attribute>
       <attribute name="Password">dontknow</attribute>
       <attribute name="Configuration">
       <configuration>
       <property name="mail.transport.protocol" value="imap" />
       <property name="mail.user" value="me" />
       <property name="mail.password" value="dontknow" />
      
       <property name="mail.host" value="my.favourite.mailserver.com" />
      
       <property name="mail.smtp.host" value="my.favourite.mailserver.com" />
      
       <property name="mail.imap.starttls.enable" value="true" />
      
       <property name="mail.debug" value="true" />
       </configuration>
       </attribute>
       </mbean>
      


      To access the mailbox I'm using the following code:

      Store store = mailSession.getStore("imaps");
       store.connect();
      

      How can I tell JBoss to connect to the IMAP server?

      TIA,
      Ralf.