Package com.cubusmail.server.mail

Examples of com.cubusmail.server.mail.IMailbox


   * com.cubusmail.gwtui.client.services.IMailboxService#deleteFolder(java
   * .lang.String)
   */
  public void deleteFolder( String folderId ) throws Exception {

    IMailbox mailbox = SessionManager.get().getMailbox();
    log.debug( "deleting folder " + folderId );

    try {
      mailbox.deleteFolder( folderId );
      log.debug( "...successful" );
    }
    catch (MailFolderException e) {
      log.error( e.getMessage(), e );
      throw new GWTMailFolderException( null, e.getFolder().getName() );
View Full Code Here


      // start authentication
      // TODO: very dirty, must be replaced by Spring Security stuff
      ApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext( SessionManager
          .getRequest().getSession().getServletContext() );
      MailboxFactory factory = context.getBean( MailboxFactory.class );
      IMailbox mailbox = factory.createMailbox( IMailbox.TYPE_IMAP );
      mailbox.init( username, new String( password ) );

      log.debug( "Start login..." );
      mailbox.login();
      log.debug( "Login successful" );

      this.mailboxPrincipal = new MailboxPrincipal( username, mailbox );
      this.succeeded = true;
    }
View Full Code Here

      String messageId = request.getParameter( "messageId" );
      String attachmentIndex = request.getParameter( "attachmentIndex" );
      boolean view = "1".equals( request.getParameter( "view" ) );

      if ( messageId != null ) {
        IMailbox mailbox = SessionManager.get().getMailbox();
        Message msg = mailbox.getCurrentFolder().getMessageById( Long.parseLong( messageId ) );

        List<MimePart> attachmentList = MessageUtils.attachmentsFromPart( msg );
        int index = Integer.valueOf( attachmentIndex );

        MimePart retrievePart = attachmentList.get( index );
View Full Code Here

      context.login();

      // if no exception thrown, login was successful
      SessionManager.createSession( context.getSubject() );

      IMailbox mailbox = SessionManager.get().getMailbox();

      UserAccount account = this.userAccountDao.getUserAccountByUsername( username );
      // create useraccount
      if ( account == null ) {
        account = createUserAccount( mailbox );
        if ( getThreadLocalRequest().getLocale() != null ) {
          String lang = getThreadLocalRequest().getLocale().getLanguage();
          account.getPreferences().setLanguage( lang );
        }
      }
      else {
        if ( account.getIdentities() == null || account.getIdentities().size() == 0 ) {
          account.addIdentity( createDefaultIdentity( mailbox ) );
        }
        account.setLastLogin( new Date() );
        this.userAccountDao.saveUserAccount( account );
      }
     
      mailbox.setUserAccount( account );
      GWTMailbox gwtMailbox = ConvertUtil.convert( mailbox );

      return gwtMailbox;
    }
    catch (LoginException e) {
View Full Code Here

   * @see com.cubusmail.gwtui.client.services.ICubusService#retrieveMailbox()
   */
  public GWTMailbox retrieveMailbox() {

    if ( SessionManager.get() != null && SessionManager.get().getMailbox() != null ) {
      IMailbox mailbox = SessionManager.get().getMailbox();
      return ConvertUtil.convert( mailbox );
    }
    else {
      return null;
    }
View Full Code Here

TOP

Related Classes of com.cubusmail.server.mail.IMailbox

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.