Examples of Mailbox


Examples of com.elasticinbox.core.model.Mailbox

  public void teardownCase() throws IOException {
    keyspace = null;
    cluster = null;

    AccountDAO accountDAO = dao.getAccountDAO();
    accountDAO.delete(new Mailbox(MAILBOX));
  }
View Full Code Here

Examples of com.elasticinbox.core.model.Mailbox

  }

  @Test
  public void testStaleMessageIdRemoval() throws IOException, OverQuotaException
  {
    Mailbox mailbox = new Mailbox(MAILBOX);

    Message message = getDummyMessage();
    message.addLabel(ReservedLabels.NOTIFICATIONS.getId());

    MessageDAO messageDAO = dao.getMessageDAO();
    List<UUID> validMessageIds = new ArrayList<UUID>();
    List<UUID> invalidMessageIds = new ArrayList<UUID>();

    // save message under different message ids, and store message ids
    for (int i=0; i<5; i++) {
      UUID messageId = new MessageIdBuilder().build();
      validMessageIds.add(messageId);
      messageDAO.put(mailbox, messageId, message, null);
    }
   
    // generate stale message ids
    for (int i=0; i<5; i++) {
      UUID messageId = new MessageIdBuilder().build();
      invalidMessageIds.add(messageId);
    }

    // add stale message ids to indexes only (without message metadata)
    Mutator<String> m = createMutator(keyspace, strSe);
    LabelIndexPersistence.add(m, mailbox.getId(), invalidMessageIds, message.getLabels());
    m.execute();

    // get all messages from NOTIFICATION label
    List<UUID> allMessageIds = messageDAO.getMessageIds(mailbox,
        ReservedLabels.NOTIFICATIONS.getId(), new MessageIdBuilder().build(), 100, true);
View Full Code Here

Examples of com.elasticinbox.core.model.Mailbox

      .getLogger(AllowAllAuthenticator.class);

  @Override
  public Mailbox authenticate(String username, String password)
  {
    Mailbox mailbox = new Mailbox(username);
    logger.debug("Authenticated " + mailbox.getId());
    return mailbox;
  }
View Full Code Here

Examples of com.ettrema.mail.Mailbox

        final AcceptEvent event = new AcceptEvent(sFrom, sRecipient);
        Filter terminal = new Filter() {

            public void doEvent(FilterChain chain, Event e) {
                MailboxAddress recip = MailboxAddress.parse(event.getRecipient());
                Mailbox recipMailbox = resourceFactory.getMailbox(recip);

                boolean b = (recipMailbox != null && !recipMailbox.isEmailDisabled());
                log.debug("accept email from: " + event.getFrom() + " to: " + event.getRecipient() + "?" + b);
                event.setAccept(b);
            }
        };
        FilterChain chain = new FilterChain(filters, terminal);
View Full Code Here

Examples of com.ettrema.mail.Mailbox

                MailboxAddress from = MailboxAddress.parse(event.getFrom());
                MailboxAddress recip = MailboxAddress.parse(event.getRecipient());

                MimeMessage mm = parseInput(data);

                Mailbox recipMailbox = resourceFactory.getMailbox(recip);
                log.debug("recipient is known to us, so store: " + recip);
                storeMail(recipMailbox,mm);

            }
        };
View Full Code Here

Examples of com.ettrema.mail.Mailbox

        final AcceptEvent event = new AcceptEvent(sFrom, sRecipient);
        Filter terminal = new Filter() {

            public void doEvent(FilterChain chain, Event e) {
                MailboxAddress from = MailboxAddress.parse(event.getFrom());
                Mailbox fromMailbox = resourceFactory.getMailbox(from);
                if (fromMailbox != null && !fromMailbox.isEmailDisabled() ) {
                    event.setAccept(true);
                    return ;
                }
                MailboxAddress recip = MailboxAddress.parse(event.getRecipient());
                Mailbox recipMailbox = resourceFactory.getMailbox(recip);

                boolean b = (recipMailbox != null && !recipMailbox.isEmailDisabled());
                log.debug("accept email from: " + event.getFrom() + " to: " + event.getRecipient() + "?" + b);
                event.setAccept(b);
            }
        };
        FilterChain chain = new FilterChain(filters, terminal);
View Full Code Here

Examples of com.ettrema.mail.Mailbox

                MailboxAddress from = MailboxAddress.parse(event.getFrom());
                MailboxAddress recip = MailboxAddress.parse(event.getRecipient());

                MimeMessage mm = parseInput(data);

                Mailbox recipMailbox = resourceFactory.getMailbox(recip);
                if (recipMailbox != null && !recipMailbox.isEmailDisabled()) {
                    log.debug("recipient is known to us, so store: " + recip);
                    storeMail(recipMailbox,mm);
                } else {
                    Mailbox fromMailbox = resourceFactory.getMailbox(from);
                    if (fromMailbox != null && !fromMailbox.isEmailDisabled() ) {
                        log.debug("known from address, so will transmit: from: " + from);
                        mailSender.sendMail(mm);
                    } else {
                        throw new NullPointerException("Neither from address nor recipient are known to us. Will not store or send: from: " + event.getFrom() + " to: " + event.getRecipient());
                    }
View Full Code Here

Examples of com.ettrema.mail.Mailbox

    }

    public boolean _doLogin(String username, String password) {
        try {
            MailboxAddress userName = MailboxAddress.parse(username);
            Mailbox mbox = resourceFactory.getMailbox(userName);
            if (mbox == null) {
                log.debug("user not found");
                return false;
            }
            if (!mbox.authenticate(password)) {
                log.debug("authentication failed");
                return false;
            }
            return true;
        } catch (IllegalArgumentException ex) {
View Full Code Here

Examples of etch.bindings.java.support.Mailbox

        final int X = 1000000000;
        final int Y = 2000000000;

        if (n-- > 0)
        {
          Mailbox mb1 = server._async._begin_add( X, Y );
          while (n-- > 0)
          {
            Mailbox mb2 = server._async._begin_add( X, Y );
            server._async._end_add( mb1 );
            mb1 = mb2;
          }
          server._async._end_add( mb1 );
        }
View Full Code Here

Examples of mireka.address.Mailbox

    public boolean isSatisfiedBy(Recipient recipient) {
        if (!(recipient instanceof RemotePartContainingRecipient))
            return false;
        if (!localPartSpecification.isSatisfiedBy(recipient.localPart()))
            return false;
        Mailbox mailbox =
                ((RemotePartContainingRecipient) recipient).getMailbox();
        return remotePartSpecification.isSatisfiedBy(mailbox.getRemotePart());
    }
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.