Skip to content

Commit b391d50

Browse files
committed
Support Azure POP3 OAUTH Login in two lines
1 parent 94427f9 commit b391d50

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

gxmail/src/main/java/com/genexus/internet/POP3SessionJavaMail.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,12 @@ public void login(GXPOP3Session sessionInfo)
9494
props.setProperty("mail.pop3.connectiontimeout", String.valueOf(timeout));
9595
props.setProperty("mail.pop3.timeout", String.valueOf(timeout));
9696

97-
if (sessionInfo.getAuthenticationMethod().length() > 0) {
98-
props.setProperty("mail.pop3.auth.mechanisms", sessionInfo.getAuthenticationMethod().toUpperCase());
97+
String authMethod = sessionInfo.getAuthenticationMethod();
98+
if (!authMethod.isEmpty()) {
99+
props.setProperty("mail.pop3.auth.mechanisms", authMethod.toUpperCase());
100+
if (authMethod.equalsIgnoreCase("XOAUTH2") && pop3Host.equalsIgnoreCase("outlook.office365.com")) {
101+
props.setProperty("mail.pop3.auth.xoauth2.two.line.authentication.format", "true");
102+
}
99103
}
100104

101105
props.setProperty("mail.pop3.ssl.enable", String.valueOf(secureConnection));

0 commit comments

Comments
 (0)