Fixed issue 19406: Added 'connection security' and 'port' to 'Email Configuration' tab
authorDavid Baz Fayos <david.baz@openbravo.com>
Tue, 10 Jan 2012 12:44:31 +0100
changeset 15086 4eb3ae89cc0a
parent 15085 8df306c69e74
child 15087 33855ed49422
Fixed issue 19406: Added 'connection security' and 'port' to 'Email Configuration' tab
src-db/database/model/tables/C_POC_CONFIGURATION.xml
src-db/database/sourcedata/AD_CALLOUT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_REF_LIST.xml
src/org/openbravo/erpCommon/ad_callouts/EmailConfiguration_Port.java
src/org/openbravo/erpCommon/businessUtility/EMail.java
src/org/openbravo/erpCommon/utility/poc/EmailManager.java
src/org/openbravo/erpCommon/utility/poc/Poc_Configuration_data.xsql
--- a/src-db/database/model/tables/C_POC_CONFIGURATION.xml	Tue Jan 10 12:17:03 2012 +0100
+++ b/src-db/database/model/tables/C_POC_CONFIGURATION.xml	Tue Jan 10 12:44:31 2012 +0100
@@ -53,6 +53,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="SMTPCONNECTIONSECURITY" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault><![CDATA['N']]></onCreateDefault>
+      </column>
+      <column name="SMTPPORT" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false">
+        <default><![CDATA[25]]></default>
+        <onCreateDefault><![CDATA[25]]></onCreateDefault>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="C_POC_CONFIGURATION_AD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_CALLOUT.xml	Tue Jan 10 12:17:03 2012 +0100
+++ b/src-db/database/sourcedata/AD_CALLOUT.xml	Tue Jan 10 12:44:31 2012 +0100
@@ -771,6 +771,18 @@
 <!--3585710F23F244D9B179A28D18242583-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--3585710F23F244D9B179A28D18242583--></AD_CALLOUT>
 
