|
@@ -1663,6 +1663,18 @@ function refresh_gpg_keys {
|
1663
|
1663
|
fi
|
1664
|
1664
|
}
|
1665
|
1665
|
|
|
1666
|
+function prevent_mail_process_overrun {
|
|
1667
|
+ # This prevents any large buildup of exim processes, perhaps due to
|
|
1668
|
+ # Tor unavailability, from disabling the server
|
|
1669
|
+ { echo '#!/bin/bash';
|
|
1670
|
+ echo "exim_ctr=\$(pgrep \"exim4\" | wc -l)";
|
|
1671
|
+ echo "if [ \"\$exim_ctr\" -gt 5 ]; then";
|
|
1672
|
+ echo ' exim -bp | exiqgrep -i | xargs exim -Mrm';
|
|
1673
|
+ echo 'fi'; } > /usr/bin/exim_check
|
|
1674
|
+ chmod +x /usr/bin/exim_check
|
|
1675
|
+ cron_add_mins 5 '/usr/bin/exim_check'
|
|
1676
|
+}
|
|
1677
|
+
|
1666
|
1678
|
function install_email {
|
1667
|
1679
|
if [[ $SYSTEM_TYPE == "mesh"* ]]; then
|
1668
|
1680
|
return
|
|
@@ -1675,6 +1687,7 @@ function install_email {
|
1675
|
1687
|
check_email_address_exists
|
1676
|
1688
|
install_email_basic
|
1677
|
1689
|
configure_email_onion
|
|
1690
|
+ prevent_mail_process_overrun
|
1678
|
1691
|
|
1679
|
1692
|
mark_completed "${FUNCNAME[0]}"
|
1680
|
1693
|
}
|