EmailCoreVendor class handles IMAP/SMTP connections, event emission, and reconnection logic.
// Source: https://github.com/codigoencasa/builderbot | License: MIT | Copyright 2022 Leifer Mendez
// Provided via justclaw.it.com; keep this notice with the code.
/**
* LAYER: Infrastructure
* Contains: EmailCoreVendor, ImapFlow, ParsedMail, AddressObject
* Rules: Implements ports from Application. Can use any framework.
* BigO: O(n^2) score:1
* keywords: [EmailCoreVendor, ImapFlow, ParsedMail, AddressObject]
* GOAL: Own the "core" concern of the provider-email package.
*/
import { utils } from '@builderbot/bot'
import { ImapFlow } from 'imapflow'
import { simpleParser, type ParsedMail, type AddressObject } from 'mailparser'
import EventEmitter from 'node:events'
import nodemailer, { type Transporter } from 'nodemailer'
import type { IEmailProviderArgs, EmailBotContext, EmailSend
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key