mirror of
https://github.com/deuill/coreos-home-server.git
synced 2024-09-21 21:50:46 +00:00
Alex Palaistras
d9f675817e
This contains the culmination of work done privately for a few months, and is intended to be a solid basis for other peoples' experimentations with setting up single-node, home-server setups using Fedora CoreOS.
24 lines
836 B
Bash
Executable File
24 lines
836 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Prepare configuration files for environment variable substitution.
|
|
ENV_NAMES="`env | awk -F '=' '{printf "$%s ", $1}'`"
|
|
for file in /etc/dovecot/*.template; do
|
|
envsubst "$ENV_NAMES" < "$file" > "`echo $file | awk -F '.template$' '{print $1}'`"
|
|
done
|
|
|
|
# Prepare other configuration.
|
|
mkdir -p /var/lib/dovecot/script /var/lib/dovecot/sieve
|
|
install -m 0755 /etc/dovecot/conf.d/*.script /var/lib/dovecot/script
|
|
install -m 0644 /etc/dovecot/conf.d/*.sieve /var/lib/dovecot/sieve
|
|
|
|
# Compile Sieve scripts.
|
|
find /etc/dovecot/sieve.* -name '*.sieve' | xargs -I@ sievec @
|
|
find /var/lib/dovecot/sieve -name '*.sieve' | xargs -I@ sievec @
|
|
|
|
# Set up environment variables for Rspamd.
|
|
mkdir -p /etc/dovecot/rspamd
|
|
env | awk -F '_' '$1 == "RSPAMD" {print $0}' > /etc/dovecot/rspamd/rspamd.env
|
|
|
|
# Run Dovecot daemon.
|
|
/usr/sbin/dovecot -F
|