+<!--3E7999A44EEA40FEBC71EACA93A51198--><AD_CALLOUT>
+<!--3E7999A44EEA40FEBC71EACA93A51198-->  <AD_CALLOUT_ID><![CDATA[3E7999A44EEA40FEBC71EACA93A51198]]></AD_CALLOUT_ID>
+<!--3E7999A44EEA40FEBC71EACA93A51198-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3E7999A44EEA40FEBC71EACA93A51198-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3E7999A44EEA40FEBC71EACA93A51198-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3E7999A44EEA40FEBC71EACA93A51198-->  <NAME><![CDATA[EmailConfiguration_Port]]></NAME>
+<!--3E7999A44EEA40FEBC71EACA93A51198-->  <DESCRIPTION><![CDATA[This callout is used in "Email Configuration" window.
+It updates the "Smtp Port" field based on the selected "Smtp Connection Security".
+It updates to the most typical port for the defined connection security, but this doesn't mean that this is the right port the 100% of the cases. It depends on your smtp server provider.]]></DESCRIPTION>
+<!--3E7999A44EEA40FEBC71EACA93A51198-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--3E7999A44EEA40FEBC71EACA93A51198--></AD_CALLOUT>
+
 <!--40289C202E28D30F012E290252730036--><AD_CALLOUT>
 <!--40289C202E28D30F012E290252730036-->  <AD_CALLOUT_ID><![CDATA[40289C202E28D30F012E290252730036]]></AD_CALLOUT_ID>
 <!--40289C202E28D30F012E290252730036-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Tue Jan 10 12:17:03 2012 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Tue Jan 10 12:44:31 2012 +0100
@@ -217259,6 +217259,40 @@
 <!--260DB5AFD2154D6DA6B72BFD78334DEF-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--260DB5AFD2154D6DA6B72BFD78334DEF--></AD_COLUMN>
 
+<!--2640D641B8B54440BDA5C814A854328D--><AD_COLUMN>
+<!--2640D641B8B54440BDA5C814A854328D-->  <AD_COLUMN_ID><![CDATA[2640D641B8B54440BDA5C814A854328D]]></AD_COLUMN_ID>
+<!--2640D641B8B54440BDA5C814A854328D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2640D641B8B54440BDA5C814A854328D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2640D641B8B54440BDA5C814A854328D-->  <NAME><![CDATA[Smtp Port]]></NAME>
+<!--2640D641B8B54440BDA5C814A854328D-->  <HELP><![CDATA[Port needed for the defined smtp server.]]></HELP>
+<!--2640D641B8B54440BDA5C814A854328D-->  <COLUMNNAME><![CDATA[Smtpport]]></COLUMNNAME>
+<!--2640D641B8B54440BDA5C814A854328D-->  <AD_TABLE_ID><![CDATA[1000500000]]></AD_TABLE_ID>
+<!--2640D641B8B54440BDA5C814A854328D-->  <AD_REFERENCE_ID><![CDATA[11]]></AD_REFERENCE_ID>
+<!--2640D641B8B54440BDA5C814A854328D-->  <FIELDLENGTH><![CDATA[10]]></FIELDLENGTH>
+<!--2640D641B8B54440BDA5C814A854328D-->  <DEFAULTVALUE><![CDATA[25]]></DEFAULTVALUE>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--2640D641B8B54440BDA5C814A854328D-->  <SEQNO><![CDATA[170]]></SEQNO>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--2640D641B8B54440BDA5C814A854328D-->  <AD_ELEMENT_ID><![CDATA[6EFA1847A60447DAA2D5BE1986BF63E6]]></AD_ELEMENT_ID>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--2640D641B8B54440BDA5C814A854328D-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--2640D641B8B54440BDA5C814A854328D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2640D641B8B54440BDA5C814A854328D-->  <POSITION><![CDATA[15]]></POSITION>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--2640D641B8B54440BDA5C814A854328D-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--2640D641B8B54440BDA5C814A854328D-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--2640D641B8B54440BDA5C814A854328D-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--2640D641B8B54440BDA5C814A854328D--></AD_COLUMN>
+
 <!--26B6C690FE9643EBB1F3E1D6FC9D9A3B--><AD_COLUMN>
 <!--26B6C690FE9643EBB1F3E1D6FC9D9A3B-->  <AD_COLUMN_ID><![CDATA[26B6C690FE9643EBB1F3E1D6FC9D9A3B]]></AD_COLUMN_ID>
 <!--26B6C690FE9643EBB1F3E1D6FC9D9A3B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -268635,6 +268669,41 @@
 <!--A58DFDE11BF342779F8FAF40B84E8899-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--A58DFDE11BF342779F8FAF40B84E8899--></AD_COLUMN>
 
+<!--A5BD63500881485AA62A731858B83227--><AD_COLUMN>
+<!--A5BD63500881485AA62A731858B83227-->  <AD_COLUMN_ID><![CDATA[A5BD63500881485AA62A731858B83227]]></AD_COLUMN_ID>
+<!--A5BD63500881485AA62A731858B83227-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A5BD63500881485AA62A731858B83227-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A5BD63500881485AA62A731858B83227-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A5BD63500881485AA62A731858B83227-->  <NAME><![CDATA[Smtp Connection Security]]></NAME>
+<!--A5BD63500881485AA62A731858B83227-->  <HELP><![CDATA[Connection security needed for the defined smtp server.]]></HELP>
+<!--A5BD63500881485AA62A731858B83227-->  <COLUMNNAME><![CDATA[Smtpconnectionsecurity]]></COLUMNNAME>
+<!--A5BD63500881485AA62A731858B83227-->  <AD_TABLE_ID><![CDATA[1000500000]]></AD_TABLE_ID>
+<!--A5BD63500881485AA62A731858B83227-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--A5BD63500881485AA62A731858B83227-->  <AD_REFERENCE_VALUE_ID><![CDATA[D6C4E62C3EB040989001DA16B3925DC8]]></AD_REFERENCE_VALUE_ID>
+<!--A5BD63500881485AA62A731858B83227-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--A5BD63500881485AA62A731858B83227-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--A5BD63500881485AA62A731858B83227-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--A5BD63500881485AA62A731858B83227-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--A5BD63500881485AA62A731858B83227-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--A5BD63500881485AA62A731858B83227-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--A5BD63500881485AA62A731858B83227-->  <SEQNO><![CDATA[160]]></SEQNO>
+<!--A5BD63500881485AA62A731858B83227-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--A5BD63500881485AA62A731858B83227-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--A5BD63500881485AA62A731858B83227-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--A5BD63500881485AA62A731858B83227-->  <AD_ELEMENT_ID><![CDATA[1A2B594FFFE54266B5E018F772D847D1]]></AD_ELEMENT_ID>
+<!--A5BD63500881485AA62A731858B83227-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--A5BD63500881485AA62A731858B83227-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--A5BD63500881485AA62A731858B83227-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--A5BD63500881485AA62A731858B83227-->  <AD_CALLOUT_ID><![CDATA[3E7999A44EEA40FEBC71EACA93A51198]]></AD_CALLOUT_ID>
+<!--A5BD63500881485AA62A731858B83227-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--A5BD63500881485AA62A731858B83227-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A5BD63500881485AA62A731858B83227-->  <POSITION><![CDATA[14]]></POSITION>
+<!--A5BD63500881485AA62A731858B83227-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--A5BD63500881485AA62A731858B83227-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--A5BD63500881485AA62A731858B83227-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--A5BD63500881485AA62A731858B83227-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--A5BD63500881485AA62A731858B83227--></AD_COLUMN>
+
 <!--A6150389291545AB958A51AAD04606CF--><AD_COLUMN>
 <!--A6150389291545AB958A51AAD04606CF-->  <AD_COLUMN_ID><![CDATA[A6150389291545AB958A51AAD04606CF]]></AD_COLUMN_ID>
 <!--A6150389291545AB958A51AAD04606CF-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Jan 10 12:17:03 2012 +0100
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Jan 10 12:44:31 2012 +0100
@@ -20905,6 +20905,19 @@
 <!--17ADA898A5534B858EC8BD7651492088-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--17ADA898A5534B858EC8BD7651492088--></AD_ELEMENT>
 
+<!--1A2B594FFFE54266B5E018F772D847D1--><AD_ELEMENT>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <AD_ELEMENT_ID><![CDATA[1A2B594FFFE54266B5E018F772D847D1]]></AD_ELEMENT_ID>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <COLUMNNAME><![CDATA[Smtpconnectionsecurity]]></COLUMNNAME>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <NAME><![CDATA[Smtp Connection Security]]></NAME>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <PRINTNAME><![CDATA[Smtp Connection Security]]></PRINTNAME>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <HELP><![CDATA[Connection security needed for the defined smtp server.]]></HELP>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1A2B594FFFE54266B5E018F772D847D1-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--1A2B594FFFE54266B5E018F772D847D1--></AD_ELEMENT>
+
 <!--1D5007B3718D4A808987DE155B83BDDE--><AD_ELEMENT>
 <!--1D5007B3718D4A808987DE155B83BDDE-->  <AD_ELEMENT_ID><![CDATA[1D5007B3718D4A808987DE155B83BDDE]]></AD_ELEMENT_ID>
 <!--1D5007B3718D4A808987DE155B83BDDE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -24324,6 +24337,19 @@
 <!--6DC905999D48BFC7E040007F01012E68-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--6DC905999D48BFC7E040007F01012E68--></AD_ELEMENT>
 
+<!--6EFA1847A60447DAA2D5BE1986BF63E6--><AD_ELEMENT>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <AD_ELEMENT_ID><![CDATA[6EFA1847A60447DAA2D5BE1986BF63E6]]></AD_ELEMENT_ID>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <COLUMNNAME><![CDATA[Smtpport]]></COLUMNNAME>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <NAME><![CDATA[Smtp Port]]></NAME>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <PRINTNAME><![CDATA[Smtp Port]]></PRINTNAME>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <HELP><![CDATA[Port needed for the defined smtp server.]]></HELP>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--6EFA1847A60447DAA2D5BE1986BF63E6--></AD_ELEMENT>
+
 <!--6F387D3737D53635E040007F01002312--><AD_ELEMENT>
 <!--6F387D3737D53635E040007F01002312-->  <AD_ELEMENT_ID><![CDATA[6F387D3737D53635E040007F01002312]]></AD_ELEMENT_ID>
 <!--6F387D3737D53635E040007F01002312-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Tue Jan 10 12:17:03 2012 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Tue Jan 10 12:44:31 2012 +0100
@@ -164709,6 +164709,33 @@
 <!--177734FF7C4F4691B2246F0E8E3AF25E-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--177734FF7C4F4691B2246F0E8E3AF25E--></AD_FIELD>
 
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1--><AD_FIELD>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <AD_FIELD_ID><![CDATA[177AA16B956D4FA9A5E70FA9DBF4FAA1]]></AD_FIELD_ID>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <NAME><![CDATA[Smtp Port]]></NAME>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <HELP><![CDATA[Port needed for the defined smtp server.]]></HELP>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <AD_TAB_ID><![CDATA[1000500000]]></AD_TAB_ID>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <AD_COLUMN_ID><![CDATA[2640D641B8B54440BDA5C814A854328D]]></AD_COLUMN_ID>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <AD_FIELDGROUP_ID><![CDATA[1000500000]]></AD_FIELDGROUP_ID>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <GRID_SEQNO><![CDATA[80]]></GRID_SEQNO>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--177AA16B956D4FA9A5E70FA9DBF4FAA1--></AD_FIELD>
+
 <!--17B7EA253B7747059120E09AB76DDAA6--><AD_FIELD>
 <!--17B7EA253B7747059120E09AB76DDAA6-->  <AD_FIELD_ID><![CDATA[17B7EA253B7747059120E09AB76DDAA6]]></AD_FIELD_ID>
 <!--17B7EA253B7747059120E09AB76DDAA6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -212964,6 +212991,33 @@
 <!--EC787F77B1254D9A871B60CF6F2A52DA-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--EC787F77B1254D9A871B60CF6F2A52DA--></AD_FIELD>
 
+<!--EC8BB2FC6EA6442B9D489E4C0671D428--><AD_FIELD>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <AD_FIELD_ID><![CDATA[EC8BB2FC6EA6442B9D489E4C0671D428]]></AD_FIELD_ID>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <NAME><![CDATA[Smtp Connection Security]]></NAME>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <HELP><![CDATA[Connection security needed for the defined smtp server.]]></HELP>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <AD_TAB_ID><![CDATA[1000500000]]></AD_TAB_ID>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <AD_COLUMN_ID><![CDATA[A5BD63500881485AA62A731858B83227]]></AD_COLUMN_ID>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <AD_FIELDGROUP_ID><![CDATA[1000500000]]></AD_FIELDGROUP_ID>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <GRID_SEQNO><![CDATA[70]]></GRID_SEQNO>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--EC8BB2FC6EA6442B9D489E4C0671D428--></AD_FIELD>
+
 <!--ECB95BA0DE8111DD80EA001B388C05F0--><AD_FIELD>
 <!--ECB95BA0DE8111DD80EA001B388C05F0-->  <AD_FIELD_ID><![CDATA[ECB95BA0DE8111DD80EA001B388C05F0]]></AD_FIELD_ID>
 <!--ECB95BA0DE8111DD80EA001B388C05F0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Tue Jan 10 12:17:03 2012 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Tue Jan 10 12:44:31 2012 +0100
@@ -3297,6 +3297,18 @@
 <!--40C9C50E51CF446C83AF1F4562D93FD3-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--40C9C50E51CF446C83AF1F4562D93FD3--></AD_MODEL_OBJECT>
 
+<!--432571B2025F45C69B715B5E249BCBE9--><AD_MODEL_OBJECT>
+<!--432571B2025F45C69B715B5E249BCBE9-->  <AD_MODEL_OBJECT_ID><![CDATA[432571B2025F45C69B715B5E249BCBE9]]></AD_MODEL_OBJECT_ID>
+<!--432571B2025F45C69B715B5E249BCBE9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--432571B2025F45C69B715B5E249BCBE9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--432571B2025F45C69B715B5E249BCBE9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--432571B2025F45C69B715B5E249BCBE9-->  <ACTION><![CDATA[C]]></ACTION>
+<!--432571B2025F45C69B715B5E249BCBE9-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.EmailConfiguration_Port]]></CLASSNAME>
+<!--432571B2025F45C69B715B5E249BCBE9-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--432571B2025F45C69B715B5E249BCBE9-->  <AD_CALLOUT_ID><![CDATA[3E7999A44EEA40FEBC71EACA93A51198]]></AD_CALLOUT_ID>
+<!--432571B2025F45C69B715B5E249BCBE9-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--432571B2025F45C69B715B5E249BCBE9--></AD_MODEL_OBJECT>
+
 <!--4446402A5950431C9F7FCB5F2080752B--><AD_MODEL_OBJECT>
 <!--4446402A5950431C9F7FCB5F2080752B-->  <AD_MODEL_OBJECT_ID><![CDATA[4446402A5950431C9F7FCB5F2080752B]]></AD_MODEL_OBJECT_ID>
 <!--4446402A5950431C9F7FCB5F2080752B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Tue Jan 10 12:17:03 2012 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Tue Jan 10 12:44:31 2012 +0100
