IDEMPIERE-388 Enable port and TLS configuration for email

This commit is contained in:
Carlos Ruiz 2012-10-09 01:30:05 -05:00
parent 6379097ac1
commit 83a7f121c3
7 changed files with 288 additions and 24 deletions

View File

@ -0,0 +1,66 @@
-- IDEMPIERE-388 Enable port and TLS configuration for email
-- Oct 3, 2012 10:55:41 AM COT
INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('SMTPPort',200170,'D','SMTP Port','SMTP Port Number','SMTP Port','20c841ef-0f1c-4482-87a7-0e882ae1e0de',0,TO_DATE('2012-10-03 10:55:39','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-10-03 10:55:39','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y')
;
-- Oct 3, 2012 10:55:41 AM COT
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200170 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- Oct 3, 2012 10:58:59 AM COT
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,112,200580,'D','N','N','N',0,'N',10,'N',11,'N','N',200170,'N','Y','e463ed28-f6d5-4150-b7bd-49cdc6e7e03b','N','Y','N','SMTPPort','SMTP Port Number','SMTP Port','Y',0,TO_DATE('2012-10-03 10:58:58','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-10-03 10:58:58','YYYY-MM-DD HH24:MI:SS'),0,0,0)
;
-- Oct 3, 2012 10:58:59 AM COT
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200580 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Oct 3, 2012 11:00:50 AM COT
INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsSecureSMTP',200171,'D','SMTP SSL/TLS','Use SSL/TLS for SMTP','SMTP SSL/TLS','08c7ca81-950d-4f5f-b0fd-99da440cd1e2',0,TO_DATE('2012-10-03 11:00:49','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2012-10-03 11:00:49','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y')
;
-- Oct 3, 2012 11:00:50 AM COT
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200171 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- Oct 3, 2012 11:02:40 AM COT
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,112,200581,'D','N','N','N',0,'N',1,'N',20,'N','N',200171,'N','Y','1bf7924e-8543-481d-972d-32ac400ce786','N','Y','N','IsSecureSMTP','Use SSL/TLS for SMTP','N','SMTP SSL/TLS','Y',0,TO_DATE('2012-10-03 11:02:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_DATE('2012-10-03 11:02:39','YYYY-MM-DD HH24:MI:SS'),0,0,0)
;
-- Oct 3, 2012 11:02:40 AM COT
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200581 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Oct 3, 2012 11:24:52 AM COT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,AD_FieldGroup_ID,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (0,'N',145,0,'N','N',200580,113,'Y',200594,'N',119,'D','SMTP Port Number','SMTP Port','Y','N','e54979c8-39fc-4ac5-8fd0-5232834a070c',0,0,TO_DATE('2012-10-03 11:24:52','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-10-03 11:24:52','YYYY-MM-DD HH24:MI:SS'),'Y','Y',113,1,1,1)
;
-- Oct 3, 2012 11:24:52 AM COT
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200594 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Oct 3, 2012 11:27:59 AM COT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,AD_FieldGroup_ID,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (0,'N',145,0,'Y','N',200581,115,'Y',200595,'N',119,'D','Use SSL/TLS for SMTP','SMTP SSL/TLS','Y','N','dbef5a74-3dfa-4246-8b76-04b924ec869c',0,0,TO_DATE('2012-10-03 11:27:58','YYYY-MM-DD HH24:MI:SS'),0,0,TO_DATE('2012-10-03 11:27:58','YYYY-MM-DD HH24:MI:SS'),'Y','Y',115,5,2,1)
;
-- Oct 3, 2012 11:27:59 AM COT
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200595 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Oct 8, 2012 10:15:49 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-10-08 22:15:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200581
;
-- Oct 8, 2012 10:15:51 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
ALTER TABLE AD_Client ADD IsSecureSMTP CHAR(1) DEFAULT 'N' CHECK (IsSecureSMTP IN ('Y','N')) NOT NULL
;
-- Oct 8, 2012 10:16:24 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
ALTER TABLE AD_Client ADD SMTPPort NUMBER(10) DEFAULT NULL
;
SELECT register_migration_script('927_IDEMPIERE-388.sql') FROM dual
;

View File

@ -0,0 +1,66 @@
-- IDEMPIERE-388 Enable port and TLS configuration for email
-- Oct 3, 2012 10:55:41 AM COT
INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('SMTPPort',200170,'D','SMTP Port','SMTP Port Number','SMTP Port','20c841ef-0f1c-4482-87a7-0e882ae1e0de',0,TO_TIMESTAMP('2012-10-03 10:55:39','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-10-03 10:55:39','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y')
;
-- Oct 3, 2012 10:55:41 AM COT
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200170 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- Oct 3, 2012 10:58:59 AM COT
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,112,200580,'D','N','N','N',0,'N',10,'N',11,'N','N',200170,'N','Y','e463ed28-f6d5-4150-b7bd-49cdc6e7e03b','N','Y','N','SMTPPort','SMTP Port Number','SMTP Port','Y',0,TO_TIMESTAMP('2012-10-03 10:58:58','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-10-03 10:58:58','YYYY-MM-DD HH24:MI:SS'),0,0,0)
;
-- Oct 3, 2012 10:58:59 AM COT
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200580 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Oct 3, 2012 11:00:50 AM COT
INSERT INTO AD_Element (ColumnName,AD_Element_ID,EntityType,Name,Description,PrintName,AD_Element_UU,AD_Client_ID,Created,Updated,AD_Org_ID,CreatedBy,UpdatedBy,IsActive) VALUES ('IsSecureSMTP',200171,'D','SMTP SSL/TLS','Use SSL/TLS for SMTP','SMTP SSL/TLS','08c7ca81-950d-4f5f-b0fd-99da440cd1e2',0,TO_TIMESTAMP('2012-10-03 11:00:49','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2012-10-03 11:00:49','YYYY-MM-DD HH24:MI:SS'),0,0,0,'Y')
;
-- Oct 3, 2012 11:00:50 AM COT
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Help,PO_Description,PO_Help,Name,Description,PrintName,PO_Name,PO_PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Element_Trl_UU ) SELECT l.AD_Language,t.AD_Element_ID, t.Help,t.PO_Description,t.PO_Help,t.Name,t.Description,t.PrintName,t.PO_Name,t.PO_PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=200171 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- Oct 3, 2012 11:02:40 AM COT
INSERT INTO AD_Column (Version,AD_Table_ID,AD_Column_ID,EntityType,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsSyncDatabase,IsKey,AD_Element_ID,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsEncrypted,IsUpdateable,IsAlwaysUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,CreatedBy,Updated,AD_Org_ID,IsActive,Created,UpdatedBy,AD_Client_ID,SeqNoSelection) VALUES (0,112,200581,'D','N','N','N',0,'N',1,'N',20,'N','N',200171,'N','Y','1bf7924e-8543-481d-972d-32ac400ce786','N','Y','N','IsSecureSMTP','Use SSL/TLS for SMTP','N','SMTP SSL/TLS','Y',0,TO_TIMESTAMP('2012-10-03 11:02:39','YYYY-MM-DD HH24:MI:SS'),0,'Y',TO_TIMESTAMP('2012-10-03 11:02:39','YYYY-MM-DD HH24:MI:SS'),0,0,0)
;
-- Oct 3, 2012 11:02:40 AM COT
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=200581 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- Oct 3, 2012 11:24:52 AM COT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,AD_FieldGroup_ID,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (0,'N',145,0,'N','N',200580,113,'Y',200594,'N',119,'D','SMTP Port Number','SMTP Port','Y','N','e54979c8-39fc-4ac5-8fd0-5232834a070c',0,0,TO_TIMESTAMP('2012-10-03 11:24:52','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-10-03 11:24:52','YYYY-MM-DD HH24:MI:SS'),'Y','Y',113,1,1,1)
;
-- Oct 3, 2012 11:24:52 AM COT
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200594 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Oct 3, 2012 11:27:59 AM COT
INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,AD_FieldGroup_ID,EntityType,Description,Name,IsDisplayed,IsFieldOnly,AD_Field_UU,UpdatedBy,AD_Org_ID,Created,AD_Client_ID,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan,NumLines) VALUES (0,'N',145,0,'Y','N',200581,115,'Y',200595,'N',119,'D','Use SSL/TLS for SMTP','SMTP SSL/TLS','Y','N','dbef5a74-3dfa-4246-8b76-04b924ec869c',0,0,TO_TIMESTAMP('2012-10-03 11:27:58','YYYY-MM-DD HH24:MI:SS'),0,0,TO_TIMESTAMP('2012-10-03 11:27:58','YYYY-MM-DD HH24:MI:SS'),'Y','Y',115,5,2,1)
;
-- Oct 3, 2012 11:27:59 AM COT
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=200595 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- Oct 8, 2012 10:15:49 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-10-08 22:15:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200581
;
-- Oct 8, 2012 10:15:51 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
ALTER TABLE AD_Client ADD COLUMN IsSecureSMTP CHAR(1) DEFAULT 'N' CHECK (IsSecureSMTP IN ('Y','N')) NOT NULL
;
-- Oct 8, 2012 10:16:24 PM COT
-- IDEMPIERE-388 Enable port and TLS configuration for email
ALTER TABLE AD_Client ADD COLUMN SMTPPort NUMERIC(10) DEFAULT NULL
;
SELECT register_migration_script('927_IDEMPIERE-388.sql') FROM dual
;

