org.subethamail.smtp.auth
Class DummyAuthenticationHandler

java.lang.Object
  extended by org.subethamail.smtp.auth.DummyAuthenticationHandler
All Implemented Interfaces:
AuthenticationHandler

public class DummyAuthenticationHandler
extends java.lang.Object
implements AuthenticationHandler

Implements a dummy AUTH mechanism.
Will always allow to login without asking for any parameter.

Author:
Jeff Schnitzer, De Oliveira Edouard <doe_wanted@yahoo.fr>

Constructor Summary
DummyAuthenticationHandler()
           
 
Method Summary
 boolean auth(java.lang.String clientInput, java.lang.StringBuilder response, ConnectionContext ctx)
          Initially called using an input string in the RFC2554 form: "AUTH [initial-response]".
 java.util.List<java.lang.String> getAuthenticationMechanisms()
          If your handler supports RFC 2554 at some degree, then it must return all the supported mechanisms here.
 void resetState()
          Since a so-designed handler has its own state, it seems reasonable to enable resetting its state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyAuthenticationHandler

public DummyAuthenticationHandler()
Method Detail

getAuthenticationMechanisms

public java.util.List<java.lang.String> getAuthenticationMechanisms()
Description copied from interface: AuthenticationHandler
If your handler supports RFC 2554 at some degree, then it must return all the supported mechanisms here.
The order you use to populate the list will be preserved in the output of the EHLO command.
If your handler does not support RFC 2554 at all, return an empty list.

Specified by:
getAuthenticationMechanisms in interface AuthenticationHandler
Returns:
the supported authentication mechanisms as List.

auth

public boolean auth(java.lang.String clientInput,
                    java.lang.StringBuilder response,
                    ConnectionContext ctx)
             throws RejectException
Description copied from interface: AuthenticationHandler
Initially called using an input string in the RFC2554 form: "AUTH [initial-response]".
This method must provide the correct reply (by filling the response parameter) at each clientInput.

Depending on the authentication mechanism, the handshaking process may require many request-response passes. This method will return true only when the authentication process is finished

Specified by:
auth in interface AuthenticationHandler
Parameters:
clientInput - The client's input.
response - a buffer filled with your response to the client input.
ctx - the connection context filled with the credential of the user if authentication succeeds.
Returns:
true if the authentication process is finished, false otherwise.
Throws:
RejectException - if authentication fails.

resetState

public void resetState()
Description copied from interface: AuthenticationHandler
Since a so-designed handler has its own state, it seems reasonable to enable resetting its state. This can be done, for example, after a "*" client response during the AUTH command processing.

Specified by:
resetState in interface AuthenticationHandler


Copyright © 2011 SubEthaSMTP. All Rights Reserved. Build version: UNVERSIONED