Implemented desktop OAuth2 account setup for Google and Microsoft. The flow uses the system browser and PKCE; access and refresh tokens stay in the main process and encrypted account store. OAuth connections use fixed provider endpoints, and existing password-based accounts remain supported. Android remains password-based in this phase.
This commit is contained in:
@@ -7,7 +7,7 @@ function createMailSender({ smtpTransport, imapClient, findSentMailbox, createTr
|
||||
const to = String(message?.to || '').trim();
|
||||
if (!to) throw new Error('Add at least one recipient.');
|
||||
const attachments = normalizeOutgoingAttachments(message?.attachments);
|
||||
const transport = smtpTransport(account);
|
||||
const transport = await smtpTransport(account);
|
||||
const sentMessageId = String(message.messageId || `<${randomUUID()}@ep-mail.local>`);
|
||||
const fromName = String(account.displayName || message.displayName || account.email).replace(/[\r\n]+/g, ' ').trim().slice(0, 80) || account.email;
|
||||
const body = String(message?.text || '').slice(0, 500000);
|
||||
@@ -37,7 +37,7 @@ function createMailSender({ smtpTransport, imapClient, findSentMailbox, createTr
|
||||
const copy = createTransport({ streamTransport: true, buffer: true, newline: 'windows' });
|
||||
try {
|
||||
const rendered = rawMessage ? { message: rawMessage } : await copy.sendMail(messageOptions);
|
||||
const client = imapClient(account);
|
||||
const client = await imapClient(account);
|
||||
try {
|
||||
await client.connect();
|
||||
const sentPath = await findSentMailbox(client, true);
|
||||
|
||||
Reference in New Issue
Block a user