Package org.alfresco.email.server
Class EmailServer
java.lang.Object
org.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.email.server.EmailServer
- All Implemented Interfaces:
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.AbstractLifecycleBean
Base implementation of an email server.
- Since:
- 2.2
-
Field Summary
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanauthenticateUserNamePassword(String userName, char[] password) authenticate with a user/passwordprotected voidfilterSender(String sender) Filter incoming message by its sender e-mail address.protected Stringprotected EmailServiceprotected intReturns the maximum number of connection accepted by the server.protected intgetPort()booleanbooleanbooleanprotected booleanbooleanprotected voidonBootstrap(org.springframework.context.ApplicationEvent event) protected voidonShutdown(org.springframework.context.ApplicationEvent event) voidsetAllowedSenders(String allowedSenders) Set the allowed senders as a comma separated list.voidsetAllowedSendersList(List<String> allowedSenders) voidsetAuthenticate(boolean enableAuthentication) voidsetAuthenticationComponent(AuthenticationComponent authenticationComponent) voidsetBlockedSenders(String blockedSenders) Set the blocked senders as a comma separated list.voidsetBlockedSendersList(List<String> blockedSenders) voidvoidsetEmailService(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(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.Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContext
-
Constructor Details
-
EmailServer
protected EmailServer()
-
-
Method Details
-
setEnabled
public void setEnabled(boolean enabled) - Parameters:
enabled- Enable/disable server
-
getDomain
-
setDomain
-
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
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
- Parameters:
blockedSenders- a list of senders that are not allowed to email in
-
setAllowedSenders
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
- Parameters:
allowedSenders- a list of senders that are allowed to email in
-
getEmailService
- Returns:
- the service interface to interact with
-
setEmailService
- Parameters:
emailService- the service interface to interact with
-
setUnknownUser
Used only for check "isNullReversePatAllowed".- Parameters:
unknownUser- authority name
-
isNullReversePatAllowed
protected boolean isNullReversePatAllowed() -
filterSender
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
-
authenticateUserNamePassword
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
-
getAuthenticationComponent
-