@@ -4390,6 +4390,16 @@
 <!--ECCB0A9F3EFD43BCA656BB35CE87D649-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
 <!--ECCB0A9F3EFD43BCA656BB35CE87D649--></AD_MODEL_OBJECT_MAPPING>
 
+<!--F104B24C4DC24B1BA524622205B05D2C--><AD_MODEL_OBJECT_MAPPING>
+<!--F104B24C4DC24B1BA524622205B05D2C-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[F104B24C4DC24B1BA524622205B05D2C]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--F104B24C4DC24B1BA524622205B05D2C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F104B24C4DC24B1BA524622205B05D2C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F104B24C4DC24B1BA524622205B05D2C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F104B24C4DC24B1BA524622205B05D2C-->  <AD_MODEL_OBJECT_ID><![CDATA[432571B2025F45C69B715B5E249BCBE9]]></AD_MODEL_OBJECT_ID>
+<!--F104B24C4DC24B1BA524622205B05D2C-->  <MAPPINGNAME><![CDATA[/ad_callouts/EmailConfiguration_Port.html]]></MAPPINGNAME>
+<!--F104B24C4DC24B1BA524622205B05D2C-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--F104B24C4DC24B1BA524622205B05D2C--></AD_MODEL_OBJECT_MAPPING>
+
 <!--F171914D8B8A47D3A8492ABB85CE87D6--><AD_MODEL_OBJECT_MAPPING>
 <!--F171914D8B8A47D3A8492ABB85CE87D6-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[F171914D8B8A47D3A8492ABB85CE87D6]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--F171914D8B8A47D3A8492ABB85CE87D6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Jan 10 12:17:03 2012 +0100
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Jan 10 12:44:31 2012 +0100
@@ -4966,6 +4966,19 @@
 <!--D2D4CC1F12434BB69733166A9423F2C6-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--D2D4CC1F12434BB69733166A9423F2C6--></AD_REFERENCE>
 
