public class DBEmailAccount extends DBObject
If SMTP server details are not supplied such as the URL, user name and password then the default SMTP server will be used for sending all emails from this account.
This is setup by the administrator through the settings in the database tab or can be passed to the application when it is started through the system properties mail.stmp.host, mail.smtp.user and mail.smtp.password.
Email Synchronization
Email Synchronization is a process which allows the system to load emails from your mail server in the same way as other mail clients such as Microsoft Outlook. The purpose of the sync is not to provide a fully fledge email application, but to allow emails that are related to correspondence with clients to be recorded against those clients.
How Synchronization works
Once the email accounts have been set within the system, these accounts are periodically scanned for new emails. The scanning interval is set by default to 10 minutes but can be modified by changing the repeat_every setting in the startup.xml file if it is run as a startup task, or if run through stEmailScan.properties file.
Each folder within the email account is scanned and is updated with the last scanned time when it is complete.
When each email is read, the system tries to locate a contact for each email address by comparing it against the contacts email addresses.
Once contacts have been found for the email address the filtering is checked for the email account to determine if this email should be loaded into the system.
Special consideration for 'Sent Items'
To allow ST to load emails sent from other mail clients, some additional setup is required. IMAP servers allow storing of sent items within a seperate folder on the server, however if your server is a POP3 server then emails sent from your email client will only be stored within that client and not on the server.
To resolve this issue, you can always include your self as a recipient or setup a 'rule' within your client to automatically do this. Another option is have a seperate email account and to include this email address as a recipient or setup a 'rule' within your client to automatically do this. Please refer to the documentation of your mail client on how to setup 'rules'.
'Delete from server' option
Most email clients, have an option to 'Delete from server' so that the email is removed once it is read. This is often the default option. To allow the system to have access to these emails, this needs to be turned off so the email is not deleted once your client has read it. To stop the folder filling up with emails, most mail clients have options so that emails can be deleted when it is deleted from the mail client.
Another option is to set up an additional account that all emails are copied to, as explained in the section Special consideration for 'Sent Items'.
DBObject.DenormalizeAction
Modifier and Type | Field and Description |
---|---|
static GlobalId |
DBCLASS_GID
Specifies an Email account that emails will be sent from or received to.
|
static java.lang.String |
DBCLASS_NAME
Specifies an Email account that emails will be sent from or received to.
|
ATTRIBUTE_MARVIN, dbClass, ds, NO_LOOP_PARAMS
Constructor and Description |
---|
DBEmailAccount(DBClass def,
DataSource dataSource)
Std.
|
Modifier and Type | Method and Description |
---|---|
static DBEmailAccount |
create(MutableDataSource mds)
Make a new instance of this class.
|
java.lang.String |
displayName()
The human display name of this object.
|
protected void |
extAutoEnterCreate()
Additional functionality when an object is created.
|
protected void |
extFixUp()
The extended fix up routine for known problems.
|
protected void |
extPreValidate()
OVERRIDE To add functionality to before validation is called.
|
protected ValidationError |
extValidateField(DBField field,
ValidationList list)
Additional validation for a particular field.
|
static DBEmailAccount |
findKey(DataSource ds,
int key)
Find the target for this class by the primary key
|
DBEmailAccountSecurity |
findSecurity(java.lang.String... args)
Connection security.
|
DBEmailAccountSecurity |
findSmtpSecurtiy(java.lang.String... args)
SMTP connection type.
|
Store |
findStore() |
DBEmailAccountType |
findType(java.lang.String... args)
Must be pop3 or imap.
|
Person |
findUser(java.lang.String... args)
User.
|
java.lang.String |
getCss(java.lang.String... args) |
java.lang.String |
getEmail(java.lang.String... args) |
int |
getID(java.lang.String... args) |
java.lang.String |
getMailPassword(java.lang.String... args) |
java.lang.String |
getMailServerURL(java.lang.String... args) |
java.lang.String |
getMailUser(java.lang.String... args) |
java.lang.String |
getName(java.lang.String... args) |
DBEmailAccountSecurity |
getSecurity(java.lang.String... args) |
java.lang.String |
getSmtpPassword(java.lang.String... args) |
int |
getSmtpPort(java.lang.String... args) |
DBEmailAccountSecurity |
getSmtpSecurtiy(java.lang.String... args) |
java.lang.String |
getSmtpServer(java.lang.String... args) |
java.lang.String |
getSmtpUser(java.lang.String... args) |
DBEmailAccountType |
getType(java.lang.String... args) |
Person |
getUser(java.lang.String... args) |
boolean |
isDefaultFg(java.lang.String... args) |
static DBQuery<DBEmailAccount> |
makeQuery(DataSource ds)
Make a new QUERY for this class.
|
DBEmailAccount |
setCss(java.lang.String value,
java.lang.String... args) |
DBEmailAccount |
setDefaultFg(boolean value,
java.lang.String... args) |
DBEmailAccount |
setEmail(java.lang.String value,
java.lang.String... args) |
DBEmailAccount |
setID(int value,
java.lang.String... args) |
DBEmailAccount |
setMailPassword(java.lang.String value,
java.lang.String... args) |
DBEmailAccount |
setMailServerURL(java.lang.String value,
java.lang.String... args) |
DBEmailAccount |
setMailUser(java.lang.String value,
java.lang.String... args) |
DBEmailAccount |
setName(java.lang.String value,
java.lang.String... args) |
DBEmailAccount |
setSecurity(com.aspc.dal.dbobj.email.DBEmailAccountSecurity value,
java.lang.String... args) |
DBEmailAccount |
setSmtpPassword(java.lang.String value,
java.lang.String... args) |
DBEmailAccount |
setSmtpPort(int value,
java.lang.String... args) |
DBEmailAccount |
setSmtpSecurtiy(com.aspc.dal.dbobj.email.DBEmailAccountSecurity value,
java.lang.String... args) |
DBEmailAccount |
setSmtpServer(java.lang.String value,
java.lang.String... args) |
DBEmailAccount |
setSmtpUser(java.lang.String value,
java.lang.String... args) |
DBEmailAccount |
setType(com.aspc.dal.dbobj.email.DBEmailAccountType value,
java.lang.String... args) |
DBEmailAccount |
setUser(com.aspc.dal.dbobj.contact.Person value,
java.lang.String... args) |
addReloadEventListener, archiveCheck, autoEnterCreate, calculateValue, calculateValue, calculateValue, callingRestoreByJournal, changeThreadMode, checkCreateAccess, checkDelete, checkDeleteAccess, checkModifyAccess, checkModifyAccess, checkReadAccess, clearCache, copy, copyFields, copyIncludeField, copyInwardLinks, delete, denormalizedResult, displayLogName, displayValue, doSearch, dump, equals, eventDataLoaded, eventFieldUpdated, extCanDeleteDependantObject, extCheckCreateAccess, extCheckDeleteAccess, extCheckModifyAccess, extCheckModifyAccess, extCheckReadAccess, extCopy, extDelete, extDeleteRecord, extGetDerivedGlobalKey, extGetDerivedValue, extGetValue, extIsMandatory, extIsOnChange, extMarkSavePoint, extPostDeleteRecord, extPostSaveRecord, extPreDeleteRecord, extPreSaveRecord, extPreValidateDelete, extRaiseEvents, extRollbackTo, extSaveRecord, extSetValue, extUndelete, extValidateDelete, extValidateRecord, fetchLinkHolder, findGlobalKey, findGlobalKey, findGlobalKey, findGlobalKey, findLinkedObject, findLinkedObject, findLinkedObject, findRawData, fireEventDataLoaded, fixUp, forceLockedTransaction, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getChangedFieldInfo, getChangedFields, getDate, getDate, getDate, getDate, getDate, getDefaultValue, getDisableOnChangeEvent, getDouble, getDouble, getDouble, getDouble, getDouble, getFieldDouble, getFieldInt, getFieldLong, getFieldString, getFormattedString, getFormattedString, getGlobalKey, getGlobalKey, getGlobalKey, getGlobalKey, getGlobalKey, getInt, getInt, getInt, getInt, getInt, getInt, getInwardLinkage, getKeyString, getKeyValue, getLinkedObject, getLinkedObject, getLinkedObject, getLinkedObjectByKey, getLinkedRowId, getLinkedRowId, getLinkedRowIdByData, getLinkHolder, getLockedTransaction, getLong, getLong, getLong, getLong, getLong, getLong, getMutableArrayValue, getMutableArrayValue, getOriginalKey, getOriginalValue, getOriginalValue, getProcessedValue, getPureValue, getRawData, getRawValue, getRawValue, getRowId, getRowKey, getSecondaryCacheGroupKey, getSrcLayerID, getString, getString, getString, getString, getString, getString, getValue, getValue, getValue, getValue, hasAutoChanged, hasAutoChanged, hasChanged, hasChangedByUser, hasChangedByUserField, hasChangedByUserField, hasFieldChanged, hasFieldChanged, hashCode, hasStoredResult, iCheckDeleteAccess, iCheckModifyAccess, iCheckReadAccess, iGetDenormalizedMap, iGetRawValue, iPlaceDenormalizedResult, iPostSaveOrDeleteRecord, iPreSaveOrDeleteRecord, iPreValidate, iRaiseEvents, iSaveOrDeleteRecord, isBrokenLink, isBrokenLink, isChanged, isDataCacheKnownToBeDirty, isDeleted, isEmpty, iSetValue, isForceReindex, isKeyWordField, isMandatory, isNew, isNull, isNull, isOnChange, isReindex, iValidateRecord, lastTouched, makeArchiveDataLoader, makeClone, makeDataLoader, makeDenormalizedDoc, makeLinkedArray, makeModifyAccessException, makeSearchPlan, makeWriteProvider, manualDenormalizeOnSave, markSavePoint, optLockedTransaction, registerWatchedObject, reindex, releaseDenormalized, removeReloadEventListener, restoreByJournal, rollbackTo, setBoolean, setBoolean, setBoolean, setBoolean, setDisableOnChangeEvent, setDouble, setDouble, setInt, setInt, setLong, setLong, setRawData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, toString, touch, undelete, validateField, validateRecord, validateSubType
public static final java.lang.String DBCLASS_NAME
public static final GlobalId DBCLASS_GID
public DBEmailAccount(DBClass def, DataSource dataSource) throws java.lang.Exception
def
- The class of this objectdataSource
- The datasource for this objectjava.lang.Exception
- A serious problem occurred@CheckReturnValue public int getID(java.lang.String... args)
@Nonnull public DBEmailAccount setID(int value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getCss(java.lang.String... args)
@Nonnull public DBEmailAccount setCss(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue public boolean isDefaultFg(java.lang.String... args)
@Nonnull public DBEmailAccount setDefaultFg(boolean value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getEmail(java.lang.String... args)
@Nonnull public DBEmailAccount setEmail(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getMailPassword(java.lang.String... args)
@Nonnull public DBEmailAccount setMailPassword(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getMailServerURL(java.lang.String... args)
@Nonnull public DBEmailAccount setMailServerURL(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getMailUser(java.lang.String... args)
@Nonnull public DBEmailAccount setMailUser(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getName(java.lang.String... args)
@Nonnull public DBEmailAccount setName(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nullable public DBEmailAccountSecurity getSecurity(java.lang.String... args)
@CheckReturnValue @Nonnull public final DBEmailAccountSecurity findSecurity(java.lang.String... args) throws NotFoundException
DBEmailAccountSecurity
(String, Searchable)args
- the optional argumentsNotFoundException
- DBEmailAccountSecurity was not found@Nonnull public DBEmailAccount setSecurity(com.aspc.dal.dbobj.email.DBEmailAccountSecurity value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getSmtpPassword(java.lang.String... args)
@Nonnull public DBEmailAccount setSmtpPassword(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnegative public int getSmtpPort(java.lang.String... args)
@Nonnull public DBEmailAccount setSmtpPort(int value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nullable public DBEmailAccountSecurity getSmtpSecurtiy(java.lang.String... args)
@CheckReturnValue @Nonnull public final DBEmailAccountSecurity findSmtpSecurtiy(java.lang.String... args) throws NotFoundException
DBEmailAccountSecurity
(String, Searchable)args
- the optional argumentsNotFoundException
- DBEmailAccountSecurity was not found@Nonnull public DBEmailAccount setSmtpSecurtiy(com.aspc.dal.dbobj.email.DBEmailAccountSecurity value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getSmtpServer(java.lang.String... args)
@Nonnull public DBEmailAccount setSmtpServer(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nonnull public java.lang.String getSmtpUser(java.lang.String... args)
@Nonnull public DBEmailAccount setSmtpUser(java.lang.String value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nullable public DBEmailAccountType getType(java.lang.String... args)
@CheckReturnValue @Nonnull public final DBEmailAccountType findType(java.lang.String... args) throws NotFoundException
DBEmailAccountType
(String, Searchable)args
- the optional argumentsNotFoundException
- DBEmailAccountType was not found@Nonnull public DBEmailAccount setType(com.aspc.dal.dbobj.email.DBEmailAccountType value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@CheckReturnValue @Nullable public Person getUser(java.lang.String... args)
@CheckReturnValue @Nonnull public final Person findUser(java.lang.String... args) throws NotFoundException
Person
(Integer,
Mandatory, Searchable)args
- the optional argumentsNotFoundException
- Person was not found@Nonnull public DBEmailAccount setUser(com.aspc.dal.dbobj.contact.Person value, java.lang.String... args) throws java.lang.Exception
java.lang.Exception
@Nonnull @CheckReturnValue public static DBEmailAccount create(@Nonnull MutableDataSource mds) throws java.lang.Exception
mds
- the datasourcejava.lang.Exception
- an object of this class could not be created@Nonnull @CheckReturnValue public static DBQuery<DBEmailAccount> makeQuery(@Nonnull DataSource ds) throws NotFoundException
ds
- the datasourceNotFoundException
- if class could not be found@Nonnull @CheckReturnValue public static DBEmailAccount findKey(@Nonnull DataSource ds, int key) throws NotFoundException, java.lang.Exception
ds
- the datasourcekey
- the valueNotFoundException
- if target could not be foundjava.lang.Exception
- a serious problem@CheckReturnValue @Nonnull public java.lang.String displayName()
displayName
in class DBObject
@OverridingMethodsMustInvokeSuper protected void extPreValidate() throws java.lang.Exception
DBObject
extPreValidate
in class DBObject
java.lang.Exception
- a serious problem@CheckReturnValue @OverridingMethodsMustInvokeSuper @Nullable protected ValidationError extValidateField(@Nonnull DBField field, @Nonnull ValidationList list) throws java.lang.Exception
extValidateField
in class DBObject
list
- The validation listfield
- The field to be validatedjava.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public Store findStore() throws java.lang.Exception
java.lang.Exception
- a serious problem@OverridingMethodsMustInvokeSuper protected void extAutoEnterCreate() throws java.lang.Exception
extAutoEnterCreate
in class DBObject
java.lang.Exception
- A serious problemcom.aspc.DBObj.DBObject#autoEnterCreate()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.