View File

@ -87,10 +87,10 @@ public interface I_AD_Client
/** Column name AD_PasswordRule_ID */
public static final String COLUMNNAME_AD_PasswordRule_ID = "AD_PasswordRule_ID";
/** Set AD_PasswordRule */
/** Set Password Policies */
public void setAD_PasswordRule_ID (int AD_PasswordRule_ID);
/** Get AD_PasswordRule */
/** Get Password Policies */
public int getAD_PasswordRule_ID();
public org.compiere.model.I_AD_PasswordRule getAD_PasswordRule() throws RuntimeException;
@ -217,6 +217,19 @@ public interface I_AD_Client
*/
public boolean isPostImmediate();
/** Column name IsSecureSMTP */
public static final String COLUMNNAME_IsSecureSMTP = "IsSecureSMTP";
/** Set SMTP SSL/TLS.
* Use SSL/TLS for SMTP
*/
public void setIsSecureSMTP (boolean IsSecureSMTP);
/** Get SMTP SSL/TLS.
* Use SSL/TLS for SMTP
*/
public boolean isSecureSMTP();
/** Column name IsServerEMail */
public static final String COLUMNNAME_IsServerEMail = "IsServerEMail";
@ -373,6 +386,19 @@ public interface I_AD_Client
*/
public String getSMTPHost();
/** Column name SMTPPort */
public static final String COLUMNNAME_SMTPPort = "SMTPPort";
/** Set SMTP Port.
* SMTP Port Number
*/
public void setSMTPPort (int SMTPPort);
/** Get SMTP Port.
* SMTP Port Number
*/
public int getSMTPPort();
/** Column name StoreArchiveOnFileSystem */
public static final String COLUMNNAME_StoreArchiveOnFileSystem = "StoreArchiveOnFileSystem";

View File

@ -56,7 +56,7 @@ public class MClient extends X_AD_Client
/**
*
*/
private static final long serialVersionUID = -6482473737885701403L;
private static final long serialVersionUID = 5428247545086634858L;
/**
@ -979,4 +979,17 @@ public class MClient extends X_AD_Client
return (Collections.binarySearch(m_fieldAccess, aDFieldID) > 0);
}
@Override
protected boolean beforeSave(boolean newRecord)
{
//gmail specific support
if ("smtp.gmail.com".equals(getSMTPHost()))
{
if (getSMTPPort() == 0)
setSMTPPort(587);
}
return true;
}
} // MClient

View File

@ -30,7 +30,7 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20120802L;
private static final long serialVersionUID = 20121008L;
/** Standard Constructor */
public X_AD_Client (Properties ctx, int AD_Client_ID, String trxName)
@ -42,6 +42,8 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
// N
setIsMultiLingualDocument (false);
setIsPostImmediate (false);
// N
setIsSecureSMTP (false);
// N
setIsServerEMail (false);
setIsSmtpAuthorization (false);
@ -126,8 +128,8 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
return (org.compiere.model.I_AD_PasswordRule)MTable.get(getCtx(), org.compiere.model.I_AD_PasswordRule.Table_Name)
.getPO(getAD_PasswordRule_ID(), get_TrxName()); }
/** Set AD_PasswordRule.
@param AD_PasswordRule_ID AD_PasswordRule */
/** Set Password Policies.
@param AD_PasswordRule_ID Password Policies */
public void setAD_PasswordRule_ID (int AD_PasswordRule_ID)
{
if (AD_PasswordRule_ID < 1)
@ -136,8 +138,8 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
set_Value (COLUMNNAME_AD_PasswordRule_ID, Integer.valueOf(AD_PasswordRule_ID));
}
/** Get AD_PasswordRule.
@return AD_PasswordRule */
/** Get Password Policies.
@return Password Policies */
public int getAD_PasswordRule_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_PasswordRule_ID);
@ -301,6 +303,30 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
return false;
}
/** Set SMTP SSL/TLS.
@param IsSecureSMTP
Use SSL/TLS for SMTP
*/
public void setIsSecureSMTP (boolean IsSecureSMTP)
{
set_Value (COLUMNNAME_IsSecureSMTP, Boolean.valueOf(IsSecureSMTP));
}
/** Get SMTP SSL/TLS.
@return Use SSL/TLS for SMTP
*/
public boolean isSecureSMTP ()
{
Object oo = get_Value(COLUMNNAME_IsSecureSMTP);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Server EMail.
@param IsServerEMail
Send EMail from Server
@ -545,6 +571,26 @@ public class X_AD_Client extends PO implements I_AD_Client, I_Persistent
return (String)get_Value(COLUMNNAME_SMTPHost);
}
/** Set SMTP Port.
@param SMTPPort
SMTP Port Number
*/
public void setSMTPPort (int SMTPPort)
{
set_Value (COLUMNNAME_SMTPPort, Integer.valueOf(SMTPPort));
}
/** Get SMTP Port.
@return SMTP Port Number
*/
public int getSMTPPort ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SMTPPort);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Store Archive On File System.
@param StoreArchiveOnFileSystem Store Archive On File System */
public void setStoreArchiveOnFileSystem (boolean StoreArchiveOnFileSystem)

