Uploaded image for project: 'JBoss Portal'
  1. JBoss Portal
  2. JBPORTAL-2353

property to connect a TLS mail server

    XMLWordPrintable

    Details

    • Type: Patch
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.7.2 Final
    • Fix Version/s: 2.8 Final
    • Component/s: None
    • Labels:
      None
    • Environment:

      JBoss Portal 2.7.2, gmail server

      Description

      I try to connect to smtp.gmail.com through mail service of JBoss Portal declared into META-INF/jboss-service.xml :

      <mbean code="org.jboss.portal.core.impl.mail.MailModuleImpl" name="portal:service=Module,type=Mail" xmbean-dd=""
      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
      <xmbean/>
      <depends>jboss:service=Mail</depends>
      <depends>portal:service=Module,type=IdentityServiceController</depends>
      <attribute name="QueueCapacity">-1</attribute>
      <attribute name="Gateway">localhost</attribute>
      <attribute name="SmtpUser"></attribute>
      <attribute name="SmtpPassword"></attribute>
      <attribute name="JavaMailDebugEnabled">false</attribute>
      <attribute name="SMTPConnectionTimeout">100000</attribute>
      <attribute name="SMTPTimeout">10000</attribute>
      <attribute name="JNDIName">java:portal/MailModule</attribute>
      </mbean>

      I need to configure a javamail property called mail.smtp.starttls.enable

      This property, if true, lets to connect to a TLS mail server as google mail server

      In org.jboss.portal.core.impl.mail.MailModuleImpl class we can to add that property so:

      /** SMTP Start TLS enable. */
      private boolean SMTPStarttlsEnable = false;

      public boolean getSMTPStarttlsEnable()

      { return SMTPStarttlsEnable; }

      public void setSMTPStarttlsEnable(boolean SMTPStarttlsEnable)

      { this.SMTPStarttlsEnable = SMTPStarttlsEnable; }

      and into startService() method we can to add this:

      properties.setProperty("mail.smtp.starttls.enable", "" + SMTPStarttlsEnable);

      in jboss-service.xml we can to add the property to false as default:

      <mbean code="org.jboss.portal.core.impl.mail.MailModuleImpl" name="portal:service=Module,type=Mail" xmbean-dd=""
      xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
      <xmbean/>
      <depends>jboss:service=Mail</depends>
      <depends>portal:service=Module,type=IdentityServiceController</depends>
      <attribute name="QueueCapacity">-1</attribute>
      <attribute name="Gateway">localhost</attribute>
      <attribute name="SmtpUser"></attribute>
      <attribute name="SmtpPassword"></attribute>
      <attribute name="JavaMailDebugEnabled">false</attribute>
      <attribute name="SMTPConnectionTimeout">100000</attribute>
      <attribute name="SMTPTimeout">10000</attribute>
      <attribute name="JNDIName">java:portal/MailModule</attribute>

      ---------- new ---------

      <attribute name="SMTPStarttlsEnable">false</attribute>

      ---------------------------
      </mbean>

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                sviluppatorefico Luca Stancapiano
                Reporter:
                sviluppatorefico Luca Stancapiano
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: