Package com.icegreen.greenmail.smtp
Class SmtpConnection
- java.lang.Object
-
- com.icegreen.greenmail.smtp.SmtpConnection
-
public class SmtpConnection extends Object
-
-
Constructor Summary
Constructors Constructor Description SmtpConnection(SmtpHandler handler, Socket sock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamdotLimitedInputStream(byte[] initialContent)Reads the contents of the stream until <CRLF>.<CRLF> is encountered.StringgetClientAddress()StringgetHeloName()InetAddressgetServerAddress()StringgetServerGreetingsName()booleanisAuthenticated()Checks if there was a successful authentication for this connection.voidquit()StringreadLine()voidsend(String line)voidsetAuthenticated(boolean authenticated)Sets the authentication state of this connection.voidsetHeloName(String n)
-
-
-
Constructor Detail
-
SmtpConnection
public SmtpConnection(SmtpHandler handler, Socket sock) throws IOException
- Throws:
IOException
-
-
Method Detail
-
send
public void send(String line)
-
readLine
public String readLine() throws IOException
- Throws:
IOException
-
dotLimitedInputStream
public InputStream dotLimitedInputStream(byte[] initialContent)
Reads the contents of the stream until <CRLF>.<CRLF> is encountered.- Parameters:
initialContent- initial content- Returns:
- a limited input stream.
-
getClientAddress
public String getClientAddress()
-
getServerAddress
public InetAddress getServerAddress()
-
getServerGreetingsName
public String getServerGreetingsName()
-
getHeloName
public String getHeloName()
-
setHeloName
public void setHeloName(String n)
-
quit
public void quit()
-
isAuthenticated
public boolean isAuthenticated()
Checks if there was a successful authentication for this connection.- Returns:
- true, if authenticated
-
setAuthenticated
public void setAuthenticated(boolean authenticated)
Sets the authentication state of this connection.- Parameters:
authenticated- true,
-
-