rpmbuilder/rpms/stalwart-foundationdb/resources/scripts/postinstall.sh
Ben Vincent e07235ca98
All checks were successful
Build / build-8 (pull_request) Successful in 58s
Build / build-9 (pull_request) Successful in 2m17s
feat: add Stalwart Mail Server and FoundationDB library packages
- add stalwart: main mail server with systemd integration and user management
- add stalwart-cli: command line interface tool for server administration
- add stalwart-foundationdb: FoundationDB-enabled version with proper dependencies
- add libfoundationdb: FoundationDB client library (libfdb_c.so) package

All packages include proper conflict resolution, systemd services, and follow
repository packaging conventions. stalwart and stalwart-foundationdb are
mutually exclusive to prevent installation conflicts.
2025-10-19 18:08:33 +11:00

55 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# Create default configuration if it doesn't exist
if [ ! -f /opt/stalwart/etc/config.toml ]; then
cat > /opt/stalwart/etc/config.toml << 'EOF'
# Stalwart Mail Server Configuration with FoundationDB
# This is a minimal configuration file. Please customize according to your needs.
# Full documentation: https://stalw.art/docs/
[server]
hostname = "localhost"
[server.listener.smtp]
bind = ["127.0.0.1:25"]
protocol = "smtp"
[server.listener.submission]
bind = ["127.0.0.1:587"]
protocol = "smtp"
[server.listener.imap]
bind = ["127.0.0.1:143"]
protocol = "imap"
[server.listener.http]
bind = ["127.0.0.1:8080"]
protocol = "http"
[storage]
data = "foundationdb"
fts = "foundationdb"
blob = "fs"
lookup = "foundationdb"
directory = "internal"
[store."foundationdb"]
type = "foundationdb"
cluster = "/etc/foundationdb/fdb.cluster"
[store."fs"]
type = "fs"
path = "/var/lib/stalwart/blobs"
[directory."internal"]
type = "internal"
store = "foundationdb"
EOF
chown stalwart:stalwart /opt/stalwart/etc/config.toml
chmod 600 /opt/stalwart/etc/config.toml
fi
# Reload systemd
systemctl daemon-reload