11# MailFang
22
3- MailFang is the smtp server and webui for email testing that you have been waiting for!
3+ MailFang is the SMTP server and web interface for email testing that you have been waiting for!
44
55## About
66
7- Use MailFang locally during development, deploy it in a sandbox or use it in your staging environment instead of sending real emails.
7+ Use MailFang locally during development, deploy it in a sandbox, or use it in your staging environment instead of sending real emails.
88
99### Features
1010
11- * Easy deployment via docker or self-contained single file binary
12- * View rendered email html or text content, inspect headers and raw email
11+ * Easy deployment via docker or single file binary
12+ * View rendered email content, inspect headers, attachments and raw email
1313* Check how your email reacts when users block remote content loading
14- * View email in mobile, tablet and desktop layout
15- * All data is saved in a local sqlite database or simply in-memory
16- * Connect to SMTP via ` PLAIN ` , ` LOGIN ` , ` CRAM-MD5 ` auth or without authorization
17- * ... and much more
18-
14+ * Preview emails in mobile, tablet, and desktop layouts
15+ * Data is stored in sqlite database - file based or in-memory
16+ * SMTP auth supports: ` PLAIN ` , ` LOGIN ` , ` CRAM-MD5 ` , or no authentication
17+ * Realtime email updates in the webui
18+ * ... and much more
1919
2020## Usage
2121
2222### Docker
2323
24- Use the [ existing image] ( https://hub.docker.com/r/cars10/mailfang ) :
24+ Use the [ existing image] ( https://hub.docker.com/r/cars10/mailfang ) from docker hub :
2525
2626``` bash
2727docker run --name mailfang \
2828 -p 3000:3000 \
2929 -p 2525:2525 \
3030 -d cars10/mailfang
31+
32+ # or use the image from ghcr.io: ghcr.io/cars10/mailfang
3133```
3234
33- Default ports used by mailfang :
35+ Default ports:
3436
35- * ` 3000 ` - Webui
37+ * ` 3000 ` - Web UI
3638* ` 2525 ` - SMTP Server
3739
40+
3841### Binary
3942
40431 . Download the latest binary from the [ releases page] ( https://github.com/cars10/mailfang/releases )
41- 2 . Set executable permissions ` sudo chmod +x ./mailfang `
42- 3 . Run mailfang ` ./mailfang `
44+ 2 . Set executable permissions: ` chmod +x ./mailfang `
45+ 3 . Run MailFang: ` ./mailfang `
46+
47+ You can view all available configuration options by running ` ./mailfang --help ` .
4348
4449## Configuration
4550
46- Hint: You can run MailFang with ` --help ` to get the same information .
51+ You can configure MailFang via command-line arguments or environment variables. When running in docker, environment variables are recommended .
4752
48- When running in docker the easiest way to configure MailFang to use the environment variables.
53+ ### Available Options
4954
5055``` bash
5156--smtp-host < SMTP_HOST>
@@ -75,7 +80,9 @@ When running in docker the easiest way to configure MailFang to use the environm
7580 [default: sqlite::memory:]
7681```
7782
78- Full configuration example:
83+ ### Configuration Example
84+
85+ Persistent storage with smtp authentication:
7986
8087``` bash
8188mkdir -p mailfang/data
@@ -90,6 +97,25 @@ docker run --name mailfang \
9097 cars10/mailfang
9198```
9299
100+ ### Database Persistence
101+
102+ By default, MailFang uses an in-memory database. To persist emails between restarts configure a database url:
103+
104+ * Docker: Use ` DATABASE_URL=sqlite:///data/mailfang.db ` and mount a volume to ` /data `
105+ * Binary: Use ` --database-url sqlite:///path/to/mailfang.db ` or set ` DATABASE_URL=sqlite:///path/to/mailfang.db `
106+
107+ ## Development
108+
109+ ### Prerequisites
110+
111+ * Docker and Docker Compose
112+ * [ Rust] ( https://rustup.rs/ )
113+ * Node.js
114+
115+ ### Running
116+
117+ Run ` make dev ` to start the frontend and backend, access the frontend on ` http://localhost:5173 ` .
118+
93119## License
94120
95121MIT
0 commit comments