mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 11:01:23 +01:00
@@ -57,7 +57,7 @@ public class MessageHelper {
|
||||
private MimeMessage imessage;
|
||||
private String raw = null;
|
||||
|
||||
static Properties getSessionProperties() {
|
||||
static Properties getSessionProperties(int auth_type) {
|
||||
Properties props = new Properties();
|
||||
|
||||
// https://javaee.github.io/javamail/docs/api/com/sun/mail/imap/package-summary.html#properties
|
||||
@@ -97,6 +97,12 @@ public class MessageHelper {
|
||||
props.put("mail.mime.address.strict", "false");
|
||||
props.put("mail.mime.decodetext.strict", "false");
|
||||
|
||||
// https://javaee.github.io/javamail/OAuth2
|
||||
if (auth_type == Helper.AUTH_TYPE_GMAIL) {
|
||||
props.put("mail.imaps.auth.mechanisms", "XOAUTH2");
|
||||
props.put("mail.smtps.auth.mechanisms", "XOAUTH2");
|
||||
}
|
||||
|
||||
return props;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user