Skip to content

Commit

Permalink
#461: XOAUTH2 - rename property and document it
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Jan 18, 2021
1 parent ca3bb5c commit b52c3dd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions doc/release/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The following bugs have been fixed in the 2.0.1 release.

E 403 Android SocketChannel workaround not working around
E 456 MimeMessage.setFrom(null) fails instead of removing the header
E 461 OAuth2 POP3 Support for Microsoft
E 473 Several modules are not included in build when JDK11 is used
E 493 javamail.providers file missing from provider jars after 1.6.5

Expand Down
4 changes: 2 additions & 2 deletions mail/src/main/java/com/sun/mail/pop3/Protocol.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -700,7 +700,7 @@ String getInitialResponse(String host, String authzid, String user,
protected void runAuthenticationCommand(String command, String ir) throws IOException {
Boolean isTwoLineAuthenticationFormat = getBoolProp(
props,
prefix + ".xoauth.two.line.authentication.format");
prefix + ".auth.xoauth2.two.line.authentication.format");

if (isTwoLineAuthenticationFormat) {
if (logger.isLoggable(Level.FINE)) {
Expand Down
9 changes: 8 additions & 1 deletion mail/src/main/java/com/sun/mail/pop3/package.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--
Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -390,6 +390,13 @@
property to "XOAUTH2".</TD>
</TR>

<TR>
<TD><A ID="mail.pop3.auth.xoauth2.two.line.authentication.format">mail.pop3.auth.xoauth2.two.line.authentication.format</A></TD>
<TD>boolean</TD>
<TD>If true, splits authentication command on two lines.
Default is false.</TD>
</TR>

<TR>
<TD><A ID="mail.pop3.socketFactory">mail.pop3.socketFactory</A></TD>
<TD>SocketFactory</TD>
Expand Down
2 changes: 1 addition & 1 deletion mail/src/test/java/com/sun/mail/pop3/POP3Handler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down
8 changes: 4 additions & 4 deletions mail/src/test/java/com/sun/mail/pop3/POP3StoreTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void testXOAUTH2POP3Connection() {
/**
* Check whether POP3 XOAUTH2 connection can be established using single line authentication format
* when the authentication format has ben set
* using: mail.pop3.xoauth.two.line.authentication.format property
* using: mail.pop3.auth.xoauth2.two.line.authentication.format property
*/
@Test
public void testXOAUTH2POP3ConnectionWithSingleLineAuthenticationFlag() {
Expand All @@ -171,7 +171,7 @@ public void testXOAUTH2POP3ConnectionWithSingleLineAuthenticationFlag() {
properties.setProperty("mail.pop3.port", "" + server.getPort());
properties.setProperty("mail.pop3.auth.mechanisms", "XOAUTH2");
properties.setProperty("mail.pop3.disablecapa", "false");
properties.setProperty("mail.pop3.xoauth.two.line.authentication.format", "false");
properties.setProperty("mail.pop3.auth.xoauth2.two.line.authentication.format", "false");

final Session session = Session.getInstance(properties);

Expand All @@ -197,7 +197,7 @@ public void testXOAUTH2POP3ConnectionWithSingleLineAuthenticationFlag() {

/**
* Check whether POP3 XOAUTH2 authentication method is invoked using two line authentication format
* using: mail.pop3.xoauth.two.line.authentication.format property
* using: mail.pop3.auth.xoauth2.two.line.authentication.format property
*/
@Test
public void testXOAUTH2POP3ConnectionWithTwoLineAuthenticationFlag() {
Expand All @@ -213,7 +213,7 @@ public void testXOAUTH2POP3ConnectionWithTwoLineAuthenticationFlag() {
properties.setProperty("mail.pop3.port", "" + server.getPort());
properties.setProperty("mail.pop3.auth.mechanisms", "XOAUTH2");
properties.setProperty("mail.pop3.disablecapa", "false");
properties.setProperty("mail.pop3.xoauth.two.line.authentication.format", "true");
properties.setProperty("mail.pop3.auth.xoauth2.two.line.authentication.format", "true");

final Session session = Session.getInstance(properties);

Expand Down

0 comments on commit b52c3dd

Please sign in to comment.