forked from DevFW-CICD/stacks
feat(mailhog): IPCEICIS-3048 - added documentation
This commit is contained in:
parent
d0585fd2b7
commit
55435a3ad2
1 changed files with 54 additions and 0 deletions
54
template/stacks/ref-implementation/mailhog/README.md
Normal file
54
template/stacks/ref-implementation/mailhog/README.md
Normal file
|
@ -0,0 +1,54 @@
|
|||
# Mailhog
|
||||
|
||||
[MailHog is an email testing tool for developers](https://github.com/mailhog/MailHog).
|
||||
|
||||
## In cluster SMTP service
|
||||
|
||||
Ypu can send ESMTP emails in the cluster to `mailhog.mailhog.svc.cluster.local`, standard port `1025`, as defined in the service manifest:
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mailhog
|
||||
spec:
|
||||
ports:
|
||||
- name: smtp
|
||||
port: 1025
|
||||
```
|
||||
|
||||
## Ingress
|
||||
|
||||
Mailhog offers both WebUi and API at `https://{{{ .Env.DOMAIN }}}/mailhog`.
|
||||
|
||||
The ingress definition is in `stacks/core/ingress-apps/mailhog.yaml` (BTW, why isn't this ingress file here in this folder ??) routing to the mailhog' service
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
rules:
|
||||
- host: {{{ .Env.DOMAIN }}}
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
...
|
||||
path: /mailhog
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
For usage of the API see https://github.com/mailhog/MailHog/blob/master/docs/APIv2.md
|
||||
|
||||
## Tests
|
||||
|
||||
```bash
|
||||
kubectl run busybox --rm -it --image=busybox -- /bin/sh
|
||||
|
||||
# inside bsybox
|
||||
wget -O- http://mailhog.mailhog.svc.cluster.local:8025/mailhog
|
||||
|
||||
# check smtp port
|
||||
nc -zv mailhog.mailhog.svc.cluster.local 1025
|
||||
|
||||
# send esmtp, first install swaks
|
||||
swaks --to test@example.com --from test@example.com --server mailhog:1025 --data "Subject: Test-Mail\n\nDies ist eine Test-Mail."
|
||||
```
|
Loading…
Reference in a new issue