com.openexchange.mail.config
Class MailProperties

java.lang.Object
  extended by com.openexchange.mail.config.MailProperties
All Implemented Interfaces:
IMailProperties

public final class MailProperties
extends java.lang.Object
implements IMailProperties

MailProperties - Global mail properties read from properties file.

Author:
Thorben Betten

Method Summary
 int getAttachDisplaySize()
          Gets the max. allowed size (in bytes) for attachment for being displayed.
 java.lang.String getAuthProxyDelimiter()
           
 java.lang.String getDefaultMailProvider()
          Gets the default mail provider.
 java.lang.String getDefaultMimeCharset()
          Gets the default MIME charset.
 char getDefaultSeparator()
          Gets the default separator character.
static MailProperties getInstance()
          Gets the singleton instance of MailProperties.
 java.util.Properties getJavaMailProperties()
          Gets the JavaMail properties.
 MailConfig.LoginSource getLoginSource()
          Gets the login source.
 int getMailAccessCacheIdleSeconds()
          Gets the mail access cache idle seconds.
 int getMailAccessCacheShrinkerSeconds()
          Gets the mail access cache shrinker-interval seconds.
 int getMailFetchLimit()
          Gets the mail fetch limit.
 java.lang.String getMailServer()
          Gets the global mail server.
 MailConfig.ServerSource getMailServerSource()
          Gets the mail server source.
 java.lang.String getMasterPassword()
          Gets the master password.
 int getMaxToCcBcc()
          Gets the sent mail rate limit (how many mails can be sent in
 MailConfig.PasswordSource getPasswordSource()
          Gets the password source.
 java.lang.String[] getPhishingHeaders()
          Gets the phishing headers.
 java.lang.String[] getQuoteLineColors()
          Gets the quote line colors.
 int getRateLimit()
          Gets the sent mail rate limit (how many mails can be sent in
 boolean getRateLimitPrimaryOnly()
          Gets the setting if the rate limit should only affect the primary account or all accounts
 java.lang.String getTransportServer()
          Gets the global transport server
 MailConfig.ServerSource getTransportServerSource()
          Gets the transport server source.
 int getWatcherFrequency()
          Gets the watcher frequency.
 int getWatcherTime()
          Gets the watcher time.
 boolean isAddClientIPAddress()
          Checks if client's IP address should be added to mail headers on delivery as custom header "X-Originating-IP".
 boolean isAdminMailLoginEnabled()
          Indicates if admin mail login is enabled; meaning whether admin user's try to login to mail system is permitted or not.
 boolean isAllowNestedDefaultFolderOnAltNamespace()
          Checks if default folders (e.g.
 boolean isHidePOP3StorageFolders()
           
 boolean isIgnoreSubscription()
          Indicates whether subscription shall be ignored or not.
 boolean isSupportSubscription()
          Indicates whether subscription is supported or not.
 boolean isUserFlagsEnabled()
          Indicates if user flags are enabled.
 boolean isWatcherEnabled()
          Indicates if watcher is enabled.
 boolean isWatcherShallClose()
          Indicates if watcher is allowed to close exceeded connections.
 void loadProperties()
          Exclusively loads the global mail properties
static void releaseInstance()
          Releases the singleton instance of MailProperties.
 void resetProperties()
          Exclusively resets the global mail properties
 void waitForLoading()
          Waits for loading this properties.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MailProperties getInstance()
Gets the singleton instance of MailProperties.

Returns:
The singleton instance of MailProperties

releaseInstance

public static void releaseInstance()
Releases the singleton instance of MailProperties.


loadProperties

public void loadProperties()
                    throws MailConfigException
Exclusively loads the global mail properties

Throws:
MailConfigException - If loading of global mail properties fails

resetProperties

public void resetProperties()
Exclusively resets the global mail properties


waitForLoading

public void waitForLoading()
                    throws java.lang.InterruptedException
Waits for loading this properties.

Specified by:
waitForLoading in interface IMailProperties
Throws:
java.lang.InterruptedException - If another thread interrupted the current thread before or while the current thread was waiting for loading the properties.

isAllowNestedDefaultFolderOnAltNamespace

public boolean isAllowNestedDefaultFolderOnAltNamespace()
Description copied from interface: IMailProperties
Checks if default folders (e.g. "Sent Mail", "Drafts") are supposed to be created below personal namespace folder (INBOX) even though mail server indicates to create them on the same level as personal namespace folder.

Note that personal namespace folder must allow subfolder creation.

Specified by:
isAllowNestedDefaultFolderOnAltNamespace in interface IMailProperties
Returns:
true if default folders are supposed to be created below personal namespace folder; otherwise false

getAttachDisplaySize

public int getAttachDisplaySize()
Description copied from interface: IMailProperties
Gets the max. allowed size (in bytes) for attachment for being displayed.

Specified by:
getAttachDisplaySize in interface IMailProperties
Returns:
The max. allowed size (in bytes) for attachment for being displayed

getDefaultMimeCharset

public java.lang.String getDefaultMimeCharset()
Gets the default MIME charset.

Returns:
The default MIME charset

getDefaultMailProvider

public java.lang.String getDefaultMailProvider()
Gets the default mail provider.

Returns:
The default mail provider

isAdminMailLoginEnabled

public boolean isAdminMailLoginEnabled()
Indicates if admin mail login is enabled; meaning whether admin user's try to login to mail system is permitted or not.

Returns:
true if admin mail login is enabled; otherwise false

getDefaultSeparator

public char getDefaultSeparator()
Description copied from interface: IMailProperties
Gets the default separator character.

Specified by:
getDefaultSeparator in interface IMailProperties
Returns:
The default separator character

isIgnoreSubscription

public boolean isIgnoreSubscription()
Description copied from interface: IMailProperties
Indicates whether subscription shall be ignored or not.

Specified by:
isIgnoreSubscription in interface IMailProperties
Returns:
true if subscription shall be ignored; otherwise false

isHidePOP3StorageFolders

public boolean isHidePOP3StorageFolders()

isSupportSubscription

public boolean isSupportSubscription()
Description copied from interface: IMailProperties
Indicates whether subscription is supported or not.

Specified by:
isSupportSubscription in interface IMailProperties
Returns:
true if subscription is supported; otherwise false

isAddClientIPAddress

public boolean isAddClientIPAddress()
Checks if client's IP address should be added to mail headers on delivery as custom header "X-Originating-IP".

Returns:
true if client's IP address should be added otherwise false

getJavaMailProperties

public java.util.Properties getJavaMailProperties()
Gets the JavaMail properties.

Returns:
The JavaMail properties

getLoginSource

public MailConfig.LoginSource getLoginSource()
Gets the login source.

Returns:
The login source

getPasswordSource

public MailConfig.PasswordSource getPasswordSource()
Gets the password source.

Returns:
The password source

getMailServerSource

public MailConfig.ServerSource getMailServerSource()
Gets the mail server source.

Returns:
The mail server source

getTransportServerSource

public MailConfig.ServerSource getTransportServerSource()
Gets the transport server source.

Returns:
The transport server source

getMailFetchLimit

public int getMailFetchLimit()
Description copied from interface: IMailProperties
Gets the mail fetch limit.

Specified by:
getMailFetchLimit in interface IMailProperties
Returns:
The mail fetch limit

getMailServer

public java.lang.String getMailServer()
Gets the global mail server.

Returns:
The global mail server

getMasterPassword

public java.lang.String getMasterPassword()
Gets the master password.

Returns:
The master password

getMaxToCcBcc

public int getMaxToCcBcc()
Gets the sent mail rate limit (how many mails can be sent in

Returns:

getQuoteLineColors

public java.lang.String[] getQuoteLineColors()
Gets the quote line colors.

Returns:
The quote line colors

getRateLimit

public int getRateLimit()
Gets the sent mail rate limit (how many mails can be sent in

Returns:

getRateLimitPrimaryOnly

public boolean getRateLimitPrimaryOnly()
Gets the setting if the rate limit should only affect the primary account or all accounts

Returns:

getTransportServer

public java.lang.String getTransportServer()
Gets the global transport server

Returns:
The global transport server

isUserFlagsEnabled

public boolean isUserFlagsEnabled()
Description copied from interface: IMailProperties
Indicates if user flags are enabled.

Specified by:
isUserFlagsEnabled in interface IMailProperties
Returns:
true if user flags are enabled; otherwise false

isWatcherEnabled

public boolean isWatcherEnabled()
Description copied from interface: IMailProperties
Indicates if watcher is enabled.

Specified by:
isWatcherEnabled in interface IMailProperties
Returns:
true if watcher is enabled; otherwise false

getWatcherFrequency

public int getWatcherFrequency()
Description copied from interface: IMailProperties
Gets the watcher frequency.

Specified by:
getWatcherFrequency in interface IMailProperties
Returns:
The watcher frequency

isWatcherShallClose

public boolean isWatcherShallClose()
Description copied from interface: IMailProperties
Indicates if watcher is allowed to close exceeded connections.

Specified by:
isWatcherShallClose in interface IMailProperties
Returns:
true if watcher is allowed to close exceeded connections; otherwise false

getWatcherTime

public int getWatcherTime()
Description copied from interface: IMailProperties
Gets the watcher time.

Specified by:
getWatcherTime in interface IMailProperties
Returns:
The watcher time

getPhishingHeaders

public java.lang.String[] getPhishingHeaders()
Gets the phishing headers.

Returns:
The phishing headers or null if none defined

getMailAccessCacheShrinkerSeconds

public int getMailAccessCacheShrinkerSeconds()
Description copied from interface: IMailProperties
Gets the mail access cache shrinker-interval seconds.

Specified by:
getMailAccessCacheShrinkerSeconds in interface IMailProperties
Returns:
The mail access cache shrinker-interval seconds

getMailAccessCacheIdleSeconds

public int getMailAccessCacheIdleSeconds()
Description copied from interface: IMailProperties
Gets the mail access cache idle seconds.

Specified by:
getMailAccessCacheIdleSeconds in interface IMailProperties
Returns:
The mail access cache idle seconds.

getAuthProxyDelimiter

public final java.lang.String getAuthProxyDelimiter()
Returns:
the authProxyDelimiter