Coder Social home page Coder Social logo

mailhook's Introduction

Mailhook

自动将邮件转发到飞书群。邮件支持附件,附件也会自动转发到飞书群。

机器人使用方法

  1. 将机器人拉入群
  2. 机器人会回复一个自动生成的邮件地址,往这个邮件地址发送的邮件会自动转发到群内
  3. 从群中删除机器人可关闭转发功能
  4. 在群内 at 机器人会自动回复邮件地址

如何配置飞书机器人

在飞书开放平台创建一个应用,获取 app id 和 app secret,然后配置事件订阅 URL 为 http://your.domain/event

如何启动

FEISHU_APP_ID=app_id FEISHU_APP_SECRET=app_secret MAIL_DOMAIN=mail.domain WEB_DOMAIN=web.domain mailhook
  • FEISHU_APP_IDFEISHU_APP_SECRET 为飞书应用的 app id 和 app secret
  • MAIL_DOMAIN 为邮件域名,用于生成邮件地址。例如 mail.xcf.io 生成的邮件地址为 [email protected], xcf.io 生成的邮件地址为 [email protected]
  • WEB_DOMAIN 为网站域名,用于生成原始邮件下载地址

开放端口

Mailhook 启动后会监听:

  1. 8088 端口,用于接收飞书的回调。
  2. 25 端口,用于接收邮件。

因为监听了 25 端口,所以启动需要 root 权限。

DNS 配置

如果自动生成的域名为 [email protected],则需要在 xcf.io DNS 中加入 MX 记录。IP 地址对应为服务部署的 IP 地址。

MX    @      12.23.3.12

如果自动生成的域名为 [email protected],则需要在 xcf.io DNS 中加入 MX 记录。IP 地址对应为服务部署的 IP 地址。

MX    mail      12.23.3.12

Docker 启动

docker run -p 8088:8088 -p 25:25 -e FEISHU_APP_ID=app_id -e FEISHU_APP_SECRET=app_secret -e MAIL_DOMAIN=mail.domain -e WEB_DOMAIN=web.domain gfreezy/mailhook

Docker-compose 启动

  1. 修改 docker-compose.yml 中的环境变量: FEISHU_APP_ID, FEISHU_APP_SECRET, MAIL_DOMAIN, WEB_DOMAIN

  2. 启动

docker-compose up

Release New Docker Image

./release-image.sh

mailhook's People

Contributors

gfreezy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mailhook's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.