oneuptime/Haraka/init.sh
Simon Larsen 6eb228d0b8
chore: Add INCOMING_EMAIL_DOMAIN to host_list configuration
This code change adds the INCOMING_EMAIL_DOMAIN variable to the host_list configuration in the Haraka init.sh script. This ensures that incoming emails from the specified domain are accepted by the Haraka application. The INCOMING_EMAIL_DOMAIN value is appended to the host_list file, allowing the application to properly handle emails from this domain.
2024-05-31 12:59:23 +01:00

29 lines
1.0 KiB
Bash

# Setup auth
echo "domain = $DOMAIN" >> /harakaapp/config/dkim_sign.ini
echo "$DOMAIN" > /harakaapp/config/host_list
echo "$INCOMING_EMAIL_DOMAIN" >> /harakaapp/config/host_list
echo "$DOMAIN" > /harakaapp/config/me
echo "$SMTP_EMAIL=$SMTP_PASSWORD" >> /harakaapp/config/auth_flat_file.ini
openssl req -x509 -nodes -days 2190 -newkey rsa:2048 -keyout /harakaapp/config/tls_key.pem -out /harakaapp/config/tls_cert.pem -subj "/C=US/ST=Massachusetts/L=Boston/O=Hackerbay/CN=$DOMAIN"
# DKIM
mkdir -p /harakaapp/config/dkim/$DOMAIN
touch /harakaapp/config/dkim/$DOMAIN/selector
echo "$DKIM_SELECTOR" > /harakaapp/config/dkim/$DOMAIN/selector
# Decode keys from base64
echo "$DKIM_PUBLIC_KEY" | base64 -d > /harakaapp/config/dkim/$DOMAIN/public
echo "$DKIM_PRIVATE_KEY" | base64 -d > /harakaapp/config/dkim/$DOMAIN/private
echo "IMPORTANT: Add this to your DNS"
echo "You need to add this to DNS"
echo "Type: TXT"
echo "Key: $DKIM_SELECTOR._domainkey"
echo "v=DKIM1;p=$(grep -v '^-' /harakaapp/config/dkim/$DOMAIN/public | tr -d '\n')"
# Run haraka
haraka -c /harakaapp