SK.gnome.dwarf.mail.smtp
Class SMTPParameters

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.ParametersService
          extended bySK.gnome.dwarf.mail.smtp.SMTPParameters
All Implemented Interfaces:
SK.gnome.dwarf.Parameters, SK.gnome.dwarf.Reportable, SK.gnome.dwarf.Service

public final class SMTPParameters
extends SK.gnome.dwarf.ParametersService

Provides the SMTP-related parameters.

An instance of this class may be added to the SMTPServer to provide a set of the SMTP-related runtime parameters. The parameters are by default available to the server and all its nested services.

Each parameter is represented by a protected field with its setter and getter methods, which can be used to access the parameter from the outside world.

Note that some of the parameters are read-only while others may be modified in runtime either via the server console, or programatically.


Field Summary
protected  SK.gnome.dwarf.tcpip.InetHostSet authClients
          List of clients which must always authenticate for any SMTP command.
protected  java.lang.String[] authMethods
          The actually available authentication methods.
protected  SK.gnome.dwarf.tcpip.InetHostSet authRelayClients
          List of clients for which the SMTP relaying is enabled if they authenticate themselves first.
protected  java.lang.String[] autoRunNodes
          List of nodes which will be automatically processed each time a message arrives to the queue.
protected  boolean caseSensitiveMailbox
          Whether the local user names should be regarded case-sensitive.
protected  int clientTimeout
          Client inactivity timeout.
protected  java.lang.String defaultRelay
          Default SMTP relay which will be used to route the outgoing messages.
protected  int deferredDeliveryTimeout
          After this time in hours a message will be considered undeliverable if it is targeted for a deferred node.
protected  java.lang.String[] deferredNodes
          List of nodes which are deffered by default.
protected  int deliveryInterval
          Interval in seconds of the particular delivery attempts for a single message.
protected  int deliveryTimeout
          After this time in hours a message will be considered undeliverable.
protected  int deliveryWarningTimeout
          After this time in hours a DSN warning will be issued for an undelivered message if the failure reason is regarded as temporary.
protected  java.lang.String[] etrnNodes
          List of nodes for which the ETRN command is enabled.
protected  java.lang.String[] extensions
          The actually available SMTP extensions.
protected  java.lang.String hostName
          The host name of the server.
protected  boolean identifyUser
          Whether the local user existence will be tested using the system authentication facility.
protected  boolean insecureLoginDisabled
          Whether to allow the transfer of cleartext passwords via insecure connections.
protected  int loginDelay
          The delay after a failed login.
protected  int maxMessageSize
          Maximum allowed size of a single message in bytes.
protected  int maxRecipients
          Maximum allowed number of recipients in a single message.
protected  SK.gnome.dwarf.tcpip.InetHostSet noAuthClients
          List of clients which will be rejected even if they are implied by authClients.
protected  SK.gnome.dwarf.tcpip.InetHostSet noAuthRelayClients
          List of clients for which the SMTP relaying will be rejected even if they are implied by authRelayClients.
protected  boolean notifyIfRemoteDSN
          Whether the DSN notifications will be created for failed delivery attempts even if the remote SMTP host reports that it supports DSN, too.
protected  boolean notifyPostmaster
          Whether the DSN notifications will be sent to the postmaster address, too.
protected  java.lang.String[] rejectFrom
          List of sender addresses which will always be rejected.
protected  java.lang.String[] rejectTo
          List of recipient addresses which will always be rejected.
protected  SK.gnome.dwarf.tcpip.InetHostSet relayClients
          List of clients for which the SMTP relaying is enabled.
protected  boolean sendServerInfo
          Enables or disables exposing of the server name and version to the client.
protected  int serverTimeout
          Remote server inactivity timeout.
 
Fields inherited from class SK.gnome.dwarf.GenericService
initParameters, parent
 
Fields inherited from interface SK.gnome.dwarf.Service
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED
 
Constructor Summary
SMTPParameters(java.lang.String name)
          Creates a new SMTPParameters.
 