+<!--D6C4E62C3EB040989001DA16B3925DC8--><AD_REFERENCE>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <AD_REFERENCE_ID><![CDATA[D6C4E62C3EB040989001DA16B3925DC8]]></AD_REFERENCE_ID>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <NAME><![CDATA[Smtp Connection Security]]></NAME>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <HELP><![CDATA[Different types of smtp connection security]]></HELP>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <PARENTREFERENCE_ID><![CDATA[17]]></PARENTREFERENCE_ID>
+<!--D6C4E62C3EB040989001DA16B3925DC8-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--D6C4E62C3EB040989001DA16B3925DC8--></AD_REFERENCE>
+
 <!--DE2C18CCE5D540519E606CBC1A4B336D--><AD_REFERENCE>
 <!--DE2C18CCE5D540519E606CBC1A4B336D-->  <AD_REFERENCE_ID><![CDATA[DE2C18CCE5D540519E606CBC1A4B336D]]></AD_REFERENCE_ID>
 <!--DE2C18CCE5D540519E606CBC1A4B336D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Jan 10 12:17:03 2012 +0100
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Jan 10 12:44:31 2012 +0100
@@ -8226,6 +8226,18 @@
 <!--25303AB7401D446EB58FD9189CD12AA5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--25303AB7401D446EB58FD9189CD12AA5--></AD_REF_LIST>
 
