Commons Email
  1. Commons Email
  2. EMAIL-49

[Email] Compatability With JavaMail 1.2


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

      Operating System: other
      Platform: Other


      The InternetAddress.validate() method is the only version 1.3 feature of
      JavaMail used in commons-email. Removing its use means that commons-email will
      compile (and tests run) against JavaMail 1.2

      This ticket is as a result of this thread on the user list:

      However some of the assertions I made there were incorrect.

      JavaMail 1.3 introduced the facility to specify a strict=false setting when
      parsing an InternetAddress and a new validate() method to check whether
      a "loosley parsed" InternetAddress was valid.

      I made a mistake in that thread. The Email class uses the following

      InternetAdress(String address, String personal)
      InternetAdress(String address, String personal, String charset)

      These constructors assume the "address" is a valid RFC822 internet address and
      don't "validate" them. Therefore Email as its currently coded is correct to
      then call the validate() method.

      However the following constructor does validate...

      InternetAdress(String address)

      ... and I'm attaching a patch which removes the need to use the validate()

      However its not quite that simple. Since the validate() method in JavaMail 1.3
      isn't "as strict" as the above constructor - which is compatible with JavaMail
      1.2 - it doesn't validate addresses which contain quotes or '[' at all.
      Therefore applying the patch will make it 1.2 compatible, but also make the
      validation stricter.


        Siegfried Goeschl made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311788 ]
        Henri Yandell made changes -
        Project Commons [ 12310458 ] Commons Email [ 12310474 ]
        Assignee Jakarta Commons Developers Mailing List [ ]
        Affects Version/s Nightly Builds [ 12311648 ]
        Key COM-2387 EMAIL-49
        Component/s Email [ 12311114 ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 36536 12342539
        Niall Pemberton created issue -


          • Assignee:
            Niall Pemberton
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: