Add ANDROID_SECURITY_PLAN.md to project

This commit is contained in:
2026-11-03 07:16:33 +02:00
parent 640fca8a70
commit af224beda4
13 changed files with 631 additions and 26 deletions
+13 -3
View File
@@ -1,10 +1,17 @@
function createMailConnections({ ImapFlow, createTransport, oauthTokenManager }) {
function createMailConnections({ ImapFlow, createTransport, getImapFlow, getNodemailer, oauthTokenManager }) {
let ImapFlowModule = ImapFlow;
let nodemailerModule = createTransport ? { createTransport } : null;
async function imapClient(account, options = {}) {
if (!ImapFlowModule) {
const module = await getImapFlow();
ImapFlowModule = module.ImapFlow || module.default || module;
}
const isOAuth = account.authMethod === 'oauth2';
const auth = isOAuth
? { user: account.email, accessToken: await oauthTokenManager.getAccessToken(account) }
: { user: account.email, pass: account.password };
return new ImapFlow({
return new ImapFlowModule({
host: account.imapHost,
port: account.imapPort,
secure: Boolean(account.imapSecure),
@@ -20,6 +27,9 @@ function createMailConnections({ ImapFlow, createTransport, oauthTokenManager })
}
async function smtpTransport(account) {
if (!nodemailerModule) {
nodemailerModule = await getNodemailer();
}
const isOAuth = account.authMethod === 'oauth2';
const auth = isOAuth
? {
@@ -30,7 +40,7 @@ function createMailConnections({ ImapFlow, createTransport, oauthTokenManager })
}
: { user: account.email, pass: account.password };
const secure = Boolean(account.smtpSecure);
return createTransport({
return nodemailerModule.createTransport({
host: account.smtpHost,
port: account.smtpPort,
secure,