Fixes for exim and divecot work

This commit is contained in:
Alexey Berezhok
2026-08-10 21:41:37 +03:00
parent b31dce3817
commit 5914f54e64
229 changed files with 104 additions and 17842 deletions

View File

@@ -21,7 +21,7 @@ source_conf "$HESTIA/install/upgrade/upgrade.conf"
#----------------------------------------------------------#
#check if string already exists
if grep "dovecot_virtual_delivery" /etc/exim4/exim4.conf.template; then
if grep "dovecot_virtual_delivery" /etc/exim/exim.conf.template; then
echo "Plugin allready enabled"
exit 0
fi
@@ -60,10 +60,10 @@ if [ "$HAS_DOVECOT_SIEVE_INSTALLED" = "0" ]; then
mkdir -p /etc/dovecot/sieve
echo -e "require [\"fileinto\"];\n# rule:[SPAM]\nif header :contains \"X-Spam-Flag\" \"YES\" {\n fileinto \"INBOX.Spam\";\n}\n" > /etc/dovecot/sieve/default
# exim4 install
sed -i "s/\stransport = local_delivery/ transport = dovecot_virtual_delivery/" /etc/exim4/exim4.conf.template
# exim install
sed -i "s/\stransport = local_delivery/ transport = dovecot_virtual_delivery/" /etc/exim/exim.conf.template
sed -i "s/address_pipe:/dovecot_virtual_delivery:\n driver = pipe\n command = \/usr\/lib\/dovecot\/dovecot-lda -e -d \${extract{1}{:}{\${lookup{\$local_part}lsearch{\/etc\/exim4\/domains\/\${lookup{\$domain}dsearch{\/etc\/exim4\/domains\/}}\/accounts}}}}@\${lookup{\$domain}dsearch{\/etc\/exim4\/domains\/}}\n delivery_date_add\n envelope_to_add\n return_path_add\n log_output = true\n log_defer_output = true\n user = \${extract{2}{:}{\${lookup{\$local_part}lsearch{\/etc\/exim4\/domains\/\${lookup{\$domain}dsearch{\/etc\/exim4\/domains\/}}\/passwd}}}}\n group = mail\n return_output\n\naddress_pipe:/g" /etc/exim4/exim4.conf.template
sed -i "s/address_pipe:/dovecot_virtual_delivery:\n driver = pipe\n command = \/usr\/lib\/dovecot\/dovecot-lda -e -d \${extract{1}{:}{\${lookup{\$local_part}lsearch{\/etc\/exim\/domains\/\${lookup{\$domain}dsearch{\/etc\/exim\/domains\/}}\/accounts}}}}@\${lookup{\$domain}dsearch{\/etc\/exim\/domains\/}}\n delivery_date_add\n envelope_to_add\n return_path_add\n log_output = true\n log_defer_output = true\n user = \${extract{2}{:}{\${lookup{\$local_part}lsearch{\/etc\/exim\/domains\/\${lookup{\$domain}dsearch{\/etc\/exim\/domains\/}}\/passwd}}}}\n group = mail\n return_output\n\naddress_pipe:/g" /etc/exim/exim.conf.template
# roundcube install
mkdir -p $RC_CONFIG_DIR/plugins/managesieve
@@ -82,9 +82,9 @@ if [ "$HAS_DOVECOT_SIEVE_INSTALLED" = "0" ]; then
sed -i "s/\"archive\"/\"archive\", \"managesieve\"/g" $RC_CONFIG_DIR/config.inc.php
#restart dovecot and exim4
#restart dovecot and exim
systemctl restart dovecot > /dev/null 2>&1
systemctl restart exim4 > /dev/null 2>&1
systemctl restart exim > /dev/null 2>&1
else
# Uninstall sieve if it exist
if [ -f "/etc/dovecot/conf.d/90-sieve.conf" ]; then
@@ -111,17 +111,17 @@ else
# If sieve is installed... remove it.
apt-get -qq remove --purge dovecot-sieve -y
# Exim4
sed -i "s/\stransport = dovecot_virtual_delivery/ transport = local_delivery/" /etc/exim4/exim4.conf.template
sed -i "s/dovecot_virtual_delivery:\n driver = pipe\n command = \/usr\/lib\/dovecot\/dovecot-lda -e -d \${extract{1}{:}{\${lookup{\$local_part}lsearch{\/etc\/exim4\/domains\/\${lookup{\$domain}dsearch{\/etc\/exim4\/domains/}}\/accounts}}}}@\${lookup{\$domain}dsearch{\/etc\/exim4\/domains\/}}\n delivery_date_add\n envelope_to_add\n return_path_add\n log_output = true\n log_defer_output = true\n user = \${extract{2}{:}{\${lookup{\$local_part}lsearch{\/etc\/exim4\/domains\/\${lookup{\$domain}dsearch{\/etc\/exim4\/domains\/}}\/passwd}}}}\n group = mail\n return_output\n//g" /etc/exim4/exim4.conf.template
# Exim
sed -i "s/\stransport = dovecot_virtual_delivery/ transport = local_delivery/" /etc/exim/exim.conf.template
sed -i "s/dovecot_virtual_delivery:\n driver = pipe\n command = \/usr\/lib\/dovecot\/dovecot-lda -e -d \${extract{1}{:}{\${lookup{\$local_part}lsearch{\/etc\/exim\/domains\/\${lookup{\$domain}dsearch{\/etc\/exim\/domains/}}\/accounts}}}}@\${lookup{\$domain}dsearch{\/etc\/exim\/domains\/}}\n delivery_date_add\n envelope_to_add\n return_path_add\n log_output = true\n log_defer_output = true\n user = \${extract{2}{:}{\${lookup{\$local_part}lsearch{\/etc\/exim\/domains\/\${lookup{\$domain}dsearch{\/etc\/exim\/domains\/}}\/passwd}}}}\n group = mail\n return_output\n//g" /etc/exim/exim.conf.template
# Roundcube
rm -f -r $RC_CONFIG_DIR/plugins/managesieve
rm -f $RC_INSTALL_DIR/plugins/managesieve/config.inc.php
sed -i "s/\"archive\", \"managesieve\"/\"archive\"/g" $RC_CONFIG_DIR/config.inc.php
#restart dovecot and exim4
#restart dovecot and exim
systemctl restart dovecot > /dev/null 2>&1
systemctl restart exim4 > /dev/null 2>&1
systemctl restart exim > /dev/null 2>&1
fi
fi

View File

@@ -46,8 +46,8 @@ if [ "$IMAP_SYSTEM" == "dovecot" ]; then
systemctl disable --now dovecot
fi
if [ "$MAIL_SYSTEM" == "exim4" ]; then
echo Removing Exim4
if [ "$MAIL_SYSTEM" == "exim" ]; then
echo Removing Exim
sed -i "/^MAIL_SYSTEM/d" $HESTIA/conf/hestia.conf
systemctl disable --now exim4
systemctl disable --now exim
fi

View File

@@ -1,5 +1,5 @@
17a18,19
> SRS_SECRET = ${readfile{/etc/exim4/srs.conf}}
> SRS_SECRET = ${readfile{/etc/exim/srs.conf}}
>
326a332,348
> inbound_srs:
@@ -20,7 +20,7 @@
> data = :fail: Invalid SRS recipient address
>
358d379
< condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/${lookup{$domain}dsearch{/etc/exim4/domains/}}/aliases}{false}{true}}
< condition = ${lookup{$local_part@$domain}lsearch{/etc/exim/domains/${lookup{$domain}dsearch{/etc/exim/domains/}}/aliases}{false}{true}}
387a409,422
> remote_forwarded_smtp:
> driver = smtp