Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DOMAIN=yourdomain.com

# Path to certbot certificates directory
CERT_PATH=../mail-infra/services/silver-config/certbot/keys/etc
CERT_PATH=../mail-infra/services/opengovmail-config/certbot/keys/etc

# OAuth2 Configuration (Required)
# The introspection URL is used by the API server to validate application access tokens
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ What actually happened.
## Environment
- OS: [e.g. Ubuntu 22.04]
- Docker version: [e.g. 20.10.17]
- PingMailer version: [e.g. v1.2.0 or commit hash]
- OpenGovMail version: [e.g. v1.2.0 or commit hash]

## Additional Context
Add any other context or screenshots about the issue.
16 changes: 8 additions & 8 deletions .github/workflows/docker-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Publish container images
# ...then publish a GitHub Release for that tag (or use workflow_dispatch).
#
# raven-sasl is deliberately absent: it is built in a different repository
# (ghcr.io/lsflk/raven-sasl) and is only consumed here.
# (ghcr.io/opengovmail/raven-sasl) and is only consumed here.

on:
release:
Expand Down Expand Up @@ -40,18 +40,18 @@ jobs:
fail-fast: false
matrix:
include:
- name: pingmailer-api-server
- name: opengovmail-api-server
context: ./api-server
dockerfile: ./api-server/Dockerfile
# Static Go binary — cross-compiles cheaply, so build wide.
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le,linux/s390x
- name: silver-dkim
context: ./mail-infra/images/silver-dkim
dockerfile: ./mail-infra/images/silver-dkim/Dockerfile
- name: opengovmail-dkim
context: ./mail-infra/images/opengovmail-dkim
dockerfile: ./mail-infra/images/opengovmail-dkim/Dockerfile
platforms: linux/amd64,linux/arm64
- name: silver-smtp
context: ./mail-infra/images/silver-smtp-rootless
dockerfile: ./mail-infra/images/silver-smtp-rootless/Dockerfile
- name: opengovmail-smtp
context: ./mail-infra/images/opengovmail-smtp-rootless
dockerfile: ./mail-infra/images/opengovmail-smtp-rootless/Dockerfile
# This image rebuilds Postfix from source; every extra platform is
# a full compile under QEMU emulation. Keep the list tight.
platforms: linux/amd64,linux/arm64
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Publish Helm chart

# Packages the pingmailer umbrella chart and pushes it to GHCR as an OCI
# Packages the opengovmail umbrella chart and pushes it to GHCR as an OCI
# artifact, using the same release that publishes the container images.
#
# Release flow:
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Render smoke test
run: |
# The example values must produce a complete, parseable manifest.
helm template pingmailer ./helm -f helm/values.example.yaml > /tmp/rendered.yaml
helm template opengovmail ./helm -f helm/values.example.yaml > /tmp/rendered.yaml
count=$(grep -c '^kind:' /tmp/rendered.yaml)
echo "Rendered $count resources"
if [ "$count" -lt 15 ]; then
Expand All @@ -73,7 +73,7 @@ jobs:
# The required-value guards must still fire when values are absent,
# otherwise a misconfigured install would fail in-cluster instead of
# at render time.
if helm template pingmailer ./helm >/dev/null 2>&1; then
if helm template opengovmail ./helm >/dev/null 2>&1; then
echo "::error::Chart rendered with no values — required-value guards are broken."
exit 1
fi
Expand All @@ -98,34 +98,34 @@ jobs:
# Charts go in their own namespace so they don't collide with the
# image packages in the same org.
owner=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
helm push "dist/pingmailer-${{ steps.v.outputs.version }}.tgz" \
helm push "dist/opengovmail-${{ steps.v.outputs.version }}.tgz" \
"oci://${{ env.REGISTRY }}/${owner}/charts"

