--- # LoadBalancer Service for direct SMTP/IMAP access # Use this if you have MetalLB or similar LoadBalancer provider apiVersion: v1 kind: Service metadata: name: stalwart-mail-ports namespace: mail-services labels: app: stalwart annotations: # If using MetalLB, you can request a specific IP # metallb.universe.tf/loadBalancerIPs: 192.168.10.241 spec: type: LoadBalancer selector: app.kubernetes.io/instance: stalwart app.kubernetes.io/name: stalwart ports: # SMTP - Receiving mail from other servers - name: smtp port: 25 targetPort: 25 protocol: TCP # SMTP Submission - Sending mail - name: submission port: 587 targetPort: 587 protocol: TCP # SMTPS - Secure SMTP - name: smtps port: 465 targetPort: 465 protocol: TCP # IMAPS - Secure IMAP - name: imaps port: 993 targetPort: 993 protocol: TCP # IMAP - Plaintext IMAP - name: imap port: 143 targetPort: 143 protocol: TCP --- # Instructions: # 1. Apply this service: kubectl apply -f stalwart-loadbalancer-service.yaml # 2. Get the LoadBalancer IP: kubectl get svc stalwart-mail-ports -n mail # 3. If the IP is private (192.168.x.x), set up port forwarding from your router # 4. Update DNS (turn OFF Cloudflare proxy): # mail.dvirlabs.com A (gray cloud, not orange) # 5. Add MX record: # @ MX 10 mail.dvirlabs.com