This commit is contained in:
Bob Mottram 2018-05-09 21:17:07 +01:00
commit b758b2f203
2 changed files with 14 additions and 0 deletions

View File

@ -1663,6 +1663,18 @@ function refresh_gpg_keys {
fi
}
function prevent_mail_process_overrun {
# This prevents any large buildup of exim processes, perhaps due to
# Tor unavailability, from disabling the server
{ echo '#!/bin/bash';
echo "exim_ctr=\$(pgrep \"exim4\" | wc -l)";
echo "if [ \"\$exim_ctr\" -gt 5 ]; then";
echo ' exim -bp | exiqgrep -i | xargs exim -Mrm';
echo 'fi'; } > /usr/bin/exim_check
chmod +x /usr/bin/exim_check
cron_add_mins 5 '/usr/bin/exim_check'
}
function install_email {
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
return
@ -1675,6 +1687,7 @@ function install_email {
check_email_address_exists
install_email_basic
configure_email_onion
prevent_mail_process_overrun
mark_completed "${FUNCNAME[0]}"
}

View File

@ -102,6 +102,7 @@ if [ -d "$PROJECT_DIR" ]; then
email_disable_chunking
rm /etc/exim4/exim4.conf.template.bak*
email_update_onion_domain
prevent_mail_process_overrun
#defrag_filesystem
# reinstall tor from backports