+<!--254CA5F3266C4FFAAD08122C7656EA79--><AD_REF_LIST>
+<!--254CA5F3266C4FFAAD08122C7656EA79-->  <AD_REF_LIST_ID><![CDATA[254CA5F3266C4FFAAD08122C7656EA79]]></AD_REF_LIST_ID>
+<!--254CA5F3266C4FFAAD08122C7656EA79-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--254CA5F3266C4FFAAD08122C7656EA79-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--254CA5F3266C4FFAAD08122C7656EA79-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--254CA5F3266C4FFAAD08122C7656EA79-->  <VALUE><![CDATA[SSL]]></VALUE>
+<!--254CA5F3266C4FFAAD08122C7656EA79-->  <NAME><![CDATA[SSL]]></NAME>
+<!--254CA5F3266C4FFAAD08122C7656EA79-->  <AD_REFERENCE_ID><![CDATA[D6C4E62C3EB040989001DA16B3925DC8]]></AD_REFERENCE_ID>
+<!--254CA5F3266C4FFAAD08122C7656EA79-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--254CA5F3266C4FFAAD08122C7656EA79-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--254CA5F3266C4FFAAD08122C7656EA79--></AD_REF_LIST>
+
 <!--25DA44AD295749AFBA1A53AFC4DF6B37--><AD_REF_LIST>
 <!--25DA44AD295749AFBA1A53AFC4DF6B37-->  <AD_REF_LIST_ID><![CDATA[25DA44AD295749AFBA1A53AFC4DF6B37]]></AD_REF_LIST_ID>
 <!--25DA44AD295749AFBA1A53AFC4DF6B37-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -8708,6 +8720,18 @@
 <!--5494A34DF7904A8D9AC135266E9DE2A9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5494A34DF7904A8D9AC135266E9DE2A9--></AD_REF_LIST>
 
