This project sets up a Postfix mail server using Docker and mailtrap. The mail server can be used by other services to send emails.
- Lightweight Postfix mail server in a Docker container.
- Configurable via
main.cf. - Supports email routing using mailtrap.
- Routes to all major email providers (
@outlook,@gmail,@yahoo, etc.)
- Docker
- Docker Compose (optional, for easy setup)
Clone this repository to your local machine:
git clone https://github.com/daily-coding-problem/postfix-mail-server.git
cd postfix-mail-serverCreate the postfix/sasl_passwd file with your credentials from mailtrap.
Build the Docker image using the Dockerfile:
docker compose buildRun the Docker container with the built image:
docker compose upYou can test sending emails by connecting to the mail server from another container or from your host machine using telnet:
telnet localhost 25Once connected, use the following SMTP commands to send an email:
HELO localhost
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
DATA
Subject: Test Email
This is a test email.
.
QUIT
This project is licensed under the MIT License.