Package org.alfresco.email.server
Class EmailServer
- java.lang.Object
-
- org.springframework.extensions.surf.util.AbstractLifecycleBean
-
- org.alfresco.email.server.EmailServer
-
- All Implemented Interfaces:
java.util.EventListener,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
- Direct Known Subclasses:
SubethaEmailServer
public abstract class EmailServer extends org.springframework.extensions.surf.util.AbstractLifecycleBeanBase implementation of an email server.- Since:
- 2.2
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedEmailServer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanauthenticateUserNamePassword(java.lang.String userName, char[] password)authenticate with a user/passwordprotected voidfilterSender(java.lang.String sender)Filter incoming message by its sender e-mail address.AuthenticationComponentgetAuthenticationComponent()protected java.lang.StringgetDomain()protected EmailServicegetEmailService()protected intgetMaxConnections()Returns the maximum number of connection accepted by the server.protected intgetPort()booleanisAuthenticate()booleanisEnableTLS()booleanisHideTLS()protected booleanisNullReversePatAllowed()booleanisRequireTLS()static voidmain(java.lang.String[] args)protected voidonBootstrap(org.springframework.context.ApplicationEvent event)protected voidonShutdown(org.springframework.context.ApplicationEvent event)voidsetAllowedSenders(java.lang.String allowedSenders)Set the allowed senders as a comma separated list.voidsetAllowedSendersList(java.util.List<java.lang.String> allowedSenders)voidsetAuthenticate(boolean enableAuthentication)voidsetAuthenticationComponent(AuthenticationComponent authenticationComponent)voidsetBlockedSenders(java.lang.String blockedSenders)Set the blocked senders as a comma separated list.voidsetBlockedSendersList(java.util.List<java.lang.String> blockedSenders)voidsetDomain(java.lang.String domain)voidsetEmailService(EmailService emailService)voidsetEnabled(boolean enabled)voidsetEnableTLS(boolean enableTLS)voidsetHideTLS(boolean hideTLS)Hide the TLS (Trusted Login Session) optionvoidsetMaxConnections(int maxConnections)Sets the maximum number of connection accepted by the servervoidsetPort(int port)voidsetRequireTLS(boolean requireTLS)voidsetUnknownUser(java.lang.String unknownUser)Used only for check "isNullReversePatAllowed".abstract voidshutdown()Method is called when server is shutting down.abstract voidstartup()Method is called when server is starting up.
-
-
-
Method Detail
-
setEnabled
public void setEnabled(boolean enabled)
- Parameters:
enabled- Enable/disable server
-
getDomain
protected java.lang.String getDomain()
-
setDomain
public void setDomain(java.lang.String domain)
-
getPort
protected int getPort()
-
setPort
public void setPort(int port)
- Parameters:
port- SMTP port (25 is default)
-
getMaxConnections
protected int getMaxConnections()
Returns the maximum number of connection accepted by the server.- Returns:
- the maximum number of connections
-
setMaxConnections
public void setMaxConnections(int maxConnections)
Sets the maximum number of connection accepted by the server- Parameters:
maxConnections-
-
setBlockedSenders
public void setBlockedSenders(java.lang.String blockedSenders)
Set the blocked senders as a comma separated list. The entries will be trimmed of all whitespace.- Parameters:
blockedSenders- a comman separated list of blocked senders
-
setBlockedSendersList
public void setBlockedSendersList(java.util.List<java.lang.String> blockedSenders)
- Parameters:
blockedSenders- a list of senders that are not allowed to email in
-
setAllowedSenders
public void setAllowedSenders(java.lang.String allowedSenders)
Set the allowed senders as a comma separated list. The entries will be trimmed of all whitespace.- Parameters:
allowedSenders- a comman separated list of blocked senders
-
setAllowedSendersList
public void setAllowedSendersList(java.util.List<java.lang.String> allowedSenders)
- Parameters:
allowedSenders- a list of senders that are allowed to email in
-
getEmailService
protected EmailService getEmailService()
- Returns:
- the service interface to interact with
-
setEmailService
public void setEmailService(EmailService emailService)
- Parameters:
emailService- the service interface to interact with
-
setUnknownUser
public void setUnknownUser(java.lang.String unknownUser)
Used only for check "isNullReversePatAllowed".- Parameters:
unknownUser- authority name
-
isNullReversePatAllowed
protected boolean isNullReversePatAllowed()
-
filterSender
protected void filterSender(java.lang.String sender)
Filter incoming message by its sender e-mail address.- Parameters:
sender- An e-mail address of sender- Throws:
EmailMessageException- if the e-mail is rejected accordingly with blocked and allowed lists
-
startup
public abstract void startup()
Method is called when server is starting up.
-
shutdown
public abstract void shutdown()
Method is called when server is shutting down.
-
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event)
- Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event)
- Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
main
public static void main(java.lang.String[] args)
-
authenticateUserNamePassword
protected boolean authenticateUserNamePassword(java.lang.String userName, char[] password)authenticate with a user/password- Parameters:
userName-password-- Returns:
- true - authenticated
-
setHideTLS
public void setHideTLS(boolean hideTLS)
Hide the TLS (Trusted Login Session) option- Parameters:
hideTLS-
-
isHideTLS
public boolean isHideTLS()
-
setEnableTLS
public void setEnableTLS(boolean enableTLS)
-
isEnableTLS
public boolean isEnableTLS()
-
setRequireTLS
public void setRequireTLS(boolean requireTLS)
-
isRequireTLS
public boolean isRequireTLS()
-
setAuthenticate
public void setAuthenticate(boolean enableAuthentication)
-
isAuthenticate
public boolean isAuthenticate()
-
setAuthenticationComponent
public void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
-
getAuthenticationComponent
public AuthenticationComponent getAuthenticationComponent()
-
-