public final class SMTPServer extends Object implements SSLSocketCreator
AuthenticationHandlerFactory.| Modifier and Type | Class and Description |
|---|---|
static class |
SMTPServer.Builder |
| Modifier and Type | Method and Description |
|---|---|
SSLSocket |
createSSLSocket(Socket socket)
Create an SSL socket that wraps the existing socket.
|
Optional<AuthenticationHandlerFactory> |
getAuthenticationHandlerFactory()
Returns the factor for authentication handling.
|
int |
getBacklog()
The backlog is the Socket backlog.
|
Optional<InetAddress> |
getBindAddress()
empty means all interfaces
|
CommandHandler |
getCommandHandler()
The CommandHandler manages handling the SMTP commands such as QUIT, MAIL,
RCPT, DATA, etc.
|
int |
getConnectionTimeout() |
boolean |
getDisableReceivedHeaders() |
String |
getDisplayableLocalSocketAddress() |
boolean |
getEnableTLS() |
ExecutorService |
getExecutorService() |
boolean |
getHideTLS() |
String |
getHostName() |
int |
getMaxConnections() |
int |
getMaxMessageSize() |
int |
getMaxRecipients() |
MessageHandlerFactory |
getMessageHandlerFactory() |
int |
getPort() |
int |
getPortAllocated() |
boolean |
getRequireAuth() |
boolean |
getRequireTLS() |
String |
getServerThreadName() |
SessionHandler |
getSessionHandler() |
SessionIdFactory |
getSessionIdFactory() |
boolean |
getShowAuthCapabilitiesBeforeSTARTTLS() |
String |
getSoftwareName()
The string reported to the public as the software running here.
|
boolean |
isRunning()
Is the server running after start() has been called?
|
static SMTPServer.Builder |
port(int port) |
void |
start()
Starts the server listening for connections.
|
void |
stop()
Shut things down gracefully.
|
public String getHostName()
public Optional<InetAddress> getBindAddress()
public int getPort()
public int getPortAllocated()
public String getSoftwareName()
public ExecutorService getExecutorService()
public boolean isRunning()
public int getBacklog()
public void start()
An SMTPServer which has been shut down, must not be reused.
public void stop()
public SSLSocket createSSLSocket(Socket socket) throws IOException
Subclasses may override this method to configure the key stores, enabled protocols/ cipher suites, enforce client authentication, etc.
createSSLSocket in interface SSLSocketCreatorsocket - the existing socket as created by createServerSocket()
(not null)IOException - when creating the socket failedpublic String getDisplayableLocalSocketAddress()
public MessageHandlerFactory getMessageHandlerFactory()
public Optional<AuthenticationHandlerFactory> getAuthenticationHandlerFactory()
public CommandHandler getCommandHandler()
public int getMaxConnections()
public int getConnectionTimeout()
public int getMaxRecipients()
public boolean getEnableTLS()
public boolean getHideTLS()
public boolean getRequireTLS()
public boolean getRequireAuth()
public boolean getShowAuthCapabilitiesBeforeSTARTTLS()
public int getMaxMessageSize()
public boolean getDisableReceivedHeaders()
public SessionIdFactory getSessionIdFactory()
public SessionHandler getSessionHandler()
public static SMTPServer.Builder port(int port)
public String getServerThreadName()
Copyright © 2006–2024. All rights reserved.