websmtp.webm
Standalone SMTP server and web mail application. Purpose is to be simple to setup and use while being somewhat flexible.
Think of it as self-hosted replacement for email services like gmail, outlook and proton mail. Spam handling is done through Apache's Spam Assassin.
Possible uses: mock SMTP server for testing, home emails for LAN devices such as printers and ip cameras, your own web email provider business.
- Create a mariadb database named
websmtp
and a login/user with thewebsmtp/websmtp
access credentials. docker run -it -p 5000:5000 -p 25:25 -e Database__Server=your-database-server yvansolutions/websmtp:latest ./websmtp --migrate-database --enable-admin --username=admin --password=admin
.- Navigate to
http://localhost:5000
and use the defaultadmin/admin
credentials.
docker compose up
- Navigate to
http://localhost:5000
and use the defaultadmin/admin
credentials.
By default the app is published as self-contained single file executable.
Running the app once configured is done by running the websmtp
binary.
You can use the --migrate-database
command line argument to prepare a database.
Available command line arguments:
--add-user
: quickly add a user by answering a couple of questions. User will have OTP disabled.--displayName=
--username=
--password=
--email=
--mailbox=
--roles=
--list--users
: display all the users data in JSON.--migrate-database
: apply migrations to database up to the lastest available at build time.--migrate-database-only
: same as previous, but exit the application once done.--enable-admin
: enable/create an admin user, similar to--add-user
but if the username is taken, skip.--username=
--password=
--domain=
:
--generate-dkim-config
: generate the pub/priv certs, DNS record data and the configuration file data to enable DKIM signing and DNS configuration.
Available on the docker hub: yvansolutions/websmtp.
Use the provided build_docker.sh
which will:
- compile/publish the app in the
build
folder - launch docker build
- add the
build
folder to the container - setup spam assassin
- tag the resulting image as yvansolutions/websmtp.
docker run -it -p 5000:5000 -p 25:25 -e Database__Server=your-database-server yvansolutions/websmtp:latest ./websmtp --migrate-database --enable-admin --username=admin --password=admin
This would launch the app, which would use some-database-server
with the default database named websmtp
with default credentials of websmtp/websmtp
. It would listen for HTTP connections on port 5000
and SMTP 25
. An admin account with a catch-all mailbox and an identity of postmaster@localhost
.
Here are some important environment variables and their default:
Database__Server: localhost
Database__Name: websmtp
Database__Password: websmtp
Database__Username: websmtp
SMTP__Port: 25
SMTP__RemotePort: 25
SpamAssassin__Enabled: True
DKIM__SigningEnabled: False
DNS__IP: 1.1.1.1
DNS__Port: 53
Security__EnableHtmlDisplay: True
Security__EnableMediaInHtml: True
In active development, partial features, missing features, security issues, not tested, etc.