Skip to content

hyvor/smtp-simulator

Repository files navigation

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.

About

SMTP simulator server for testing bounces & complaints

Resources

License

Stars

Watchers

Forks

Packages

No packages published