Package org.subethamail.smtp

Examples of org.subethamail.smtp.AuthenticationHandlerFactory


    {
      response.append("\r\n" + "250-STARTTLS");
    }

    // Check to see if we support authentication
    AuthenticationHandlerFactory authFact = sess.getServer().getAuthenticationHandlerFactory();
    if (authFact != null)
    {
      List<String> supportedMechanisms = authFact.getAuthenticationMechanisms();
      if (!supportedMechanisms.isEmpty())
      {
        response.append("\r\n" + "250-" + AuthCommand.VERB + " ");
        response.append(TextUtils.joinTogether(supportedMechanisms, " "));
      }
View Full Code Here


    {
      response.append("\r\n" + "250-STARTTLS");
    }

    // Check to see if we support authentication
    AuthenticationHandlerFactory authFact = sess.getServer().getAuthenticationHandlerFactory();
    if (authFact != null)
    {
      List<String> supportedMechanisms = authFact.getAuthenticationMechanisms();
      if (!supportedMechanisms.isEmpty())
      {
        response.append("\r\n" + "250-" + AuthCommand.VERB + " ");
        response.append(TextUtils.joinTogether(supportedMechanisms, " "));
      }
View Full Code Here

    {
      sess.sendResponse("503 Refusing any other AUTH command.");
      return;
    }

    AuthenticationHandlerFactory authFactory = sess.getServer().getAuthenticationHandlerFactory();

    if (authFactory == null)
    {
      sess.sendResponse("502 Authentication not supported");
      return;
    }

    AuthenticationHandler authHandler = authFactory.create();

    String[] args = this.getArgs(commandString);
    // Let's check the command syntax
    if (args.length < 2)
    {
      sess.sendResponse("501 Syntax: " + VERB + " mechanism [initial-response]");
      return;
    }

    // Let's check if we support the required authentication mechanism
    String mechanism = args[1];
    if (!authFactory.getAuthenticationMechanisms().contains(mechanism.toUpperCase(Locale.ENGLISH)))
    {
      sess.sendResponse("504 The requested authentication mechanism is not supported");
      return;
    }
    // OK, let's go trough the authentication process.
View Full Code Here

        String auth = stk.nextToken();
        if (!"AUTH".equals(auth))
          throw new IllegalArgumentException("Not an AUTH command: " + clientInput);

        String method = stk.nextToken();
        AuthenticationHandlerFactory fact = MultipleAuthenticationHandlerFactory.this.plugins.get(method);

        if (fact == null)
          throw new RejectException(504, "Method not supported");

        this.active = fact.create();
      }

      return this.active.auth(clientInput);
    }
View Full Code Here

TOP

Related Classes of org.subethamail.smtp.AuthenticationHandlerFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.