mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
a57e4bdd20
Summary: This patch will prevent users from being able to connect accounts which sync mail but fail to send. This commit includes a couple pieces: * Adds a call to nodemailer's `verify()` function in the /auth endpoint * Adds Error object conversion for SMTP errors. Since we don't implement our own connection object or connection pool for SMTP, we simply wrap the couple places we call functions from nodemailer that connect to SMTP, namely SendmailClient's _send() and the new verify() call in /auth. * Moves RetryableError to the 'errors' module since it's now a base class for retryable IMAP //and// SMTP errors. * Moves the main `smtpConfig()` logic which used to live on the Account model into AuthHelpers so it can be shared between the Account model and the verify code. * Converts a few different places to use `import` syntax instead of `require` syntax for module imports. Apologies for not splitting this out into a separate diff—would have been a fair amount of work and looks not too difficult to skim over in the context of the rest of the patch. * Fixing a bug in a previous commit where erroring sends would crash because of using `this._transporter.options` instead of `this._transporter.transporter.options` Test Plan: manual Reviewers: evan, halla, juan Reviewed By: halla, juan Differential Revision: https://phab.nylas.com/D4200
28 lines
1.3 KiB
JavaScript
28 lines
1.3 KiB
JavaScript
/* eslint global-require: 0 */
|
|
module.exports = {
|
|
Provider: {
|
|
Gmail: 'gmail',
|
|
IMAP: 'imap',
|
|
},
|
|
Imap: require('imap'),
|
|
Errors: require('./src/errors'),
|
|
IMAPErrors: require('./src/imap-errors'),
|
|
SMTPErrors: require('./src/smtp-errors'),
|
|
loadModels: require('./src/load-models'),
|
|
AuthHelpers: require('./src/auth-helpers'),
|
|
PromiseUtils: require('./src/promise-utils'),
|
|
DatabaseTypes: require('./src/database-types'),
|
|
IMAPConnection: require('./src/imap-connection').default,
|
|
IMAPConnectionPool: require('./src/imap-connection-pool'),
|
|
SendmailClient: require('./src/sendmail-client'),
|
|
DeltaStreamBuilder: require('./src/delta-stream-builder'),
|
|
HookTransactionLog: require('./src/hook-transaction-log'),
|
|
HookIncrementVersionOnSave: require('./src/hook-increment-version-on-save'),
|
|
BackoffScheduler: require('./src/backoff-schedulers').BackoffScheduler,
|
|
ExponentialBackoffScheduler: require('./src/backoff-schedulers').ExponentialBackoffScheduler,
|
|
CommonProviderSettings: require('imap-provider-settings').CommonProviderSettings,
|
|
MetricsReporter: require('./src/metrics-reporter').default,
|
|
MessageFactory: require('./src/message-factory'),
|
|
SendUtils: require('./src/send-utils'),
|
|
executeJasmine: require('./spec/jasmine/execute').default,
|
|
}
|