2023-08-15 13:39:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Setup auth
|
|
|
|
echo "domain = $DOMAIN" >> /harakaapp/config/dkim_sign.ini
|
|
|
|
echo "$DOMAIN" > /harakaapp/config/host_list
|
2024-05-31 11:59:23 +00:00
|
|
|
echo "$INCOMING_EMAIL_DOMAIN" >> /harakaapp/config/host_list
|
2023-08-15 13:39:57 +00:00
|
|
|
echo "$DOMAIN" > /harakaapp/config/me
|
2024-02-18 20:05:34 +00:00
|
|
|
echo "$SMTP_EMAIL=$SMTP_PASSWORD" >> /harakaapp/config/auth_flat_file.ini
|
2023-08-15 13:39:57 +00:00
|
|
|
|
|
|
|
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
|
2023-08-15 20:59:44 +00:00
|
|
|
echo "$DKIM_SELECTOR" > /harakaapp/config/dkim/$DOMAIN/selector
|
2023-08-15 13:39:57 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2023-08-15 20:59:44 +00:00
|
|
|
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')"
|
|
|
|
|
2024-05-30 19:12:07 +00:00
|
|
|
|
2023-08-15 13:39:57 +00:00
|
|
|
# Run haraka
|
|
|
|
haraka -c /harakaapp
|