property to connect a TLS mail server
-------------------------------------
Key: JBPORTAL-2353
URL:
https://jira.jboss.org/jira/browse/JBPORTAL-2353
Project: JBoss Portal
Issue Type: Patch
Security Level: Public (Everyone can see)
Affects Versions: 2.7.2 Final
Environment: JBoss Portal 2.7.2, gmail server
Reporter: Luca Stancapiano
Fix For: 2.8 Final
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>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira