An open API service indexing awesome lists of open source software.

https://github.com/siarheidudko/iredmail-kubernetes

Running the mail server with UI on minimal resources
https://github.com/siarheidudko/iredmail-kubernetes

docker dovecot email email-sender email-server emailserver iredmail kubernetes mta postfix

Last synced: 2 months ago
JSON representation

Running the mail server with UI on minimal resources

Awesome Lists containing this project

README

        

# iredmail-kubernetes
Running the mail server with UI on minimal resources

An unloaded server can run on about `10m` CPU, `512Mi` Memory.
After installation will be available:
- roundcube (web ui): `EMAIL_SERVER_HOSTNAME` (ex: `email.example.com`)
- iredmail (admin ui): `EMAIL_SERVER_HOSTNAME/iredadmin` (ex: `email.example.com/iredadmin`)
- smtp/pop3/imap server: `EMAIL_SERVER_HOSTNAME` (ex: `email.example.com`)
- first user: `postmaster@FIRST_MAIL_DOMAIN` (ex: `[email protected]`)
- first user password: `FIRST_MAIL_DOMAIN_ADMIN_PASSWORD` (ex: `password`)

You will also need to set up:
- **MX** record (to receive mail) for the domain: `FIRST_MAIL_DOMAIN` (ex: `example.com`)
- **A** record (to get letsencrypt certificates) for the domain: `EMAIL_SERVER_HOSTNAME` (ex: `email.example.com`)
- **SPF**, **DKIM** and **DMARK** records for better delivery service

This example binds the server to a node and is not a highly available deployment option. (due to the use of local storage)

```bash
# Env
export NODE_HOSTNAME="worker-1.example.com"
export EMAIL_SERVER_HOSTNAME="email.example.com"
export FIRST_MAIL_DOMAIN="example.com"
export FIRST_MAIL_DOMAIN_ADMIN_PASSWORD="password"

mkdir /home/iredmail
cd /home/iredmail
kubectl create namespace iredmail
```

You will need to forward the ports via ingress to the iredmail-server service. To do this, you need to force ingress to listen to traffic on these ports.
```bash
# patch nginx
kubectl patch svc ingress-nginx-controller -n ingress-nginx --type "json" -p '[
{"op":"add","path":"/spec/ports/-","value":{"name": "smtp", "port": 25, "targetPort": 25}},
{"op":"add","path":"/spec/ports/-","value":{"name": "smtp-ssl", "port": 465, "targetPort": 465}},
{"op":"add","path":"/spec/ports/-","value":{"name": "smtp-tls", "port": 587, "targetPort": 587}},
{"op":"add","path":"/spec/ports/-","value":{"name": "imap-tls", "port": 143, "targetPort": 143}},
{"op":"add","path":"/spec/ports/-","value":{"name": "imap-ssl", "port": 993, "targetPort": 993}},
{"op":"add","path":"/spec/ports/-","value":{"name": "pop3-tls", "port": 110, "targetPort": 110}},
{"op":"add","path":"/spec/ports/-","value":{"name": "pop3-ssl", "port": 995, "targetPort": 995}}
]'

kubectl patch deployment ingress-nginx-controller -n ingress-nginx --type "json" -p '[
{"op":"add","path":"/spec/template/spec/containers/0/args/-","value": "--tcp-services-configmap=$(POD_NAMESPACE)/tcp-services"}
]'

tee /home/iredmail/ingress-configmap.yaml<