mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-05 04:04:38 +08:00
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 |
||
---|---|---|
.. | ||
images | ||
spec | ||
src | ||
stylesheets | ||
main.es6 | ||
package.json | ||
README.md |
Client Sync
This is the mail sync engine that runs within the Nylas Mail client
It is symlinked in as an internal_package
of Nylas Mail via the postinstall
script of the root repo.
Important Usage Notes:
Since this is symlinked in as an internal_package
of Nylas Mail, there are a
handulf of considerations when developing in client-sync. Some common gotchas:
- You MAY use
NylasEnv
,NylasExports
and other injected libraries in the Nylas Mail client environment. - You MAY use any 3rd party library declared in
client-app/package.json
. Since this gets added as a plugin of the Nylas Mail client, you'll have access to all libraries. This works because theclient-app/node_modules
was added to the global require paths. That lets us access client-app plugins without being a file directory decendent of client-app (client-sync is now a sibling of client-app) - You may NOT add "dependencies" to the
client-sync/package.json
. If you need a 3rd party library, add it to the mainclient-app/package.json
. All Nylas Mail plugins (those inside ofinternal_packages
), may no longer declare their own dependencies. - You should be aggressive at moving generic mail methods to
isomorphic-core
. We may eventually want to make large chunks of client-sync work in a cloud environment as well.