Sign inSign up

rsubr/smtp2http

By rsubr

•Updated about 1 year ago

SMTP server to receive emails and serve them over http, github.com/poornatc/smtp2http.

Image
0

1.1K

rsubr/smtp2http repository overview

⁠SMTP2HTTP

SMTP server to receive emails and serve them over http. smtp2http is intended to be used as a mail server for receiving OTP emails that can be retrieved for Playwright⁠ automation.

Eg. receive email for [email protected] and retreive it as http://localhost/mail/`[email protected]`⁠.

⁠Running

docker run -v $PWD/server.key:/server.key \
    -v $PWD/server.pem:/server.pem \
    -p 25:1025 -p 80:8080 \
    rsubr/smtp2http

⁠Building

# if using docker buildx
buildx build --load . -t smtp2http

# if using vanilla docker build
docker build . -t smtp2http

⁠Talking to the SMTP server
#!/bin/bash

netcat -i 1 -C localhost 1025 <<EOT
EHLO localhost
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
DATA
Hello world!
.
EOT
⁠Fetching the email over HTTP
wget -O - -S -q 'http://localhost:8080/mail/[email protected]'

Tag summary

Content type

Image

Digest

sha256:2b261dc52…

Size

5.8 MB

Last updated

about 1 year ago

docker pull rsubr/smtp2http