Method Summary
 boolean containsAuthMethod(java.lang.String method)
           
 boolean containsAutoRunNode(java.lang.String node)
           
 boolean containsDeferredNode(java.lang.String node)
           
 boolean containsEtrnNode(java.lang.String node)
           
 boolean containsExtension(java.lang.String extension)
           
 boolean containsRejectFrom(java.lang.String addr)
           
 boolean containsRejectTo(java.lang.String addr)
           
 java.lang.String[] getAllAuthMethods()
           
 java.lang.String[] getAllExtensions()
           
 SK.gnome.dwarf.tcpip.InetHostSet getAuthClients()
           
 java.lang.String[] getAuthMethods()
           
 SK.gnome.dwarf.tcpip.InetHostSet getAuthRelayClients()
           
 java.lang.String[] getAutoRunNodes()
           
 boolean getCaseSensitiveMailbox()
           
 int getClientTimeout()
           
 java.lang.String getDefaultRelay()
           
 int getDeferredDeliveryTimeout()
           
 int getDeliveryInterval()
           
 int getDeliveryTimeout()
           
 int getDeliveryWarningTimeout()
           
 java.lang.String[] getExtensions()
           
 java.net.InetAddress getHostAddress()
           
 java.lang.String getHostName()
           
 boolean getIdentifyUser()
           
 boolean getInsecureLoginDisabled()
           
 int getLoginDelay()
           
 int getMaxMessageSize()
           
 int getMaxRecipients()
           
 SK.gnome.dwarf.tcpip.InetHostSet getNoAuthClients()
           
 SK.gnome.dwarf.tcpip.InetHostSet getNoAuthRelayClients()
           
 boolean getNotifyIfRemoteDSN()
           
 boolean getNotifyPostmaster()
           
 java.lang.String getPostmasterAddress()
           
 SK.gnome.dwarf.tcpip.InetHostSet getRelayClients()
           
 boolean getSendServerInfo()
           
 int getServerTimeout()
           
 void init(SK.gnome.dwarf.Server parent)
          Initialized the service.
 void setAuthClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)
           
 void setAuthMethods(java.lang.String[] methods)
           
 void setAuthRelayClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)
           
 void setAutoRunNodes(java.lang.String[] nodes)
           
 void setCaseSensitiveMailbox(boolean enable)
           
 void setClientTimeout(int timeout)
           
 void setDefaultRelay(java.lang.String addr)
           
 void setDeferredDeliveryTimeout(int timeout)
           
 void setDeferredNodes(java.lang.String[] nodes)
           
 void setDeliveryInterval(int interval)
           
 void setDeliveryTimeout(int timeout)
           
 void setDeliveryWarningTimeout(int timeout)
           
 void setEtrnNodes(java.lang.String[] nodes)
           
 void setExtensions(java.lang.String[] extensions)
           
 void setHostName(java.lang.String name)
           
 void setIdentifyUser(boolean enable)
           
 void setInsecureLoginDisabled(boolean enable)
           
 void setLoginDelay(int delay)
           
 void setMaxMessageSize(int size)
           
 void setMaxRecipients(int max)
           
 void setNoAuthClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)
           
 void setNoAuthRelayClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)
           
 void setNotifyIfRemoteDSN(boolean enable)
           
 void setNotifyPostmaster(boolean enable)
           
 void setRejectFrom(java.lang.String[] addrs)
           
 void setRejectTo(java.lang.String[] addrs)
           
 void setRelayClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)
           
 void setSendServerInfo(boolean enable)
           
 void setServerTimeout(int timeout)
           
 
Methods inherited from class SK.gnome.dwarf.ParametersService
readOnly, report
 
Methods inherited from class SK.gnome.dwarf.GenericService
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, shutdown, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hostName

protected java.lang.String hostName
The host name of the server.

It must be a resolvable name of the host which the server is running on.

This parameter is read-only.

Default value: the local host name, if available


defaultRelay

protected java.lang.String defaultRelay
Default SMTP relay which will be used to route the outgoing messages.

If null the server will do the mail routing by itself.


relayClients

protected SK.gnome.dwarf.tcpip.InetHostSet relayClients
List of clients for which the SMTP relaying is enabled.

Default value: all hosts from the local network


authClients

protected SK.gnome.dwarf.tcpip.InetHostSet authClients
List of clients which must always authenticate for any SMTP command.


noAuthClients

protected SK.gnome.dwarf.tcpip.InetHostSet noAuthClients
List of clients which will be rejected even if they are implied by authClients.


authRelayClients

protected SK.gnome.dwarf.tcpip.InetHostSet authRelayClients
List of clients for which the SMTP relaying is enabled if they authenticate themselves first.


noAuthRelayClients

protected SK.gnome.dwarf.tcpip.InetHostSet noAuthRelayClients
List of clients for which the SMTP relaying will be rejected even if they are implied by authRelayClients.


rejectFrom

protected java.lang.String[] rejectFrom
List of sender addresses which will always be rejected.

The sender address is obtained from the SMTP envelope, not from the message header.

Default value: {}


rejectTo

protected java.lang.String[] rejectTo
List of recipient addresses which will always be rejected.

The recipient address is obtained from the SMTP envelope, not from the message headers.

Default value: {}


notifyPostmaster

