Examples of RejectException


Examples of org.subethamail.smtp.RejectException

            destinationMailbox = recipient.sourceRouteStripped();
            smartClient.to(destinationMailbox);
        } catch (SMTPException e) {
            throw new BackendRejectException(e, " - Backend rejected recipient");
        } catch (IOException e) {
            throw new RejectException(451, e.getMessage());
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

        try {
            smartClient.dataStart();
        } catch (SMTPException e) {
            throw new BackendRejectException(e, " - Backend rejected DATA");
        } catch (IOException e) {
            throw new RejectException(451, e.getMessage());
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

        int numRead;
        while ((numRead = data.read(buffer)) > 0) {
            try {
                smartClient.dataWrite(buffer, numRead);
            } catch (IOException e) {
                throw new RejectException(451, e.getMessage());
            }
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

            smartClient.dataEnd();
        } catch (SMTPException e) {
            throw new BackendRejectException(e,
                    " - Backend server rejected at end of data");
        } catch (IOException e) {
            throw new RejectException(451, e.getMessage());
        }
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

        @Override
        public void from(ReversePath from) throws RejectExceptionExt {
            if (!isAuthenticated()) {
                logger.debug("None of the authentication specifications "
                        + "matched the session, rejecting");
                throw new RejectException(530, "Authentication required");
            }
            chain.from(from);
        }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

                } else if (response.getPayload() instanceof String) {
                    mailResponse = (MailMessageResponse) mailMessageMapper.fromXML(response.getPayload().toString());
                }

                if (mailResponse != null && mailResponse.getCode() != MailMessageResponse.OK_CODE) {
                    throw new RejectException(mailResponse.getCode(), mailResponse.getMessage());
                }
            }
        } catch (MessagingException e) {
            throw new CitrusRuntimeException(e);
        }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

          addedListener = true;
        }
      }

      if (!addedListener)
        throw new RejectException(553, "<" + recipient + "> address unknown.");
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

        if (rec != null)
          this.deliveries.add(rec);
      }

      if (this.deliveries.isEmpty())
        throw new RejectException(553, "<" + recipient + "> address unknown.");
    }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

      }
    }

    byte[] decodedSecret = Base64.decode(secret);
    if (decodedSecret == null)
      throw new RejectException();

    int usernameStop = -1;
    for (int i = 1; i < decodedSecret.length && usernameStop < 0; i++)
    {
      if (decodedSecret[i] == 0)
      {
        usernameStop = i;
      }
    }

    String username = new String(decodedSecret, 1, usernameStop - 1);
    String password = new String(decodedSecret, usernameStop + 1,
        decodedSecret.length - usernameStop - 1);
    try
    {
      helper.login(username.toString(), password);
      resetState();
    }
    catch (LoginFailedException lfe)
    {
      resetState();
      throw new RejectException();
    }
   
    ctx.setCredential(new Credential(username));
    return true;
  }
View Full Code Here

Examples of org.subethamail.smtp.RejectException

    if (username == null)
    {
      byte[] decoded = Base64.decode(clientInput);
      if (decoded == null)
      {
        throw new RejectException();
      }
      this.username = new String(decoded);
      response.append("334 ").append(Base64.encodeToString("Password:".getBytes(), false));
      return false;
    }

    byte[] decoded = Base64.decode(clientInput);
    if (decoded == null)
    {
      throw new RejectException();
    }

    this.password = new String(decoded);
   
    try
    {
      helper.login(username, password);
      resetState();
    }
    catch (LoginFailedException lfe)
    {
      resetState();
      throw new RejectException();
    }
   
    ctx.setCredential(new Credential(username));
    return true;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.