Skip to content

Commit b87173c

Browse files
authored
Implements AuthenticationMethod property en Pop3Session DataType (#541)
Issue: 95155
1 parent 0e0cd79 commit b87173c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class GXPOP3Session implements GXInternetConstants
1010
private String userName;
1111
private String password;
1212
private short timeout;
13+
private String authenticationProtocol;
1314

1415
private String attachDir;
1516
private short newMessages ;
@@ -40,6 +41,7 @@ public GXPOP3Session()
4041
setUserName("");
4142
setPassword("");
4243
setTimeout(30);
44+
setAuthenticationMethod("");
4345

4446
errDescription = "";
4547
}
@@ -84,6 +86,16 @@ public String getPassword()
8486
return password;
8587
}
8688

89+
public void setAuthenticationMethod(String authenticationProtocol)
90+
{
91+
this.authenticationProtocol = authenticationProtocol;
92+
}
93+
94+
public String getAuthenticationMethod()
95+
{
96+
return this.authenticationProtocol;
97+
}
98+
8799
public void setSecure(short secure)
88100
{
89101
this.secure = secure;

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ public void login(GXPOP3Session sessionInfo)
9292
props.setProperty("mail.pop3.host", pop3Host);
9393
props.setProperty("mail.pop3.port", String.valueOf(pop3Port));
9494
props.setProperty("mail.pop3.connectiontimeout", String.valueOf(timeout));
95-
props.setProperty("mail.pop3.timeout", String.valueOf(timeout));
95+
props.setProperty("mail.pop3.timeout", String.valueOf(timeout));
96+
97+
if (sessionInfo.getAuthenticationMethod().length() > 0) {
98+
props.setProperty("mail.pop3.auth.mechanisms", sessionInfo.getAuthenticationMethod().toUpperCase());
99+
}
100+
96101
props.setProperty("mail.pop3.ssl.enable", String.valueOf(secureConnection));
97102

98103
session = Session.getInstance(props);

0 commit comments

Comments
 (0)