Skip to content

Commit a96122b

Browse files
committed
Document bin/mksmtp.sh in postfix README
Made-with: Cursor
1 parent 187d68f commit a96122b

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

apps/postfix/README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,38 @@ To create credentials for SMTP clients that want to use the relay:
3131
```
3232
echo PASSWORD | docker compose exec postfix saslpasswd2 -c -u ctrlh USERNAME
3333
```
34-
Note that the account is `USERNAME@ctrlh` in this case - using a domain name is necessary becsause intermediate mail relays mail drop mail with unqualified names in it.
34+
Note that the account is `USERNAME@ctrlh` in this case - using a domain name is necessary because intermediate mail relays may drop mail with unqualified names in it.
3535

3636
Each service should have its own credentials so that it can be managed independently of other services.
3737

38+
### bin/mksmtp.sh
39+
40+
`bin/mksmtp.sh` automates account creation. It reads
41+
`POSTFIX_smtpd_sasl_local_domain` from `.env`, generates a random
42+
password, creates the SASL account, and prints all the parameters needed
43+
to configure the app:
44+
45+
```sh
46+
bin/mksmtp.sh <app-name>
47+
```
48+
49+
Example output:
50+
51+
```
52+
================================================================
53+
SMTP credentials for: glitchtip
54+
================================================================
55+
Host: postfix
56+
Port: 587
57+
Username: glitchtip@mail-relay.example.com
58+
Password: <generated>
59+
URL: smtp://glitchtip%40mail-relay.example.com:<generated>@postfix:587
60+
================================================================
61+
```
62+
63+
Requires `pwgen` (`apt install pwgen`) and the postfix container to be running.
3864

3965
To test credentials:
4066
```
41-
docker compose exec testsaslauthd -u USERNAME@DOMAIN -p PASSWORD
67+
docker compose exec postfix testsaslauthd -u USERNAME@DOMAIN -p PASSWORD
4268
```

0 commit comments

Comments
 (0)