2023-08-15 13:39:57 +00:00
# Build haraka container.
2021-02-03 09:20:54 +00:00
```
2023-08-15 13:39:57 +00:00
sudo docker build . -t haraka:latest
2021-02-03 09:20:54 +00:00
```
2021-02-11 21:44:34 +00:00
2023-08-15 13:39:57 +00:00
# To update a stack
2021-02-03 09:20:54 +00:00
```
2023-08-15 13:39:57 +00:00
cd haraka
sudo docker stack deploy haraka -c docker-compose.yml
```
2021-02-03 09:20:54 +00:00
2023-08-15 13:39:57 +00:00
# To restart a service
2021-02-03 09:20:54 +00:00
2023-08-15 13:39:57 +00:00
```
sudo docker service update haraka_haraka --force
```
2021-02-03 09:20:54 +00:00
2023-08-15 13:39:57 +00:00
# Send Test Outbound Email
2021-02-03 09:20:54 +00:00
2023-08-15 13:39:57 +00:00
```
swaks --to hello@nawazdhandala.com --from hello@genosyn.com --server 192.168.1.100 --port 2525 --auth-user homelab --auth-password password
2021-02-03 09:20:54 +00:00
```
2023-08-15 13:39:57 +00:00
# Set a domain to send email
2021-02-15 14:51:46 +00:00
2023-08-15 13:39:57 +00:00
Generate a DKIM key:
2021-02-15 14:51:46 +00:00
2023-08-15 13:39:57 +00:00
```
cd dkim
2021-02-15 14:51:46 +00:00
2023-08-15 13:39:57 +00:00
bash generate.sh
2021-02-03 09:20:54 +00:00
2023-08-15 13:39:57 +00:00
cd ..
2021-02-03 09:20:54 +00:00
```
2024-08-04 02:07:56 +00:00
`public` and `private` files should have been generated inside of `dkim` folder. Please also add DNS and env vars to docker compose files. Values of that should be shown on the console.
2021-02-03 09:20:54 +00:00
2023-08-15 13:39:57 +00:00
Add an A record:
2021-02-03 09:20:54 +00:00
2023-08-15 13:39:57 +00:00
```
mailer.company.com < IP address or haraka server >
2021-02-03 09:20:54 +00:00
```
2023-08-15 13:39:57 +00:00
Set SPF record:
2021-01-23 14:32:25 +00:00
```
2023-08-15 13:39:57 +00:00
# Any MX or A servers can send emails.
v=spf1 mx a -all
2021-01-23 14:32:25 +00:00
```
2023-08-15 13:39:57 +00:00
Example:
2021-01-23 14:32:25 +00:00
2021-01-25 15:35:33 +00:00
```
2023-08-15 13:39:57 +00:00
v=spf1 mx a ip4:37.26.74.9 include:_spf.google.com include:mail.genosyn.com ~all
2021-01-25 15:35:33 +00:00
```
2021-01-23 14:32:25 +00:00
2023-08-15 13:39:57 +00:00
Set DMARC record:
2021-01-23 14:32:25 +00:00
2021-01-25 15:35:33 +00:00
```
2023-08-15 13:39:57 +00:00
Type: TXT
Key: _dmarc
Value: "v=DMARC1; p=reject; adkim=s; aspf=r; rua=mailto:dmarc-feedback@< DOMAIN > ; ruf=mailto:dmarc-feedback@< DOMAIN > ; pct=100"
```
2021-01-23 14:32:25 +00:00
2023-08-15 13:39:57 +00:00
Example:
2021-02-03 09:20:54 +00:00
2021-01-23 14:32:25 +00:00
2023-08-15 13:39:57 +00:00
```
_dmarc TXT "v=DMARC1; p=reject; adkim=s; aspf=r; rua=mailto:dmarc-feedback@genosyn.com; ruf=mailto:dmarc-feedback@genosyn.com; pct=100"
```
2021-02-03 09:20:54 +00:00
2021-01-23 14:32:25 +00:00
2023-08-15 13:39:57 +00:00
# Test, Test, Test.
2021-01-24 12:58:02 +00:00
2023-08-15 13:39:57 +00:00
Use https://www.mail-tester.com/ to test emails.