+<!--54A513EBB37E4ABA8EAE6E9B826568AD--><AD_REF_LIST>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD-->  <AD_REF_LIST_ID><![CDATA[54A513EBB37E4ABA8EAE6E9B826568AD]]></AD_REF_LIST_ID>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD-->  <VALUE><![CDATA[N]]></VALUE>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD-->  <NAME><![CDATA[None]]></NAME>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD-->  <AD_REFERENCE_ID><![CDATA[D6C4E62C3EB040989001DA16B3925DC8]]></AD_REFERENCE_ID>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--54A513EBB37E4ABA8EAE6E9B826568AD--></AD_REF_LIST>
+
 <!--55F94DB55BD848B99ED7488B45098A48--><AD_REF_LIST>
 <!--55F94DB55BD848B99ED7488B45098A48-->  <AD_REF_LIST_ID><![CDATA[55F94DB55BD848B99ED7488B45098A48]]></AD_REF_LIST_ID>
 <!--55F94DB55BD848B99ED7488B45098A48-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -9159,6 +9183,18 @@
 <!--85EB37162F364360A537301472F0914E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--85EB37162F364360A537301472F0914E--></AD_REF_LIST>
 
+<!--8651A7AD601D42CDAC894806800F73AB--><AD_REF_LIST>
+<!--8651A7AD601D42CDAC894806800F73AB-->  <AD_REF_LIST_ID><![CDATA[8651A7AD601D42CDAC894806800F73AB]]></AD_REF_LIST_ID>
+<!--8651A7AD601D42CDAC894806800F73AB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8651A7AD601D42CDAC894806800F73AB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8651A7AD601D42CDAC894806800F73AB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8651A7AD601D42CDAC894806800F73AB-->  <VALUE><![CDATA[STARTTLS]]></VALUE>
+<!--8651A7AD601D42CDAC894806800F73AB-->  <NAME><![CDATA[STARTTLS]]></NAME>
+<!--8651A7AD601D42CDAC894806800F73AB-->  <AD_REFERENCE_ID><![CDATA[D6C4E62C3EB040989001DA16B3925DC8]]></AD_REFERENCE_ID>
+<!--8651A7AD601D42CDAC894806800F73AB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--8651A7AD601D42CDAC894806800F73AB-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--8651A7AD601D42CDAC894806800F73AB--></AD_REF_LIST>
+
 <!--866681D848B942EB814C0C70AF0BE2F6--><AD_REF_LIST>
 <!--866681D848B942EB814C0C70AF0BE2F6-->  <AD_REF_LIST_ID><![CDATA[866681D848B942EB814C0C70AF0BE2F6]]></AD_REF_LIST_ID>
 <!--866681D848B942EB814C0C70AF0BE2F6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_callouts/EmailConfiguration_Port.java	Tue Jan 10 12:44:31 2012 +0100
