Add multi-account OAuth, Obsidian integration, product assets, and test tooling
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
32
test-gmail-imap.mjs
Normal file
32
test-gmail-imap.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import { ImapFlow } from 'imapflow';
|
||||
|
||||
const client = new ImapFlow({
|
||||
host: 'imap.gmail.com',
|
||||
port: 993,
|
||||
secure: true,
|
||||
auth: {
|
||||
user: process.env.GMAIL_EMAIL || 'garfield.heron@gmail.com',
|
||||
pass: process.env.GMAIL_APP_PASSWORD || 'ldmk duee movy hruy',
|
||||
},
|
||||
logger: false,
|
||||
});
|
||||
|
||||
try {
|
||||
console.log('Connecting to Gmail IMAP...');
|
||||
await client.connect();
|
||||
console.log('Connected!');
|
||||
|
||||
const mailbox = await client.mailboxOpen('INBOX');
|
||||
console.log('Mailbox opened:', mailbox.path, 'messages:', mailbox.exists);
|
||||
|
||||
const criteria = { or: [{ subject: 'test' }, { from: 'test' }] };
|
||||
const uids = await client.search(criteria, { uid: true });
|
||||
console.log('Search results:', uids);
|
||||
|
||||
await client.logout();
|
||||
console.log('Done');
|
||||
} catch (err) {
|
||||
console.error('ERROR:', err.message);
|
||||
console.error(err.stack);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user