Sign inSign up

hsiaoshun/smtp2resend

By hsiaoshun

Updated about 1 year ago

Turn Docker container into a functional SMTP server that relays all emails via Resend

Image
Networking
Integration & delivery
0

1.3K

hsiaoshun/smtp2resend repository overview

📬 smtp2resend

This image is NOT officially supported by Resend.

Turn your Docker container into a functional SMTP server that relays all emails via Resend — a trusted email API service. Ideal for self-hosted applications that need reliable email delivery without landing in the junk box.

✨ Purpose

This container runs a lightweight SMTP server (based on aiosmtpd) that accepts incoming mail and forwards it using the Resend API.

If you're tired of your app's emails going to spam (especially on Gmail), using a trusted service like Resend improves your chances of reaching the inbox.

🚀 How to Use

  • Sign up at Resend and generate an API key.

  • Set the RESEND_API_KEY environment variable in your Docker environment.

  • Run the container using docker-compose or docker run.

Example docker-compose.yml

services:
  smtp2resend:
    container_name: smtp2resend
    image: hsiaoshun/smtp2resend:latest
    restart: unless-stopped
    ports:
      - 25:25
    environment:
      - RESEND_API_KEY=${RESEND_API_KEY}  # Replace with your actual Resend API key

Example of using it with bookstack(please make sure bookstatck and smtp2resend is in the same network):

  bookstack-internal:
    image: solidnerd/bookstack:25.5.1
    container_name: bookstack-internal
    depends_on:
    - bookstack-mysql
    restart: unless-stopped
    environment:
    ...
    - MAIL_HOST=smtp2resend # or replace it to your IP
    - MAIL_USERNAME=
    - MAIL_PASSWORD=
    - MAIL_PORT=25
    - [email protected] # your FROM address
    - MAIL_FROM_NAME=no-reply # your FROM name
    ...

⚠️ Disclaimer

While using Resend can significantly increase the chances of your emails being delivered to the inbox (especially for major providers like Gmail), delivery is not guaranteed.

Inbox placement depends on various factors including:

  • your From domain's DNS configuration (SPF, DKIM, DMARC),

  • message content quality.

  • recipient behavior.

  • email sending volume.

This container does not modify or optimize deliverability headers beyond what Resend provides.

📝 Notes

Only supports unauthenticated SMTP on port 25 (ideal for internal use).

All emails are forwarded using the resend.Emails.send() API.

Supports To and Cc addresses correctly.

Handles UTF-8 encoded subjects and HTML or plain text bodies.

Tag summary

Content type

Image

Digest

sha256:1e408c3db

Size

51.2 MB

Last updated

about 1 year ago

docker pull hsiaoshun/smtp2resend