项目作者: alash3al

项目描述 :
A tiny software that receive a smtp request (email) and send it to the specified webhook as a http post request
高级语言: Go
项目地址: git://github.com/alash3al/smtp2http.git
创建时间: 2018-11-12T17:38:51Z
项目社区:https://github.com/alash3al/smtp2http

开源协议:Apache License 2.0

下载


SMTP2HTTP (email-to-web)

smtp2http is a simple smtp server that resends the incoming email to the configured web endpoint (webhook) as a basic http post request.

Dev

  • go mod vendor
  • go build

Dev with Docker

Locally :

  • go mod vendor
  • docker build -f Dockerfile.dev -t smtp2http-dev .
  • docker run -p 25:25 smtp2http-dev --timeout.read=50 --timeout.write=50 --webhook=http://some.hook/api

Or build it as it comes from the repo :

  • docker build -t smtp2http .
  • docker run -p 25:25 smtp2http --timeout.read=50 --timeout.write=50 --webhook=http://some.hook/api

The timeout options are of course optional but make it easier to test in local with telnet localhost 25
Here is a telnet example payload :

  1. HELO zeus
  2. # smtp answer
  3. MAIL FROM:<email@from.com>
  4. # smtp answer
  5. RCPT TO:<youremail@example.com>
  6. # smtp answer
  7. DATA
  8. your mail content
  9. .

Docker (production)

Docker images arn’t available online for now
See “Dev with Docker” above

  • docker run -p 25:25 smtp2http --webhook=http://some.hook/api

Native usage

smtp2http --listen=:25 --webhook=http://localhost:8080/api/smtp-hook
smtp2http --help

Contribution

Original repo from @alash3al
Thanks to @aranajuan