protected boolean notifyPostmaster
Whether the DSN notifications will be sent to the postmaster address, too.

Default value: true


notifyIfRemoteDSN

protected boolean notifyIfRemoteDSN
Whether the DSN notifications will be created for failed delivery attempts even if the remote SMTP host reports that it supports DSN, too.

This may cause that the DSN messages will be generated by both the sending and receiving server if the message delivery fails for any reason, but it guarantees that the error message will be created in any case.

Default value: false


clientTimeout

protected int clientTimeout
Client inactivity timeout.

Specifies the client inactivity timeout in seconds. After this time the server will automatically close the idle connection.

Default value: 600


serverTimeout

protected int serverTimeout
Remote server inactivity timeout.

Specifies the server inactivity timeout in seconds. After this time the client will automatically close the connection.

Default value: 600


sendServerInfo

protected boolean sendServerInfo
Enables or disables exposing of the server name and version to the client.

This parameter is read-only.

Default value: false


maxRecipients

protected int maxRecipients
Maximum allowed number of recipients in a single message.

Default value: 100


maxMessageSize

protected int maxMessageSize
Maximum allowed size of a single message in bytes.

This parameter is read-only.

Default value: 2 MB


extensions

protected java.lang.String[] extensions
The actually available SMTP extensions.

This parameter is read-only.

Default value: AUTH, DSN, SIZE, STARTTLS


authMethods

protected java.lang.String[] authMethods
The actually available authentication methods.

This parameter is read-only.

Default value: LOGIN, PLAIN


insecureLoginDisabled

protected boolean insecureLoginDisabled
Whether to allow the transfer of cleartext passwords via insecure connections.

If enabled the server will not allow to authenticate via a method which uses cleartext passwords unless the session is secured by an encryption mechanism. The LOGIN command and the AUTHENTICATE command with LOGIN or PLAIN methods are examples of such prohibited means.

Default value: false


loginDelay

protected int loginDelay
The delay after a failed login.

This value in seconds specifies how long will server wait for accepting another login request in the same session after a failed one. This feature may prevent some sort of attacks against the server.

Default value: 5


etrnNodes

protected java.lang.String[] etrnNodes
List of nodes for which the ETRN command is enabled.

This parameter is read-only.

Default value: {}


deferredNodes

protected java.lang.String[] deferredNodes
List of nodes which are deffered by default.

A deferred node is never processed on a regular queue scan. Instead, it must be run by issuing a special console command, or remotelly via the ETRN protocol extension, if enabled.

This parameter is read-only.

Default value: {}


autoRunNodes

protected java.lang.String[] autoRunNodes
List of nodes which will be automatically processed each time a message arrives to the queue.

This parameter is read-only.

Default value: {}


deliveryInterval

protected int deliveryInterval
Interval in seconds of the particular delivery attempts for a single message.

This parameter is read-only.

Default value: 300


deliveryTimeout

protected int deliveryTimeout
After this time in hours a message will be considered undeliverable.

This parameter is read-only.

Default value: 120


deferredDeliveryTimeout

protected int deferredDeliveryTimeout
After this time in hours a message will be considered undeliverable if it is targeted for a deferred node.

This parameter is read-only.

Default value: 336


deliveryWarningTimeout

protected int deliveryWarningTimeout
After this time in hours a DSN warning will be issued for an undelivered message if the failure reason is regarded as temporary.

This parameter is read-only.

Default value: 4


caseSensitiveMailbox

protected boolean caseSensitiveMailbox
Whether the local user names should be regarded case-sensitive.

It is highly recommended to keep this feature disabled.

This parameter is read-only.

Default value: false


identifyUser

protected boolean identifyUser
Whether the local user existence will be tested using the system authentication facility.

If this parameter is enabled, the existence of a local user will be tested by using the identification feature provided by the Dwarf-based login modules. If your login module does not provide this feature, or it is not based on the Dwarf framework, or the underlying authentication mechanism is completely different, you will have to set this parameter to false. In that case, the server will test the local user presence by simply checking whether a mail store exists for that user. That means you will have to create a mail store for each local user prior to delivering any mail message to the mailbox.

This parameter is read-only.

Default value: false

Constructor Detail

SMTPParameters

public SMTPParameters(java.lang.String name)
Creates a new SMTPParameters.

Method Detail

init

public void init(SK.gnome.dwarf.Server parent)
          throws SK.gnome.dwarf.ServiceException
Initialized the service.

Throws:
SK.gnome.dwarf.ServiceException

getAllExtensions

public java.lang.String[] getAllExtensions()

getAllAuthMethods

public java.lang.String[] getAllAuthMethods()

getHostName

public java.lang.String getHostName()

getHostAddress

