Skip to content

Commit 2c174eb

Browse files
committed
docs and ci
1 parent 01a1141 commit 2c174eb

File tree

5 files changed

+87
-22
lines changed

5 files changed

+87
-22
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: build and push
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- release
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
22+
- uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- uses: martinbeentjes/npm-get-version-action@v1.3.1
29+
id: package-version
30+
with:
31+
path: frontend
32+
33+
- uses: docker/build-push-action@v5
34+
with:
35+
context: .
36+
push: true
37+
tags: |
38+
cars10/mailfang:latest
39+
ghcr.io/cars10/mailfang:latest
40+
cars10/mailfang:${{ steps.package-version.outputs.current-version }}
41+
ghcr.io/cars10/mailfang:${{ steps.package-version.outputs.current-version }}

README.md

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,56 @@
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
2727
docker 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

4043
1. 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
8188
mkdir -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

95121
MIT

backend/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mailfang"
3-
version = "0.1.0"
3+
version = "1.0.0"
44
edition = "2024"
55

66
[features]

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mailfang-frontend",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "1.0.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

frontend/src/utils/emailAddress.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ export function parseAndDecodeAddresses(headerValue: string): string[] {
4747
return parseAddresses(headerValue).map(decodeAddress)
4848
}
4949

50-
export function parseAndDecodeHeaderValues(
51-
headerValues: string[]
52-
): string[] {
50+
export function parseAndDecodeHeaderValues(headerValues: string[]): string[] {
5351
return headerValues.flatMap(parseAndDecodeAddresses)
5452
}

0 commit comments

Comments
 (0)