#!/bin/sh . ./myserver.conf . ./utils.sh install_mails_services_pkg() { pkg_add dovecot dovecot-pigeonhole opensmtpd-filter-rspamd redis-6.2.12\ opensmtpd-extras-6.7.1v0 opensmtpd-filter-dkimsign-0.5 rspamd-3.2 } gen_mails_service_configuration() { cp -v default_configuration/opensmtpd/smtpd.conf.example my_configuration/opensmtpd/smtpd.conf sed -i "s/__DOMAIN__/$DOMAIN/g" my_configuration/opensmtpd/smtpd.conf cp -v default_configuration/opensmtpd/spamd.conf.example my_configuration/opensmtpd/spamd.conf cp -v default_configuration/dovecot/dovecot.conf.example my_configuration/dovecot/dovecot.conf cp -v default_configuration/dovecot/local.conf.example my_configuration/dovecot/local.conf sed -i "s/__DOMAIN__/$DOMAIN/g" my_configuration/dovecot/local.conf } gen_dkim_keys() { # Generate dkim key openssl genrsa -out my_configuration/mail/$DOMAIN-private.key 2048 openssl rsa -in my_configuration/mail/$DOMAIN-private.key -pubout | \ sed '1s/.*/v=DKIM1;p=/;:nl;${s/-----.*//;q;};N;s/\n//g;b nl;' > default_configuration/mail/$DOMAIN-public.key } install_dovecot_service_antispam() { # Add antispam utils for Dovecot cd /usr/local/lib/dovecot/sieve cat > report-ham.sieve < report-spam.sieve < sa-learn-ham.sh< sa-learn-spam.sh<> /etc/login.conf <