Package javax.mail

Examples of javax.mail.MessagingException


      }

      if (0==iStillExecutable) {
        try {
          if (oHndlr==null) {
            throw new MessagingException("Session lost. SessionHandler is null");
          } else if (oHndlr.getSession()==null) {
            throw new MessagingException("Session lost. SessionHandler.getSession() is null");
          } else {
            oStor = new DBStore(oHndlr.getSession(), new URLName("jdbc://", sProfile, -1, sMBoxDir, oUser.getString(DB.gu_user), oUser.getStringNull(DB.tx_pwd,"")));
            oStor.connect(sProfile, oUser.getString(DB.gu_user), oUser.getStringNull(DB.tx_pwd,""));
            oSent = (DBFolder) oStor.getFolder("sent");
            oSent.open(Folder.READ_WRITE);
View Full Code Here


        DebugFile.writeStackTrace(e);
        DebugFile.write("\n");
        DebugFile.decIdent();
        DebugFile.writeln("End MimeSender.process("+oAtm.getString(DB.gu_job)+":"+String.valueOf(oAtm.getInt(DB.pg_atom))+") : abnormal process termination");
      }
      throw new MessagingException(e.getMessage(),e);
    } finally {
      // Decrement de count of atoms pending of processing at this job
      if (DebugFile.trace) DebugFile.writeln("decrementing pending atoms to "+String.valueOf(iPendingAtoms-1));
      if (0==--iPendingAtoms) {
        free();
View Full Code Here

   * return boolean true: handling was successful, exception can be ignored;
   * false: handling was not successful, refuse to proceed.
   */
  private boolean handleSendFailedException(SendFailedException e) {
    //get wrapped excpetion
    MessagingException me = (MessagingException) e.getNextException();
    if (me instanceof AuthenticationFailedException) {
      // catch this one separately, this kind of exception has no message
      // as the other below
      StringBuilder infoMessage = new StringBuilder();
      infoMessage.append(translate("error.msg.send.nok"));
      infoMessage.append("<br />");
      infoMessage.append(translate("error.msg.smtp.authentication.failed"));
      this.getWindowControl().setInfo(infoMessage.toString());     
      log.warn("Mail message could not be sent: ", e);
      // message could not be sent, however let user proceed with his action
      return true;
    }   
    String message = me.getMessage();
    if (message.startsWith("553")) {
      //javax.mail.MessagingException: 553 5.5.4 <invalid>... Domain name
      // required for sender address invalid@id.unizh.ch
      //javax.mail.MessagingException: 553 5.1.8 <invalid@invalid.>...
      // Domain of sender address invalid@invalid does not exist
View Full Code Here

      try {
        moveMessage(targetFolder);
      } catch (OperationCancelledException oce) {

      } catch (MessagingException me) {
        final MessagingException fme = me;
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
              showError(Pooka.getProperty("error.Message.CopyErrorMessage", "Error:  could not copy messages to folder:  ") + targetFolder.toString() +"\n", fme);
            }
          });
View Full Code Here

      try {
        copyMessage(targetFolder);
      } catch (OperationCancelledException oce) {

      } catch (MessagingException me) {
        final MessagingException fme = me;
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
              showError( Pooka.getProperty("error.Message.CopyErrorMessage", "Error:  could not copy messages to folder:  ") + targetFolder.toString() +"\n", fme);
            }
          });
View Full Code Here

          }
        });
    } catch (OperationCancelledException oce) {
      // if we cancelled out, ignore.
    } catch (MessagingException me) {
      final MessagingException newMe = me;
      SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            Pooka.getUIFactory().showError(Pooka.getProperty("error.Folder.openFailed", "Failed to open folder") + " " + getFolderInfo().getFolderID(), newMe);
          }
        });
View Full Code Here

            getMessageInfo().bounceMessage(final_addresses);
            if (final_delete)
              deleteMessage(final_expunge);

          } catch (javax.mail.MessagingException me) {
            final MessagingException final_me = me;
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                  showError(Pooka.getProperty("error.bounceMessage.error", "Error bouncing Message"), final_me);
                }
              });
View Full Code Here

                }
              }
            };
          folderThread.addToQueue(runMe, new java.awt.event.ActionEvent(this, 0, "saveDraft"));
        } else {
          saveDraftFailed(new MessagingException ("No outbox specified for default mailserver " + mailServer.getItemID()));
        }
      } else {
        sendLock = false;
      }
    } catch (MessagingException me) {
View Full Code Here

  public boolean updateRecipientInfos(UserProfile profile, InternetHeaders headers) throws javax.mail.internet.AddressException, javax.mail.MessagingException {
    // just use the defaults for now.

    String toHeader = headers.getHeader("To", ",");
    if (toHeader == null) {
      throw new MessagingException(Pooka.getProperty("error.NewMessage.noTo", "No To: recipient"));
    }
    InternetAddress[] toAddresses = InternetAddress.parse(headers.getHeader("To", ","), false);
    if (toAddresses == null || toAddresses.length == 0) {
      throw new MessagingException(Pooka.getProperty("error.NewMessage.noTo", "No To: recipient"));
    }

    String ccHeaderLine = headers.getHeader("CC", ",");
    InternetAddress[] ccAddresses;
    if (ccHeaderLine != null && ccHeaderLine.length() > 0) {
View Full Code Here

  /**
   * Shows a load error for this PopupMenu.
   */
  public void showLoadError(MessagingException me) {
    final MessagingException fme = me;
    Runnable runMe = new Runnable() {
  public void run() {
    setLabel(Pooka.getProperty("AttachmentPopupMenu.errorloading.title", "Error loading attachments"));
    fme.printStackTrace();
  }
      };

    if (SwingUtilities.isEventDispatchThread())
      runMe.run();
View Full Code Here

TOP

Related Classes of javax.mail.MessagingException

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.