Class 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.AbstractLifecycleBean
    Base implementation of an email server.
    Since:
    2.2
    • Constructor Detail

      • EmailServer

        protected EmailServer()
    • 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:
        onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean
      • onShutdown

        protected void onShutdown​(org.springframework.context.ApplicationEvent event)
        Specified by:
        onShutdown in class org.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)