Uploaded image for project: 'Commons Email'
  1. Commons Email
  2. EMAIL-57

[email] pop3 before smtp

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • Operating System: All
      Platform: Other

    • 29435

    Description

      daniel perry added a method, that allows
      pop3-Authorization

      i created a patch:

      Index: Email.java
      ===================================================================
      RCS file:
      /home/cvspublic/jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/Email.java,v
      retrieving revision 1.15
      diff -u -r1.15 Email.java
      — Email.java 19 Feb 2004 22:38:09 -0000 1.15
      +++ Email.java 8 Jun 2004 08:36:54 -0000
      @@ -26,6 +26,7 @@
      import javax.mail.Message;
      import javax.mail.MessagingException;
      import javax.mail.Session;
      +import javax.mail.Store;
      import javax.mail.Transport;
      import javax.mail.internet.InternetAddress;
      import javax.mail.internet.MimeMessage;
      @@ -131,7 +132,15 @@

      • Disposition-Notification-To: user@domain.net
        */
        private Hashtable headers = null;
        -
        +
        + /**
        + * Used to determine wether to use pop3 before smtp, and if so the settings.
        + */
        + private boolean popBeforeSmtp = false;
        + private String popHost = null;
        + private String popUsername = null;
        + private String popPassword = null;
        +
        /**
      • Setting to true will enable the display of debug information.
        *
        @@ -280,7 +289,7 @@
        public Email setFrom(String email)
        throws MessagingException { - return setFrom(email, null); + return setFrom(email, null); }

      /**
      @@ -629,7 +638,8 @@
      public void send()
      throws MessagingException
      {

      • Session session = getMailSession();
        +
        + Session session = getMailSession();
        MimeMessage message = new MimeMessage(session);

      if (subject != null)
      @@ -715,6 +725,11 @@

      { message.setSentDate(getSentDate()); }

      +
      + if (popBeforeSmtp)

      { + Store store = session.getStore("pop3"); + store.connect(popHost, popUsername, popPassword); + }

      Transport.send(message);
      }
      @@ -754,4 +769,19 @@

      return ia;
      }
      -}
      +
      + /**
      + * Set details regarding "pop3 before smtp" authentication
      + * @param popBeforeSmtp Wether or not to log into pop3 server before
      sending mail
      + * @param popHost The pop3 host to use.
      + * @param popUsername The pop3 username.
      + * @param popPassword The pop3 password.
      + */
      + public void setPopBeforeSmtp(boolean popBeforeSmtp, String popHost, String
      popUsername, String popPassword)

      { + this.popBeforeSmtp=popBeforeSmtp; + this.popHost=popHost; + this.popUsername=popUsername; + this.popPassword=popPassword; + }

      +
      +}
      \ No newline at end of file

      Attachments

        Activity

          People

            Unassigned Unassigned
            mailings@matthias-wessendorf.de Matthias Wessendorf
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: