SMTP Server Trigger
AI-generatedOverview
This node implements an SMTP server trigger that listens for incoming SMTP email connections on a specified host and port. It can optionally require SMTP authentication and supports parsing incoming emails to extract details such as subject, sender, recipients, body, attachments, and headers. This node is useful for workflows that need to react to incoming emails, such as automated email processing, ticketing systems, or notification triggers.
Use Case Examples
- Listening on port 2525 on all network interfaces to trigger workflows when an email is received.
- Enabling SMTP authentication to restrict access to authorized users only.
- Allowing insecure connections for testing or internal network use.
Properties
| Name | Meaning |
|---|---|
| Port | Port to listen on for SMTP connections, required to specify where the server binds. |
| Host | Host to bind the SMTP server to, defining the network interface to listen on. |
| Enable Authentication | Whether to enable SMTP authentication to restrict access. |
| Username | Username for SMTP authentication, required if authentication is enabled. |
| Password | Password for SMTP authentication, required if authentication is enabled. |
| Allow Insecure | Whether to allow insecure connections without TLS, useful for testing or internal networks. |
Output
JSON
subject- Subject line of the received email.to- Comma-separated list of recipients.from- Comma-separated list of senders.body- Plain text or HTML body content of the email.html- HTML content of the email body.text- Plain text content of the email body.date- Date the email was sent.messageId- Unique message identifier.attachments- Array of attachments with filename, content type, size, and content buffer.headers- Raw email headers.
Dependencies
- smtp-server package for SMTP server functionality
- mailparser package for parsing incoming email content
Troubleshooting
- If authentication is enabled but incorrect username or password is provided, the server will reject the connection with an 'Invalid username or password' error. Ensure credentials match the configured values.
- If the port is already in use, the server will fail to start. Choose a free port or stop the conflicting service.
- If emails fail to parse, check the email format and ensure the mailparser package is functioning correctly.
- Allowing insecure connections may expose the server to security risks; disable this option in production environments.
Links
- smtp-server npm package - Documentation for the SMTP server package used to create the SMTP server.
- mailparser npm package - Documentation for the mailparser package used to parse incoming email content.