@bernierllc/inbound-email-parse
v1.0.1
Published
Inbound email receiving, parsing, and routing service with webhook endpoints for all major providers and rule-based routing to downstream systems
Readme
@bernierllc/inbound-email-parse
Inbound email receiving, parsing, and routing service that provides webhook endpoints for all major email providers, MIME parsing with attachment handling, and rule-based routing to downstream systems.
Installation
npm install @bernierllc/inbound-email-parseUsage
import { InboundEmailParser } from '@bernierllc/inbound-email-parse';
const parser = new InboundEmailParser({
providers: [
{
provider: 'sendgrid',
enabled: true,
signingSecret: process.env.SENDGRID_SIGNING_SECRET
}
],
defaultRoutingRules: [
{
id: 'route-to-support',
name: 'Route support emails',
priority: 100,
enabled: true,
conditions: [
{ type: 'to', field: 'address', operator: 'contains', value: 'support@' }
],
actions: [
{
type: 'route',
destination: {
type: 'neverhub',
config: { eventType: 'support.email.received' }
}
}
]
}
]
});
await parser.initialize();
// Process inbound email from webhook
const result = await parser.processInbound('sendgrid', webhookPayload, signature);
if (result.success) {
console.log(`Processed email: ${result.emailId}`);
console.log(`Routed to ${result.routed.length} destinations`);
}Features
- Multi-Provider Support: SendGrid, Postmark, Mailgun, AWS SES, and generic MIME
- Webhook Signature Validation: Secure webhook receiving with signature verification
- MIME Parsing: Full email parsing including headers, body, and attachments
- Attachment Processing: Handle attachments with size limits, type validation, and checksums
- Rule-Based Routing: Flexible routing engine with conditions and actions
- Multi-Destination: Route single email to multiple systems simultaneously
- NeverHub Integration: Publish events and subscribe to routing updates
- Cross-Suite Compatibility: Used by Email Suite, Chat Suite, Content Management Suite, and Task Suite
API Reference
[Complete API documentation will be generated with TypeDoc]
Configuration
See Configuration Guide for detailed configuration options.
Integration Status
- Logger: integrated - Comprehensive logging for all operations
- Docs-Suite: ready - TypeDoc format
- NeverHub: required - Event publishing and service discovery
License
Copyright (c) 2025 Bernier LLC. All rights reserved.
