npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-email-monitor

v0.2.0

Published

n8n node for monitoring email inbox with IMAP trigger

Readme

n8n Email Monitor Trigger Node

这是一个n8n社区节点,让你可以在n8n工作流中监控邮箱系统并触发自动化流程。

该节点支持通过IMAP协议连接到各种邮箱服务器,实时监控新邮件并触发工作流。

n8n 是一个公平代码许可的工作流自动化平台。

功能特性

  • 实时邮件监控 - 定期检查新邮件并触发工作流
  • IMAP协议支持 - 兼容Gmail、Outlook、QQ邮箱等主流邮箱服务
  • 灵活过滤条件 - 支持按发件人、主题等条件过滤邮件
  • 邮件解析 - 自动解析邮件头、正文、附件信息
  • 标记已读 - 可选择是否将处理过的邮件标记为已读

安装

按照n8n社区节点安装指南进行安装。

npm install n8n-nodes-email-monitor

配置说明

邮箱凭据配置

需要配置以下邮箱连接信息:

  • Host: IMAP服务器地址 (如: imap.gmail.com)
  • Port: IMAP端口 (通常为993)
  • Username: 邮箱地址
  • Password: 邮箱密码或应用专用密码
  • Use SSL: 是否使用SSL加密 (推荐开启)
  • Mailbox: 要监控的邮箱文件夹 (默认: INBOX)

常见邮箱服务器配置

| 邮箱服务 | IMAP服务器 | 端口 | SSL | |---------|-----------|------|-----| | Gmail | imap.gmail.com | 993 | ✅ | | Outlook/Hotmail | outlook.office365.com | 993 | ✅ | | QQ邮箱 | imap.qq.com | 993 | ✅ | | 163邮箱 | imap.163.com | 993 | ✅ |

触发器参数

  • Poll Interval: 检查邮件的间隔时间(秒)
  • Filter Options: 邮件过滤选项
    • From Email: 按发件人过滤
    • Subject Contains: 按主题关键词过滤 (支持中文和其他Unicode字符)
    • Mark as Read: 是否标记已处理邮件为已读
    • Only Unread: 是否只处理未读邮件

使用示例

基础邮件监控

  1. 添加"Email Monitor Trigger"节点
  2. 配置邮箱凭据
  3. 设置检查间隔(如60秒)
  4. 连接后续处理节点

过滤特定邮件

  • 监控来自特定发件人的邮件
  • 监控包含特定关键词的邮件主题 (支持中文,如"重要通知"、"账单"等)
  • 只处理未读邮件

中文主题过滤示例

  • 过滤包含"重要通知"的邮件
  • 过滤包含"账单"的邮件
  • 过滤包含"验证码"的邮件

输出数据结构

节点输出的邮件数据包含:

{
  "uid": "邮件唯一标识",
  "subject": "邮件主题",
  "from": "发件人地址",
  "to": "收件人地址",
  "date": "邮件日期",
  "text": "纯文本内容",
  "html": "HTML内容",
  "attachments": [
    {
      "filename": "附件文件名",
      "contentType": "文件类型",
      "size": "文件大小"
    }
  ]
}

兼容性

  • 最低n8n版本: 1.0.0
  • 测试版本: 1.x.x
  • Node.js版本: >= 20.15.0

调试和日志查看

日志查看方法

1. n8n Desktop应用

  • 执行历史:工作流编辑器 → "Executions" → 选择执行记录 → 点击节点查看日志
  • 开发者工具:按F12 → Console标签查看详细日志

2. 本地npm安装

# 启动时设置调试级别
N8N_LOG_LEVEL=debug n8n start

然后在启动n8n的终端中查看实时日志输出

3. Docker部署

# 查看容器日志
docker logs -f n8n_container_name

# 或启动时设置日志级别
docker run -e N8N_LOG_LEVEL=debug n8n/n8n

4. n8n Cloud

  • 主要通过执行历史查看节点日志
  • 系统级日志可能不可见

日志级别说明

  • INFO: 关键操作和结果(连接状态、邮件数量等)
  • DEBUG: 详细处理过程(每封邮件的解析、过滤结果等)
  • ERROR: 错误信息和异常

常见调试场景

  • 连接问题:查看IMAP连接建立日志
  • 认证失败:检查凭据配置和授权码
  • 无邮件触发:查看搜索条件和过滤结果
  • 中文过滤不生效:检查客户端过滤日志

注意事项

  1. Gmail用户: 需要开启"允许不够安全的应用"或使用应用专用密码
  2. 企业邮箱: 请联系管理员确认IMAP设置
  3. 性能考虑: 建议设置合理的检查间隔,避免频繁请求
  4. 网络连接: 确保n8n服务器能访问邮箱服务器

资源链接

版本历史

v0.1.4

  • 添加详细的调试日志,方便排错和诊断问题
  • 改进错误处理和连接状态监控

v0.1.3

  • 改进中文主题过滤支持,使用客户端过滤策略

v0.1.2

  • 修复凭据验证问题,解决"Invalid URL"错误

v0.1.1

  • 优化邮件图标设计,使用彩色渐变效果

v0.1.0

  • 初始版本发布
  • 支持基础IMAP邮件监控功能
  • 支持邮件过滤和解析

开发者

Betty Huang ([email protected])

许可证

MIT License

git clone https://github.com/<your organization>/<your-repo-name>.git
  1. Run npm i to install dependencies.
  2. Open the project in your editor.
  3. Browse the examples in /nodes and /credentials. Modify the examples, or replace them with your own nodes.
  4. Update the package.json to match your details.
  5. Run npm run lint to check for errors or npm run lintfix to automatically fix errors when possible.
  6. Test your node locally. Refer to Run your node locally for guidance.
  7. Replace this README with documentation for your node. Use the README_TEMPLATE to get started.
  8. Update the LICENSE file to use your details.
  9. Publish your package to npm.

More information

Refer to our documentation on creating nodes for detailed information on building your own nodes.

License

MIT