public java.net.InetAddress getHostAddress()

setHostName

public void setHostName(java.lang.String name)

getPostmasterAddress

public java.lang.String getPostmasterAddress()

getDefaultRelay

public java.lang.String getDefaultRelay()

setDefaultRelay

public void setDefaultRelay(java.lang.String addr)

getRelayClients

public SK.gnome.dwarf.tcpip.InetHostSet getRelayClients()

setRelayClients

public void setRelayClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)

getAuthClients

public SK.gnome.dwarf.tcpip.InetHostSet getAuthClients()

setAuthClients

public void setAuthClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)

getNoAuthClients

public SK.gnome.dwarf.tcpip.InetHostSet getNoAuthClients()

setNoAuthClients

public void setNoAuthClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)

getAuthRelayClients

public SK.gnome.dwarf.tcpip.InetHostSet getAuthRelayClients()

setAuthRelayClients

public void setAuthRelayClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)

getNoAuthRelayClients

public SK.gnome.dwarf.tcpip.InetHostSet getNoAuthRelayClients()

setNoAuthRelayClients

public void setNoAuthRelayClients(SK.gnome.dwarf.tcpip.InetHostSet hosts)

containsRejectFrom

public boolean containsRejectFrom(java.lang.String addr)

setRejectFrom

public void setRejectFrom(java.lang.String[] addrs)

containsRejectTo

public boolean containsRejectTo(java.lang.String addr)

setRejectTo

public void setRejectTo(java.lang.String[] addrs)

getNotifyPostmaster

public boolean getNotifyPostmaster()

setNotifyPostmaster

public void setNotifyPostmaster(boolean enable)

getNotifyIfRemoteDSN

public boolean getNotifyIfRemoteDSN()

setNotifyIfRemoteDSN

public void setNotifyIfRemoteDSN(boolean enable)

setClientTimeout

public void setClientTimeout(int timeout)

getClientTimeout

public int getClientTimeout()

setServerTimeout

public void setServerTimeout(int timeout)

getServerTimeout

public int getServerTimeout()

getSendServerInfo

public boolean getSendServerInfo()

setSendServerInfo

public void setSendServerInfo(boolean enable)

getMaxRecipients

public int getMaxRecipients()

setMaxRecipients

public void setMaxRecipients(int max)

getMaxMessageSize

public int getMaxMessageSize()

setMaxMessageSize

public void setMaxMessageSize(int size)

getExtensions

public java.lang.String[] getExtensions()

containsExtension

public boolean containsExtension(java.lang.String extension)

setExtensions

public void setExtensions(java.lang.String[] extensions)

getAuthMethods

public java.lang.String[] getAuthMethods()

containsAuthMethod

public boolean containsAuthMethod(java.lang.String method)

setAuthMethods

public void setAuthMethods(java.lang.String[] methods)

setInsecureLoginDisabled

public void setInsecureLoginDisabled(boolean enable)

getInsecureLoginDisabled

public boolean getInsecureLoginDisabled()

getLoginDelay

public int getLoginDelay()

setLoginDelay

public void setLoginDelay(int delay)

containsEtrnNode

public boolean containsEtrnNode(java.lang.String node)

setEtrnNodes

public void setEtrnNodes(java.lang.String[] nodes)

containsDeferredNode

public boolean containsDeferredNode(java.lang.String node)

setDeferredNodes

public void setDeferredNodes(java.lang.String[] nodes)

getAutoRunNodes

public java.lang.String[] getAutoRunNodes()

containsAutoRunNode

public boolean containsAutoRunNode(java.lang.String node)

setAutoRunNodes

public void setAutoRunNodes(java.lang.String[] nodes)

setDeliveryInterval

public void setDeliveryInterval(int interval)

getDeliveryInterval

public int getDeliveryInterval()

setDeliveryTimeout

public void setDeliveryTimeout(int timeout)

getDeliveryTimeout

public int getDeliveryTimeout()

setDeferredDeliveryTimeout

public void setDeferredDeliveryTimeout(int timeout)

getDeferredDeliveryTimeout

public int getDeferredDeliveryTimeout()

setDeliveryWarningTimeout

public void setDeliveryWarningTimeout(int timeout)

getDeliveryWarningTimeout

public int getDeliveryWarningTimeout()

getCaseSensitiveMailbox

public boolean getCaseSensitiveMailbox()

setCaseSensitiveMailbox

public void setCaseSensitiveMailbox(boolean enable)

getIdentifyUser

public boolean getIdentifyUser()

setIdentifyUser

public void setIdentifyUser(boolean enable)


Copyright (c) 2004-2005, Gnome Ltd. All rights reserved.