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

    JavaMail support on AS7


      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.



      George Gastaldi

        • 1. Re: JavaMail support on AS7

          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

            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.



            • 3. Re: JavaMail support on AS7

              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

                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

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

                  • 6. Re: JavaMail support on AS7

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

                    • 7. Re: JavaMail support on AS7

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


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














                      • 8. Re: JavaMail support on AS7

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

                        • 9. Re: JavaMail support on AS7

                          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

                            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

                              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

                                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




                                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" />


                                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




                                • 13. Re: JavaMail support on AS7

                                  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" />



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

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



                                  Thanks in advance!

                                  • 14. Re: JavaMail support on AS7

                                    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