1 2 Previous Next 27 Replies Latest reply on Jun 20, 2012 8:26 AM by ctomc

    JavaMail support on AS7

    gastaldi

      Hello !

       

      I´ve realized that JBoss AS 7 does not support JavaMail yet (AS7-1177 and the release notes confirms this).

      I believe it could work as a subsystem, so I decided to start a new mail subsystem and add my initial work on https://github.com/gastaldi/jboss-as/tree/mail/mail

       

      I started my implementation with this reference: https://docs.jboss.org/author/display/AS7/Example+subsystem

       

      However, I still need to figure out how does JBAS 7 handles injection targets (How to handle @Resource elements so that a javax.mail.Session is injected in that). I also need to figure out how to make the Session JTA-aware.

       

      I´m trying to follow the implementation on other submodules, but no luck yet. I could surely use some help from the JBoss AS7 experts.

       

      As always, of course, any tip is welcome.

       

      Regards,

      George Gastaldi

        • 1. Re: JavaMail support on AS7
          jaikiran

          I think Ales is working on JavaMail support too (or some infrastructure to support it), from what I understand of his mail to AS7 dev list http://lists.jboss.org/pipermail/jboss-as7-dev/2011-July/003342.html

          • 2. Re: JavaMail support on AS7
            gastaldi

            Nice, but maybe it would be nice to hear what´s planned for 7.0.1 to know if I am following the right path.

            Support for JavaMail should be a straightforward solution I suppose. The only issue I am concerned about is the JTA integration.

             

            Thanks

            • 3. Re: JavaMail support on AS7
              sfcoy

              As far as I know there is no requirement for JavaMail to be transactional, so I'm not sure that you need to be concerned with JTA at all.

              • 4. Re: JavaMail support on AS7
                jaikiran

                Stephen Coy wrote:

                 

                As far as I know there is no requirement for JavaMail to be transactional

                That's correct.

                • 5. Re: JavaMail support on AS7
                  cs02rm0

                  Has there been any update on JavaMail support in AS7 in the last month? Thanks.

                  • 6. Re: JavaMail support on AS7
                    gastaldi

                    It has been integrated in the master branch and probably wil be available on the next release.

                    • 7. Re: JavaMail support on AS7
                      jboss_queries

                      Im getting this error in my application . Can someone help me with this?

                       

                      java.lang.NoClassDefFoundError: javax/net/ssl/SSLPeerUnverifiedException

                      com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)

                      com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)

                      javax.mail.Service.connect(Service.java:295)

                      javax.mail.Service.connect(Service.java:176)

                      javax.mail.Service.connect(Service.java:125)

                      javax.mail.Transport.send0(Transport.java:194)

                      javax.mail.Transport.send(Transport.java:124)

                      com.vz.ag.util.UrlMailer.SendMail(UrlMailer.java:106)

                      com.vz.ag.servlet.sso.VerifyServlet.activatePwreset(VerifyServlet.java:149)

                      com.vz.ag.servlet.sso.VerifyServlet.processRequest(VerifyServlet.java:91)

                      com.vz.ag.servlet.sso.VerifyServlet.doPost(VerifyServlet.java:49)

                      javax.servlet.http.HttpServlet.service(HttpServlet.java:754)

                      javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

                      • 8. Re: JavaMail support on AS7
                        shorero2011

                        Doesn't seem to be in 7.0.2. Any more recent news?

                        • 9. Re: JavaMail support on AS7
                          jaikiran

                          The JIRA https://issues.jboss.org/browse/AS7-1177 indicates that it's fixed against 7.1.x (AS7 upstream), so try the latest nightly builds.

                          • 10. Re: JavaMail support on AS7
                            ctomc

                            What version are you using? 7.1.x from upstream?

                            How does you configuration looks like? it seems like you are using SSL

                             

                            Can you confirm the issue in latest nightly build (you can find it on hudson)

                            • 11. Re: JavaMail support on AS7
                              zenzei2k

                              Is there any way to configure properties (mail.smtp.auth, mail.smtp.starttls.enable, mail.from, etc.) like in old jboss?

                              • 12. Re: JavaMail support on AS7
                                ctomc

                                There is hendful of attributes you can use configure for javamail.

                                 

                                if you folow the schema you can see all that are currently supported/implemented

                                 

                                https://github.com/jbossas/jboss-as/blob/master/build/src/main/resources/docs/schema/jboss-as-mail.xsd

                                 

                                for instance if you want to configure login to smtp your config should look something like this:

                                 

                                <smtp-server outbound-socket-binding-ref="mail-smtp">

                                  <login name="username" password="password" />

                                </smtp-server>

                                same goes for other server types (imap,pop3)

                                 

                                If there is need for some additional setting to make some untested scenario work, let me know

                                 

                                cheers,

                                tomaz

                                • 13. Re: JavaMail support on AS7
                                  zenzei2k

                                  Hi tomaz!

                                  I read the xsd, but I ask because I didn't found there how to configure extra options as smtp.starttls or smtp.auth option.

                                   

                                  Is somehting like this?

                                  <smtp-server outbound-socket-binding-ref="mail-smtp">

                                    <login name="username" password="password" />

                                  </smtp-server>

                                  ...

                                  <outbound-socket-binding name="mail-smtp">

                                              <remote-destination host="smtp.gmail.com" port="587" smtp.auth="true" smtp.starttls="enable"/>

                                  </outbound-socket-binding>

                                   

                                  Thanks in advance!

                                  • 14. Re: JavaMail support on AS7
                                    ctomc

                                    smtp.auth and all authentication props are set when "<login ..." configuration is presented so there is no additional property needed to be set.

                                    "smtp.starttls"  is currently not supported, but as I see from sun's documentation it can be set to "enable" by default as it fallbacks to plain if server does not support it.

                                     

                                    If you need this fix, I can prepare it so you can test this.

                                    1 2 Previous Next