- name: Summary
run: |
owner=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
v="${{ steps.v.outputs.version }}"
{
echo "### Helm chart \`pingmailer\` $v"
echo "### Helm chart \`opengovmail\` $v"
echo
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "Dry run — lint, render and package passed. Nothing pushed."
else
echo "Published to \`oci://${{ env.REGISTRY }}/${owner}/charts/pingmailer\`"
echo "Published to \`oci://${{ env.REGISTRY }}/${owner}/charts/opengovmail\`"
echo
echo '```bash'
echo "helm install pingmailer \\"
echo " oci://${{ env.REGISTRY }}/${owner}/charts/pingmailer \\"
echo "helm install opengovmail \\"
echo " oci://${{ env.REGISTRY }}/${owner}/charts/opengovmail \\"
echo " --version $v -n <namespace> -f my-values.yaml"
echo '```'
echo
echo "> New GHCR packages are **private** by default. Make the package"
echo "> public under Packages → pingmailer → Package settings, or"
echo "> public under Packages → opengovmail → Package settings, or"
echo "> consumers must \`helm registry login ghcr.io\` first."
fi
} >> "$GITHUB_STEP_SUMMARY"

- uses: actions/upload-artifact@v4
with:
name: pingmailer-chart-${{ steps.v.outputs.version }}
name: opengovmail-chart-${{ steps.v.outputs.version }}
path: dist/*.tgz
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# PingMailer
# OpenGovMail
**_Simple Email Service for Transactional Emails_**

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
![Last Commit](https://img.shields.io/github/last-commit/Silver-Mail-Platform/pingmailer)
![Last Commit](https://img.shields.io/github/last-commit/OpenGovMail/opengovmail)

**PingMailer** is a lightweight service for sending transactional emails. It provides a simple REST API for email delivery using SMTP, powered by [Silver](https://github.com/LSFLK/silver) mail infrastructure.
**OpenGovMail** is a lightweight service for sending transactional emails. It provides a simple REST API for email delivery over SMTP, backed by its own Postfix/OpenDKIM mail infrastructure.

<p align="center">
• <a href="#features">Features</a> •
Expand All @@ -17,32 +17,32 @@

- **Simple REST API** – Send emails via HTTPS requests
- **Template Support** – Pre-built email templates for common use cases
- **SMTP Integration** – Works with any SMTP server or Silver instance
- **SMTP Integration** – Works with any SMTP server or OpenGovMail instance
- **Lightweight** – Minimal resource footprint
- **Dockerized** – Easy deployment with Docker Compose

## Getting Started

### Prerequisites
- Docker and Docker Compose installed
- SMTP server credentials (or a running Silver instance)
- SMTP server credentials (or a running OpenGovMail instance)

### Quick Start

1. **Clone the repository**
```bash
git clone https://github.com/Silver-Mail-Platform/pingmailer.git
cd pingmailer
git clone https://github.com/OpenGovMail/opengovmail.git
cd opengovmail
```

2. **Set up the mail infrastructure**
```bash
bash mail-infra/scripts/setup/setup.sh
```

3. **Start the Silver mail server**
3. **Start the OpenGovMail mail server**
```bash
bash mail-infra/scripts/service/start-silver.sh
bash mail-infra/scripts/service/start-opengovmail.sh
```

4. **Configure the API server**
Expand Down Expand Up @@ -81,10 +81,10 @@

## Architecture

PingMailer consists of two main components:
OpenGovMail consists of two main components:

- **`api-server/`** - Go-based REST API server for sending templated emails
- **`mail-infra/`** - Silver SMTP components for outgoing mail delivery
- **`mail-infra/`** - OpenGovMail SMTP components for outgoing mail delivery

The API server accepts HTTPS requests and forwards emails through the configured SMTP server. Email templates are stored in `api-server/internal/emailer/templates/`.

Expand Down
16 changes: 8 additions & 8 deletions api-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ run:
go run . -port 8000

build:
go build -o bin/pingmailer-api .
go build -o bin/opengovmail-api .

clean:
rm -rf bin

# Docker commands
docker-build:
docker build -t pingmailer-api .
docker build -t opengovmail-api .

docker-run:
docker run -d \
-p 8000:8000 \
-e PORT=8000 \
--name pingmailer-api \
pingmailer-api
--name opengovmail-api \
opengovmail-api

docker-stop:
docker stop pingmailer-api || true
docker rm pingmailer-api || true
docker stop opengovmail-api || true
docker rm opengovmail-api || true

docker-clean: docker-stop
docker rmi pingmailer-api || true
docker rmi opengovmail-api || true

docker-compose-up:
docker-compose up -d
Expand All @@ -34,7 +34,7 @@ docker-compose-down:
docker-compose down

docker-logs:
docker logs -f pingmailer-api
docker logs -f opengovmail-api

gci:
golangci-lint run
6 changes: 3 additions & 3 deletions api-server/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PingMailer API Server
# OpenGovMail API Server

A simple REST API service for sending emails via SMTP. Part of the Silver Mail Platform.
A simple REST API service for sending emails via SMTP. Part of the OpenGovMail platform.

## Quick Start

Expand All @@ -14,7 +14,7 @@ cp .env.example .env
docker compose up -d

# View logs
docker logs pingmailer-api -f
docker logs opengovmail-api -f
```

The API will be available at `http://your-host:8000/notify`
Expand Down
2 changes: 1 addition & 1 deletion api-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/Silver-Mail-Platform/pingmailer
module github.com/OpenGovMail/opengovmail

go 1.23

Expand Down
2 changes: 1 addition & 1 deletion api-server/internal/api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/mail"
"strconv"

"github.com/Silver-Mail-Platform/pingmailer/internal/emailer"
"github.com/OpenGovMail/opengovmail/internal/emailer"
)

// handleHealth provides a simple health check endpoint
Expand Down
2 changes: 1 addition & 1 deletion api-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"time"

"github.com/Silver-Mail-Platform/pingmailer/internal/api"
"github.com/OpenGovMail/opengovmail/internal/api"
)

func main() {
Expand Down
52 changes: 26 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
services:
smtp-server:
image: ghcr.io/lsflk/silver-smtp:main
image: ghcr.io/opengovmail/opengovmail-smtp:main
container_name: smtp-server-container
ports:
- "25:25"
- "587:587"
volumes:
- ./mail-infra/services/silver-config/postfix/main.cf:/etc/postfix/main.cf:ro
- ./mail-infra/services/silver-config/postfix/master.cf:/etc/postfix/master.cf:ro
- ./mail-infra/services/silver-config/postfix/recipient_access:/etc/postfix/recipient_access:ro
- ./mail-infra/conf/silver.yaml:/etc/postfix/silver.yaml
- ./mail-infra/services/silver-config/certbot/keys/etc:/etc/letsencrypt:ro
- ./mail-infra/services/opengovmail-config/postfix/main.cf:/etc/postfix/main.cf:ro
- ./mail-infra/services/opengovmail-config/postfix/master.cf:/etc/postfix/master.cf:ro
- ./mail-infra/services/opengovmail-config/postfix/recipient_access:/etc/postfix/recipient_access:ro
- ./mail-infra/conf/opengovmail.yaml:/etc/postfix/opengovmail.yaml
- ./mail-infra/services/opengovmail-config/certbot/keys/etc:/etc/letsencrypt:ro
- postfix-spool:/var/spool/postfix
- postfix-logs:/var/log
networks:
Expand All @@ -21,13 +21,13 @@ services:
- raven-sasl-server

raven-sasl-server:
image: ghcr.io/lsflk/raven-sasl:latest
image: ghcr.io/opengovmail/raven-sasl:latest
container_name: raven-sasl
ports:
- "12345:12345"
volumes:
- ./mail-infra/services/silver-config/raven/conf:/etc/raven:rw
- ./mail-infra/services/silver-config/raven/certs:/certs:ro
- ./mail-infra/services/opengovmail-config/raven/conf:/etc/raven:rw
- ./mail-infra/services/opengovmail-config/raven/certs:/certs:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./mail-infra/conf/oauth_client_email_authorization.json:/app/config/oauth_client_email_authorization.json:ro
environment:
Expand All @@ -37,14 +37,14 @@ services:
restart: unless-stopped

opendkim-server:
image: ghcr.io/lsflk/silver-dkim:main
image: ghcr.io/opengovmail/opengovmail-dkim:main
container_name: opendkim-server
volumes:
- ./mail-infra/conf/silver.yaml:/etc/opendkim/silver.yaml
- ./mail-infra/services/silver-config/opendkim/opendkim.conf:/etc/opendkim/opendkim.conf:ro
- ./mail-infra/services/silver-config/opendkim/KeyTable:/etc/opendkim/KeyTable:ro
- ./mail-infra/services/silver-config/opendkim/SigningTable:/etc/opendkim/SigningTable:ro
- ./mail-infra/services/silver-config/opendkim/TrustedHosts:/etc/opendkim/TrustedHosts:ro
- ./mail-infra/conf/opengovmail.yaml:/etc/opendkim/opengovmail.yaml
- ./mail-infra/services/opengovmail-config/opendkim/opendkim.conf:/etc/opendkim/opendkim.conf:ro
- ./mail-infra/services/opengovmail-config/opendkim/KeyTable:/etc/opendkim/KeyTable:ro
- ./mail-infra/services/opengovmail-config/opendkim/SigningTable:/etc/opendkim/SigningTable:ro
- ./mail-infra/services/opengovmail-config/opendkim/TrustedHosts:/etc/opendkim/TrustedHosts:ro
- dkim-keys:/etc/dkimkeys
networks:
- mail-network
Expand All @@ -69,7 +69,7 @@ services:
volumes:
- thunder-db:/opt/thunder/repository/database
- consent-db:/opt/thunder/consent/repository/database
- ./mail-infra/services/silver-config/thunder/deployment.yaml:/opt/thunder/repository/conf/deployment.yaml:ro
- ./mail-infra/services/opengovmail-config/thunder/deployment.yaml:/opt/thunder/repository/conf/deployment.yaml:ro
depends_on:
thunder-db-init:
condition: service_completed_successfully
Expand All @@ -86,22 +86,22 @@ services:
volumes:
- thunder-db:/opt/thunder/repository/database
- consent-db:/opt/thunder/consent/repository/database
- ./mail-infra/services/silver-config/thunder/certs/server.cert:/opt/thunder/repository/resources/security/server.cert:ro
- ./mail-infra/services/silver-config/thunder/certs/server.key:/opt/thunder/repository/resources/security/server.key:ro
- ./mail-infra/services/silver-config/thunder/deployment.yaml:/opt/thunder/repository/conf/deployment.yaml:ro
- ./mail-infra/services/silver-config/thunder/console-config.js:/opt/thunder/apps/console/config.js:ro
- ./mail-infra/services/silver-config/thunder/gate-config.js:/opt/thunder/apps/gate/config.js:ro
- ./mail-infra/services/opengovmail-config/thunder/certs/server.cert:/opt/thunder/repository/resources/security/server.cert:ro
- ./mail-infra/services/opengovmail-config/thunder/certs/server.key:/opt/thunder/repository/resources/security/server.key:ro
- ./mail-infra/services/opengovmail-config/thunder/deployment.yaml:/opt/thunder/repository/conf/deployment.yaml:ro
- ./mail-infra/services/opengovmail-config/thunder/console-config.js:/opt/thunder/apps/console/config.js:ro
- ./mail-infra/services/opengovmail-config/thunder/gate-config.js:/opt/thunder/apps/gate/config.js:ro
networks:
- mail-network
restart: unless-stopped

certbot-server:
image: ghcr.io/lsflk/silver-certbot:main
image: ghcr.io/opengovmail/opengovmail-certbot:main
container_name: certbot-server
volumes:
- ./mail-infra/services/silver-config/certbot/keys/etc:/etc/letsencrypt
- ./mail-infra/services/silver-config/certbot/keys/log:/var/log/letsencrypt
- ./mail-infra/services/silver-config/certbot/keys/lib:/var/lib/letsencrypt
- ./mail-infra/services/opengovmail-config/certbot/keys/etc:/etc/letsencrypt
- ./mail-infra/services/opengovmail-config/certbot/keys/log:/var/log/letsencrypt
- ./mail-infra/services/opengovmail-config/certbot/keys/lib:/var/lib/letsencrypt
ports:
- "80:80"
- "443:443"
Expand All @@ -112,7 +112,7 @@ services:
build:
context: ./api-server
dockerfile: Dockerfile
container_name: pingmailer-api-server
container_name: opengovmail-api-server
restart: unless-stopped
ports:
- "8443:8443"
Expand Down
Loading
Loading