fix(imap client): harden IMAP client message processing and modernize test tooling

This commit is contained in:
2026-05-01 16:59:04 +00:00
parent 98263058bf
commit 13ca27db86
12 changed files with 4285 additions and 6059 deletions
+28
View File
@@ -0,0 +1,28 @@
import { tap } from '@git.zone/tstest/tapbundle';
import { ImapServer } from '../ts/classes.imapserver.js';
tap.test('imapserver', async () => {
// Example usage
const imapServer = new ImapServer();
imapServer.addUser('testuser', 'password');
imapServer.createInbox('testuser', 'INBOX');
imapServer.createInbox('testuser', 'Sent');
// Add a sample message
const testUser = imapServer.users.get('testuser')!;
const inbox = testUser.inboxes.get('INBOX')!;
inbox.messages.push({
id: '1',
subject: 'Welcome',
sender: 'no-reply@example.com',
recipient: 'testuser@example.com',
date: new Date(),
body: 'Welcome to your new IMAP inbox!',
});
// Start the server on port 143 (commonly used for IMAP)
// imapServer.start(143);
});
export default tap.start();