View File

@ -85,7 +85,7 @@ public final class EMail implements Serializable
public EMail (MClient client, String from, String to,
String subject, String message)
{
this (client.getCtx(), client.getSMTPHost(), from, to, subject, message);
this (client.getCtx(), client.getSMTPHost(), client.getSMTPPort(), client.isSecureSMTP(), from, to, subject, message, false);
} // EMail
/**
@ -100,7 +100,7 @@ public final class EMail implements Serializable
public EMail (MClient client, String from, String to,
String subject, String message, boolean html)
{
this (client.getCtx(), client.getSMTPHost(), from, to, subject, message, html);
this (client.getCtx(), client.getSMTPHost(), client.getSMTPPort(), client.isSecureSMTP(), from, to, subject, message, html);
} // EMail
/**
@ -115,7 +115,7 @@ public final class EMail implements Serializable
public EMail (Properties ctx, String smtpHost, String from, String to,
String subject, String message)
{
this(ctx, smtpHost, from, to, subject, message, false);
this(ctx, smtpHost, 0, false, from, to, subject, message, false);
}
/**
@ -131,6 +131,26 @@ public final class EMail implements Serializable
public EMail (Properties ctx, String smtpHost, String from, String to,
String subject, String message, boolean html)
{
this(ctx, smtpHost, 0, false, from, to, subject, message, html);
}
/**
* Full Constructor
* @param ctx context
* @param smtpHost The mail server
* @param smtpPort
* @param isSecureSmtp
* @param from Sender's EMail address
* @param to Recipient EMail address
* @param subject Subject of message
* @param message The message
* @param html html email
*/
public EMail (Properties ctx, String smtpHost, int smtpPort, boolean isSecureSmtp, String from, String to,
String subject, String message, boolean html)
{
setSmtpHost(smtpHost);
setFrom(from);
String bccAddressForAllMails = MSysConfig.getValue(MSysConfig.MAIL_SEND_BCC_TO_ADDRESS, Env.getAD_Client_ID(Env.getCtx()));
@ -150,7 +170,17 @@ public final class EMail implements Serializable
setMessageText (message);
}
m_valid = isValid (true);
setSmtpPort(smtpPort);
setSecureSmtp(isSecureSmtp);
} // EMail
private void setSecureSmtp(boolean isSecureSmtp) {
m_secureSmtp = isSecureSmtp;
}
private void setSmtpPort(int smtpPort) {
m_smtpPort = smtpPort;
}
/** From Address */
private InternetAddress m_from;
@ -170,14 +200,14 @@ public final class EMail implements Serializable
private String m_messageHTML;
/** Mail SMTP Server */
private String m_smtpHost;
/** Mail SMTP Server Port */
// @TODO - make port configurable - private int m_smtpPort = 0;
/** SMTP enable start TLS */
// @TODO - make tls configurable - private boolean m_smtpStarttlsEnable = false;
private int m_smtpPort;
private boolean m_secureSmtp;
/** Attachments */
private ArrayList<DataSource> m_attachments;
/** UserName and Password */
private EMailAuthenticator m_auth = null;
private transient EMailAuthenticator m_auth = null;
/** Message */
private SMTPMessage m_msg = null;
/** Context - may be null */
@ -192,7 +222,7 @@ public final class EMail implements Serializable
public static final String SENT_OK = "OK";
/** Logger */
protected static CLogger log = CLogger.getCLogger (EMail.class);
protected transient static CLogger log = CLogger.getCLogger (EMail.class);
/**
* Send Mail direct
@ -201,6 +231,8 @@ public final class EMail implements Serializable
public String send ()
{
log.info("(" + m_smtpHost + ") " + m_from + " -> " + m_to);
log.info("(m_auth) " + m_auth);
m_sentMsg = null;
//
if (!isValid(true))
@ -224,10 +256,12 @@ public final class EMail implements Serializable
{
if (m_auth != null) // createAuthenticator was called
props.put("mail.smtp.auth", "true");
if (m_smtpHost.equalsIgnoreCase("smtp.gmail.com")) {
// TODO: make it configurable
// Enable gmail port and ttls - Hardcoded
props.put("mail.smtp.port", "587");
if (m_smtpPort > 0)
{
props.put("mail.smtp.port", String.valueOf(m_smtpPort));
}
if (m_secureSmtp)
{
props.put("mail.smtp.starttls.enable", "true");
}
@ -247,6 +281,7 @@ public final class EMail implements Serializable
return e.toString();
}
Transport t = null;
try
{
// m_msg = new MimeMessage(session);
@ -283,7 +318,7 @@ public final class EMail implements Serializable
// log.fine("message =" + m_msg);
//
// Transport.send(msg);
Transport t = session.getTransport("smtp");
t = session.getTransport("smtp");
// log.fine("transport=" + t);
t.connect();
// t.connect(m_smtpHost, user, password);
@ -380,6 +415,17 @@ public final class EMail implements Serializable
m_sentMsg = e.getLocalizedMessage();
return e.getLocalizedMessage();
}
finally
{
if(t != null)
{
try {
t.close();
} catch (Exception e) {
}
t = null;
}
}
//
if (CLogMgt.isLevelFinest())
dumpMessage();

View File

@ -23,6 +23,7 @@ import org.compiere.util.EMail;
import org.compiere.util.Env;
import org.restlet.representation.Representation;
import org.restlet.representation.StringRepresentation;
import org.restlet.resource.Post;
import org.restlet.resource.ResourceException;
import org.restlet.resource.ServerResource;
@ -31,8 +32,8 @@ import org.restlet.resource.ServerResource;
* @author hengsin
*/
public class SendEmailCommand extends ServerResource {
@Override
protected Representation post(Representation entity)
@Post
public Representation sendEmail(Representation entity)
throws ResourceException {
try {
HashMap<String, Serializable> map = RestletUtil.toObject(entity);