Actions9
Overview
This node connects to an IMAP email server to perform various email management operations, including searching emails within specified folders. The "Search Emails" operation allows users to find emails based on simple or advanced search criteria such as sender, recipient, subject, body content, read status, date ranges, size, and attachment presence.
Common scenarios where this node is beneficial include:
- Automating email processing workflows by filtering relevant emails.
- Extracting specific emails for further analysis or archiving.
- Monitoring inboxes for unread or recent emails matching certain keywords.
- Integrating email data into other systems or notifications.
For example, a user can configure the node to search the "INBOX" folder for all unread emails received today that contain the word "Invoice" in the subject, then process those emails automatically.
Properties
| Name | Meaning |
|---|---|
| Folder | The email folder (mailbox) to work with. Can be selected from a list of available folders or specified by name (e.g., "INBOX"). |
| Limit | Maximum number of emails to return from the search. |
| Search Mode | Choose between "Simple Search" (quick search with basic filters) and "Advanced Search" (combine multiple detailed search criteria). |
| Quick Filter | Pre-defined quick filters for simple search mode: All Emails, Unread Emails, Read Emails, Today's Emails, This Week's Emails. |
| Search Text (Optional) | Text to search for in emails' subject, sender, or body (used in simple search mode). |
| Search Criteria | In advanced search mode, combine multiple criteria: |
| - From (Sender) | Search emails from a specific sender by email address or name. |
| - To (Recipient) | Search emails sent to a specific recipient. |
| - Subject Contains | Text that must appear in the email subject. |
| - Body Contains | Text that must appear in the email body. |
| - Read Status | Filter by read status: Any (read + unread), Unread Only, or Read Only. |
| - Date Range | Filter emails by a custom date range (start and end dates). |
| - Quick Date Filter | Quick presets for date filtering overriding custom date range: None, Last Hour, Today, Yesterday, This Week, Last Week, This Month, Last Month. |
| - Email Size | Filter emails by size with conditions: Larger than or Smaller than a specified size in kilobytes. |
| - Has Attachments | Filter by attachment presence: Any, With Attachments only, or Without Attachments only. |
Output
The node outputs an array of items, each containing a json object representing an individual email matching the search criteria. Each email object typically includes metadata such as sender, recipients, subject, date, flags (read/unread), size, and possibly snippet or body preview depending on the implementation of the underlying IMAP library.
If the node supports binary data output (not explicitly shown here), it would represent attachments or full email content in binary form.
Dependencies
- Requires connection credentials to an IMAP server: host, port, security settings, username, and password.
- Uses the
imapflowlibrary to interact with the IMAP server. - Requires proper network access to the IMAP server.
- No additional environment variables are indicated beyond standard credential configuration.
Troubleshooting
- Connection Issues: Errors connecting to the IMAP server may occur due to incorrect host, port, or authentication details. Verify credentials and network accessibility.
- Timeouts: The node sets timeouts for socket and connection; slow servers or network issues might cause timeout errors.
- Search Errors: Invalid search criteria or unsupported filters could cause errors. Ensure filter values conform to expected formats.
- Logout Failures: The node attempts graceful logout but will force close connections if logout times out. This usually does not affect functionality but indicates server responsiveness issues.
- Limit Exceeded: Setting very high limits may impact performance or cause server-side restrictions.
To resolve common errors:
- Double-check IMAP credentials and server settings.
- Use simpler search criteria to isolate problematic filters.
- Monitor logs for detailed error messages.
- Adjust timeout settings if necessary (not exposed in UI).
Links and References
- IMAP Protocol Overview
- imapflow GitHub Repository
- n8n Documentation on Email Nodes (for general concepts similar to this node)