Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Other

      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

        Activity

        Matthias Wessendorf created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 29435 12341496
        Henri Yandell made changes -
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Component/s Email [ 12311114 ]
        Affects Version/s unspecified [ 12311647 ]
        Key COM-1344 EMAIL-57
        Project Commons [ 12310458 ] Commons Email [ 12310474 ]
        Siegfried Goeschl made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Matthias Wessendorf
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development