Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
docker-haraka/haraka.sh

29 righe
1.0 KiB

#!/bin/bash
# Generate config
if [ ! -f /haraka/config/smtp.ini ]; then
haraka -i /haraka
sed -i -e 's/;user=.*/user=haraka/g' /haraka/config/smtp.ini
sed -i -e 's/;group=.*/group=haraka/g' /haraka/config/smtp.ini
fi
# Specify hostname
echo $HOSTNAME > /haraka/config/host_list
# Create tls directory if it doesn't
mkdir -p /haraka/config/tls
cd /haraka/config/tls
if [ "${USE_LETSENCRYPT,,}" == "yes" -o "${USE_LETSENCRYPT,,}" == "true" ]; then
# Get and install certificates from Let's Encrypt
certbot certonly -n --agree-tos --email "$EMAIL" -d "$HOSTNAME" --standalone --preferred-challenges http
ln -sf /etc/letsencrypt/live/$HOSTNAME/privkey.pem tls-key.pem
ln -sf /etc/letsencrypt/live/$HOSTNAME/fullchain.pem tls-cert.pem
else
# Generate a self-signed certificate for the hostname provided
rm -f tls-key.pem tls-cert.pem
openssl req -subj "/O=Self Signed Certificate/CN=$HOSTNAME" -new -newkey rsa:4096 -days 365 -nodes -x509 -sha256 -keyout tls-key.pem -out tls-cert.pem
fi
cd -
haraka -c /haraka