2 Replies Latest reply on Oct 9, 2018 11:27 AM by dgrandi

    WildFly 10.1.0 DEBUG SMTP: need username and password for authentication

    dgrandi

      Hi All,

       

      I have a standalone WildFly 10.1.0 installation.

       

      I need to send emails from my application throught a SMTP server.

       

      I'm using the following configurations in "standalone-full.xml" :

       

                  <mail-session name="MailSession" debug="true" jndi-name="java:/mail/MailSession">

                      <smtp-server outbound-socket-binding-ref="anthema-smtp" tls="true" username="user@domain.it" password="mypassword"/>

                  </mail-session>

      ...

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

                  <remote-destination host="mail.mydomain.it" port="25"/>

              </outbound-socket-binding>

       

      When I specify username and password  in the mail-session group, the SMTP seems not to receive any communication from my application.

       

      I can see the following log trace:

       

      2018-10-09 09:28:22,410 INFO  [stdout] (default task-2) DEBUG: JavaMail version 1.5.5

      2018-10-09 09:28:22,410 INFO  [stdout] (default task-2) DEBUG: successfully loaded resource: /META-INF/javamail.default.providers

      2018-10-09 09:28:22,410 INFO  [stdout] (default task-2) DEBUG: Tables of loaded providers

      2018-10-09 09:28:22,410 INFO  [stdout] (default task-2) DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle]}

      2018-10-09 09:28:22,410 INFO  [stdout] (default task-2) DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]}

      2018-10-09 09:28:22,410 INFO  [stdout] (default task-2) DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map

      2018-10-09 09:28:22,425 INFO  [stdout] (default task-2) DEBUG: JavaMail version 1.5.5

      2018-10-09 09:28:22,425 INFO  [stdout] (default task-2) DEBUG: successfully loaded resource: /META-INF/javamail.default.providers

      2018-10-09 09:28:22,425 INFO  [stdout] (default task-2) DEBUG: Tables of loaded provider

      2018-10-09 09:28:22,425 INFO  [stdout] (default task-2) DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}

      2018-10-09 09:28:22,425 INFO  [stdout] (default task-2) DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}

      2018-10-09 09:28:22,425 INFO  [stdout] (default task-2) DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map

      2018-10-09 09:28:22,441 INFO  [stdout] (default task-2) DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]

      2018-10-09 09:28:22,457 INFO  [stdout] (default task-2) DEBUG SMTP: need username and password for authentication

      2018-10-09 09:28:22,457 INFO  [stdout] (default task-2) DEBUG SMTP: need username and password for authentication

       

      Any help?

       

      Kind Regards.

       

      daniele

        • 1. Re: WildFly 10.1.0 DEBUG SMTP: need username and password for authentication
          dgrandi

          Hi All again,

           

          after some investigation I think I could resolve the issue by defining the Java Mail properties such as:

           

          mail.smtp.host

          mail.smtp.port

          mail.smtp.user

          mail.smtp.password

          mail.smtp.from

          mail.from

          mail.smtp.auth

          mail.transport.protocol

           

          How can I configure these properties on WildFly 10.1.0?

           

          Kind Regards.

           

          daniele

          • 2. Re: WildFly 10.1.0 DEBUG SMTP: need username and password for authentication
            dgrandi

            I solved configuring the Java Mail properties as follows:

             

            <mail-session name="MailSession" debug="true" jndi-name="java:/mail/MailSession" from="hytgold@domain.it">

            <custom-server name="smtp" outbound-socket-binding-ref="anthema-smtp" tls="true" username="hytgold@domain.it" password="mypassword">

            <property name="mail.smtp.ssl.trust" value="mail.domain.it" />

            <property name="mail.smtp.host" value="mail.domain.it" />

            <property name="mail.smtp.port" value="25" />

            <property name="mail.smtp.user" value="hytgold@domain.it" />

            <property name="mail.smtp.password" value="mypassword" />

            <property name="mail.transport.protocol" value="smtp" />

            <property name="mail.smtp.auth" value="true" />

            <property name="mail.smtp.from" value="hytgold@domain.it" />

            <property name="mail.from" value="hytgold@domain.it" />

            </custom-server>

            </mail-session>

             

            Kind Regards.

             

            daniele