smtp

by lbenicio

Helm chartv0.1.4App latestVerified publisher

A Helm chart for smtp

About this chart

smtp

A lightweight SMTP relay server for forwarding outbound mail through a smarthost.

TL;DR

helm repo add lbenicio-community https://helm.lbenicio.dev/
helm install my-release lbenicio-community/smtp

Introduction

This chart deploys egos-tech/smtp, a minimal SMTP relay that accepts mail from trusted networks and forwards it to an external smarthost. It is designed for homelab and small-scale deployments where applications need a local mail relay without running a full mail server.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.x+
  • An external smarthost (e.g., Gmail, SendGrid, or your ISP's relay)

Installing the Chart

helm install my-release lbenicio-community/smtp --namespace default \
  --set smtp.relayNetworks=":10.0.0.0/8" \
  --set smtp.smarthostAddress="smtp.example.com" \
  --set smtp.smarthostPort="587"

Parameters

KeyTypeDefaultDescription
image.repositorystringregistry.gitlab.com/egos-tech/smtpContainer image repository
image.tagstring""Image tag (defaults to Chart.appVersion)
image.pullPolicystringIfNotPresentImage pull policy
replicaCountint1Number of replicas
service.typestringClusterIPService type
service.portint25SMTP service port
smtp.relayNetworksstring""Networks allowed to relay (e.g., :10.0.0.0/8)
smtp.smarthostAliasesstring""SMTP aliases for the smarthost (e.g., *.example.com)
smtp.smarthostAddressstring""Smarthost address
smtp.smarthostPortstring""Smarthost port (e.g., 587)
smtp.smarthostUserstring""Smarthost username
smtp.smarthostPasswordstring""Smarthost password
smtp.relayDomainsstring""Domains allowed to relay (colon-separated)
resources.requests.cpustring100mCPU request
resources.requests.memorystring128MiMemory request
resources.limits.cpustring500mCPU limit
resources.limits.memorystring256MiMemory limit
autoscaling.enabledboolfalseEnable HPA
autoscaling.minReplicasint1Minimum replicas
autoscaling.maxReplicasint1Maximum replicas
keel.enabledboolfalseEnable Keel auto-update annotations
keel.policystringforceKeel update policy
keel.triggerstringpollKeel trigger type

Configuration

SMTP Relay

Configure the smarthost and relay networks to match your environment:

smtp:
  relayNetworks: ":10.0.0.0/8 : 172.16.0.0/12"
  smarthostAddress: "smtp.gmail.com"
  smarthostPort: "587"
  smarthostUser: "[email protected]"
  smarthostPassword: "app-password-here"
  relayDomains: "example.com : another.com"

Note: This chart exposes SMTP on port 25 via a ClusterIP service. It does not support ingress since SMTP is not an HTTP protocol. For external access, consider using a LoadBalancer or NodePort service type, or a TCP ingress controller like Traefik with TCP routes.

Using Secrets for Credentials

For sensitive values like smarthostPassword, prefer using environment variables from a Kubernetes Secret:

extraEnv:
  - name: SMARTHOST_PASSWORD
    valueFrom:
      secretKeyRef:
        name: smtp-secrets
        key: password

License

This chart is licensed under GPLv3.


Made with ❤️ by lbenicio

Deploy smtp with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has smtp on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartsmtp is pinned at v0.1.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply