SMTP simulator server for testing bounces & complaints
Find a file
2025-10-25 01:37:21 +02:00
.github/workflows docker ci fix 2025-09-17 08:37:47 +05:30
.env from domain 2025-09-16 11:45:54 +05:30
.gitignore readme 2025-09-17 08:19:14 +05:30
action.go bounces wip 2025-09-16 11:20:48 +05:30
action_test.go bounces test wip 2025-09-16 19:35:53 +05:30
bounces.go mail test, CI 2025-09-17 08:04:26 +05:30
bounces_test.go bounce delay 2025-09-16 20:00:08 +05:30
complaint.go mail test, CI 2025-09-17 08:04:26 +05:30
complaint_test.go mail test, Dockerfile 2025-09-17 07:48:15 +05:30
Dockerfile mail test, Dockerfile 2025-09-17 07:48:15 +05:30
go.mod bounces wip 2025-09-16 19:31:31 +05:30
go.sum bounces wip 2025-09-16 19:31:31 +05:30
LICENSE Initial commit 2025-09-15 10:31:27 +05:30
mail.go ignore MX error 2025-10-25 01:37:04 +02:00
mail_test.go check for A record if MX records are not found 2025-10-25 01:27:08 +02:00
main.go bounces wip 2025-09-16 19:31:31 +05:30
Makefile bounces test wip 2025-09-16 19:35:53 +05:30
README.md readme 2025-09-17 08:19:14 +05:30
server.go Reply early in RCPT when possible 2025-10-14 22:50:15 +02:00
server_test.go Reply early in RCPT when possible 2025-10-14 22:50:15 +02:00

This is a simple SMTP simulator server for bounces and complaints.

For Hyvor Relay customers, the email domain is simulator.relay.hyvor.com. For example, to simulate a busy mailbox, send an email to busy@simulator.relay.hyvor.com.

Installation

Using Docker

hyvor/smtp-simulator is a minimal Docker image that exposes port 25 for SMTP.

docker run -p 25:25 hyvor/smtp-simulator

Using Docker Compose

services:
    smtp-simulator:
        image: hyvor/smtp-simulator
        ports:
        - "25:25"

From Source

git clone https://github.com/hyvor/smtp-simulator
cd smtp-simulator
go build -o smtp-simulator .
./smtp-simulator

Environment Variables

  • DOMAIN (default: localhost): The domain name of the SMTP server. You should set up a MX record for this domain to point to the server's IP address. This is used in the HELO/EHLO command and in the From address of bounce emails.

Email Addresses

Send emails to the following addresses to simulate different scenarios.

Synchronous Responses

These emails respond with a bounce immediately within the SMTP transaction after the DATA command is completed.

Email Local Part Description Status Code Enhanced Code
accept@ Accepts the email and simulates a successful delivery. 250 2.0.0
busy@ Simulates a busy mailbox. 450 4.2.1
tempfail@ Simulates a temporary failure. 451 4.3.0
missing@ Simulates a hard bounce. 550 5.1.1
disabled@ Simulates a disabled email address. 550 5.1.2
spam@ Simulates a spam rejection. 550 5.7.1

Asynchronous Bounces

These emails accept the message initially but later send a bounce notification (DSN) back to the sender. The bounce is sent as per RFC3464.

Email Local Part Description Status Code Enhanced Code
missing+async@ Simulates a hard bounce. 550 5.1.1
disabled+async@ Simulates a disabled email address. 550 5.1.2
spam+async@ Simulates a spam rejection. 550 5.7.1
  • If there are multiple recipients with different bounce types, a single DSN will be sent with all the failed recipients listed.

Complaints

These emails accept the message initially but later send a complaint notification back to the sender. The complaint is sent as per RFC5965.

Email Local Part Description
complaint@ Simulates a user complaint.