Overview
This node implements an SMTP server trigger that listens for incoming SMTP email messages on a specified host and port. When an email is received, it parses the message and triggers the workflow with the email data. This node is useful for scenarios where you want to automate processing of inbound emails without relying on external email services or polling. For example, you could use it to automatically process support requests sent via email, log incoming emails into a database, or trigger notifications based on email content.
Properties
| Name | Meaning |
|---|---|
| Port | Port number on which the SMTP server listens for incoming connections (default: 2525). |
| Host | Network interface address to bind the SMTP server to (default: "0.0.0.0" for all). |
| Enable Authentication | Whether SMTP authentication is required before accepting emails (true/false). |
| Username | Username for SMTP authentication (only used if authentication is enabled). |
| Password | Password for SMTP authentication (only used if authentication is enabled). |
| Allow Insecure | Whether to allow insecure connections without TLS (true/false). |
Output
The node outputs a JSON object representing the parsed email with the following structure:
subject: Email subject line.to: Comma-separated string of recipient addresses.from: Comma-separated string of sender addresses.body: Plain text or HTML body content.html: HTML body content if available.text: Plain text body content if available.date: Date the email was sent.messageId: Unique message identifier.attachments: Array of attachment metadata objects, each containing:filename: Name of the attached file.contentType: MIME type of the attachment.size: Size in bytes.
headers: Raw email headers as parsed.raw: The full raw email source as a string.
If the email contains attachments, they are represented only by metadata; the actual binary content is not output by this node.
Dependencies
- Requires no external API keys or credentials beyond optional SMTP authentication parameters.
- Runs an embedded SMTP server internally.
- No additional environment variables or n8n configurations are needed.
Troubleshooting
Common issues:
- Port conflicts: Ensure the configured port is free and accessible.
- Firewall/network restrictions may block incoming SMTP connections.
- If authentication is enabled, incorrect username or password will reject emails.
- Parsing errors may occur if the incoming email format is malformed.
Error messages:
"Invalid username or password": Check SMTP authentication credentials."Stream error": Indicates network or connection issues during email reception."Error parsing email": The email content could not be parsed properly; verify email format.
To resolve these, verify network settings, credentials, and ensure the sending client complies with SMTP standards.
Links and References
- SMTP Protocol Overview
- Email Message Format (RFC 5322)
- Node.js SMTP Server Libraries (for background on embedded SMTP servers)