@@ -0,0 +1,48 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2012 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.erpCommon.ad_callouts;
+
+import javax.servlet.ServletException;
+
+import org.openbravo.base.secureApp.VariablesSecureApp;
+
+public class EmailConfiguration_Port extends SimpleCallout {
+
+  private static final long serialVersionUID = 1L;
+
+  @Override
+  protected void execute(CalloutInfo info) throws ServletException {
+    String strSmtpConnectionSecurity = info.getStringParameter("inpsmtpconnectionsecurity", null);
+
+    info.addResult("inpsmtpport", getSuggestedPort(info.vars, strSmtpConnectionSecurity));
+  }
+
+  private String getSuggestedPort(VariablesSecureApp vars, String strSmtpConnectionSecurity) {
+    String recommendedPort = "";
+    if (strSmtpConnectionSecurity.equals("N")) {
+      recommendedPort = "25";
+    } else if (strSmtpConnectionSecurity.equals("STARTTLS")) {
+      recommendedPort = "587";
+    } else if (strSmtpConnectionSecurity.equals("SSL")) {
+      recommendedPort = "465";
+    }
+    return recommendedPort;
+  }
+}
\ No newline at end of file
--- a/src/org/openbravo/erpCommon/businessUtility/EMail.java	Tue Jan 10 12:17:03 2012 +0100
+++ b/src/org/openbravo/erpCommon/businessUtility/EMail.java	Tue Jan 10 12:44:31 2012 +0100
@@ -11,7 +11,7 @@
  * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
  * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
  * Contributor(s): Openbravo SLU
- * Contributions are Copyright (C) 2001-2011 Openbravo S.L.U.
+ * Contributions are Copyright (C) 2001-2012 Openbravo S.L.U.
  ******************************************************************************
  */
 package org.openbravo.erpCommon.businessUtility;
@@ -132,7 +132,10 @@
       props.put("mail.smtp.auth", "true");
 
     Session session = Session.getInstance(props, g_auth);
