mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 08:16:09 +08:00
[isomorphic-core] fix sending on Office 365
Summary: Fixed sending on Office 365 nodemailer needed a special tls flag beyond the standard SSL. See: http://stackoverflow.com/questions/29812132/error-sending-email-using-nodemailer-via-office365-smtp-meanjs-scaffold Test Plan: manual Reviewers: juan, jackie, halla Reviewed By: halla Differential Revision: https://phab.nylas.com/D3541
This commit is contained in:
parent
6bbceda709
commit
5015d105b8
|
@ -65,15 +65,19 @@ function credentialsForProvider({provider, settings, email}) {
|
||||||
const connectionSettings = {
|
const connectionSettings = {
|
||||||
imap_host: 'outlook.office365.com',
|
imap_host: 'outlook.office365.com',
|
||||||
imap_port: 993,
|
imap_port: 993,
|
||||||
smtp_host: 'smtp.office365.com',
|
|
||||||
smtp_port: 465,
|
|
||||||
ssl_required: true,
|
ssl_required: true,
|
||||||
|
smtp_custom_config: {
|
||||||
|
host: 'smtp.office365.com',
|
||||||
|
port: 587,
|
||||||
|
secure: false,
|
||||||
|
tls: {ciphers: 'SSLv3'},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
const connectionCredentials = {
|
const connectionCredentials = {
|
||||||
imap_username: email,
|
imap_username: email,
|
||||||
imap_password: settings.password,
|
imap_password: settings.password,
|
||||||
smtp_username: email,
|
smtp_username: email,
|
||||||
smpt_password: settings.password,
|
smtp_password: settings.password,
|
||||||
}
|
}
|
||||||
return {connectionSettings, connectionCredentials}
|
return {connectionSettings, connectionCredentials}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,12 +116,16 @@ module.exports = (sequelize, Sequelize) => {
|
||||||
|
|
||||||
smtpConfig() {
|
smtpConfig() {
|
||||||
const {smtp_host, smtp_port, ssl_required} = this.connectionSettings;
|
const {smtp_host, smtp_port, ssl_required} = this.connectionSettings;
|
||||||
const config = {
|
let config = {}
|
||||||
host: smtp_host,
|
if (this.connectionSettings.smtp_custom_config) {
|
||||||
port: smtp_port,
|
config = this.connectionSettings.smtp_custom_config
|
||||||
secure: ssl_required,
|
} else {
|
||||||
|
config = {
|
||||||
|
host: smtp_host,
|
||||||
|
port: smtp_port,
|
||||||
|
secure: ssl_required,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.provider === "imap" || this.provider === "office365") {
|
if (this.provider === "imap" || this.provider === "office365") {
|
||||||
const {smtp_username, smtp_password} = this.decryptedCredentials();
|
const {smtp_username, smtp_password} = this.decryptedCredentials();
|
||||||
config.auth = { user: smtp_username, pass: smtp_password}
|
config.auth = { user: smtp_username, pass: smtp_password}
|
||||||
|
|
Loading…
Reference in a new issue