-    session.setDebug(true);
+
+    if (log4j.isDebugEnabled()) {
+      session.setDebug(true);
+    }
 
     try {
       g_smtpMsg = new SMTPMessage(session);
--- a/src/org/openbravo/erpCommon/utility/poc/EmailManager.java	Tue Jan 10 12:17:03 2012 +0100
+++ b/src/org/openbravo/erpCommon/utility/poc/EmailManager.java	Tue Jan 10 12:44:31 2012 +0100
@@ -9,7 +9,7 @@
  * either express or implied. See the License for the specific language
  * governing rights and limitations under the License. The Original Code is
  * Openbravo ERP. The Initial Developer of the Original Code is Openbravo SLU All
- * portions are Copyright (C) 2001-2010 Openbravo SLU All Rights Reserved.
+ * portions are Copyright (C) 2001-2012 Openbravo SLU All Rights Reserved.
  * Contributor(s): ______________________________________.
  * ***********************************************************************
  */
@@ -54,24 +54,36 @@
     PocConfigurationData configuration = null;
     if (configurations.length > 0) {
       configuration = configurations[0];
-      if (log4j.isDebugEnabled())
+      if (log4j.isDebugEnabled()) {
         log4j.debug("Crm configuration, smtp server: " + configuration.smtpserver);
-      if (log4j.isDebugEnabled())
         log4j.debug("Crm configuration, smtp server auth: " + configuration.issmtpauthorization);
-      if (log4j.isDebugEnabled())
         log4j.debug("Crm configuration, smtp server account: " + configuration.smtpserveraccount);
-      if (log4j.isDebugEnabled())
         log4j.debug("Crm configuration, smtp server password: " + configuration.smtpserverpassword);
+        log4j.debug("Crm configuration, smtp server connection security: "
+            + configuration.smtpconnectionsecurity);
+        log4j.debug("Crm configuration, smtp server port: " + configuration.smtpport);
+      }
     } else {
       throw new ServletException("No Poc configuration found for this client.");
     }
 
     Properties props = new Properties();
-    props.put("mail.debug", "true");
+
+    if (log4j.isDebugEnabled()) {
+      props.put("mail.debug", "true");
+    }
+    props.put("mail.transport.protocol", "smtp");
+    props.put("mail.host", configuration.smtpserver);
     props.put("mail.smtp.auth", (configuration.issmtpauthorization.equals("Y") ? "true" : "false"));
-    props.put("mail.transport.protocol", "smtp");
     props.put("mail.smtp.mail.sender", "email_admin@openbravo.com");
-    props.put("mail.host", configuration.smtpserver);
+    props.put("mail.smtp.port", configuration.smtpport);
+    if (configuration.smtpconnectionsecurity.equals("STARTTLS")) {
+      props.put("mail.smtp.starttls.enable", "true");
+    } else if (configuration.smtpconnectionsecurity.equals("SSL")) {
+      props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
+      props.put("mail.smtp.socketFactory.fallback", "false");
+      props.put("mail.smtp.socketFactory.port", configuration.smtpport);
+    }
 
     ClientAuthenticator authenticator = null;
     if (configuration.smtpserveraccount != null) {
--- a/src/org/openbravo/erpCommon/utility/poc/Poc_Configuration_data.xsql	Tue Jan 10 12:17:03 2012 +0100
+++ b/src/org/openbravo/erpCommon/utility/poc/Poc_Configuration_data.xsql	Tue Jan 10 12:44:31 2012 +0100
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -35,7 +35,9 @@
 			'' as smtpServerAccount,
 			'' as smtpServerPassword,
 			'' as isSmtpAuthorization,
-			'' as smtpServerSenderAddress
+			'' as smtpServerSenderAddress,
+			'' as smtpConnectionSecurity,
+			'' as smtpPort
 		from
 			dual
         ]]>
@@ -51,7 +53,9 @@
 			C_poc_configuration.smtpServerAccount,
 			C_poc_configuration.smtpServerPassword,
             C_poc_configuration.isSmtpAuthorization,
-            C_poc_configuration.smtpServerSenderAddress
+            C_poc_configuration.smtpServerSenderAddress,
+            C_poc_configuration.smtpConnectionSecurity,
+            C_poc_configuration.smtpPort
 		from
 			C_poc_configuration
 		where