mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-12-25 07:47:05 +00:00
commit
2973307cf8
@ -14,7 +14,7 @@ export LC_TYPE=en_US.UTF-8
|
|||||||
if [ `date "+%u"` -eq 1 ]; then
|
if [ `date "+%u"` -eq 1 ]; then
|
||||||
management/mail_log.py -t week | management/email_administrator.py "Mail-in-a-Box Usage Report"
|
management/mail_log.py -t week | management/email_administrator.py "Mail-in-a-Box Usage Report"
|
||||||
|
|
||||||
pflogsumm -u 5 -h 5 --problems_first /var/log/mail.log.1 | management/email_administrator.py "Postfix log analysis summary"
|
/usr/sbin/pflogsumm -u 5 -h 5 --problems_first /var/log/mail.log.1 | management/email_administrator.py "Postfix log analysis summary"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Take a backup.
|
# Take a backup.
|
||||||
|
@ -40,7 +40,7 @@ def get_services():
|
|||||||
{ "name": "Mail Filters (Sieve/dovecot)", "port": 4190, "public": True, },
|
{ "name": "Mail Filters (Sieve/dovecot)", "port": 4190, "public": True, },
|
||||||
{ "name": "HTTP Web (nginx)", "port": 80, "public": True, },
|
{ "name": "HTTP Web (nginx)", "port": 80, "public": True, },
|
||||||
{ "name": "HTTPS Web (nginx)", "port": 443, "public": True, },
|
{ "name": "HTTPS Web (nginx)", "port": 443, "public": True, },
|
||||||
{ "name": "Solr Full Text Search (Jetty)", "port": 8983, "public": False, },
|
{ "name": "Solr Full Text Search", "port": 8983, "public": False, },
|
||||||
]
|
]
|
||||||
|
|
||||||
def run_checks(rounded_values, env, output, pool):
|
def run_checks(rounded_values, env, output, pool):
|
||||||
|
@ -2,7 +2,7 @@ source /etc/mailinabox.conf
|
|||||||
source setup/functions.sh
|
source setup/functions.sh
|
||||||
|
|
||||||
# Add additional packages
|
# Add additional packages
|
||||||
apt_install pflogsumm
|
apt_install pflogsumm rkhunter chkrootkit
|
||||||
|
|
||||||
# Cleanup old spam and trash email
|
# Cleanup old spam and trash email
|
||||||
hide_output install -m 755 conf/cron/miab_clean_mail /etc/cron.weekly/
|
hide_output install -m 755 conf/cron/miab_clean_mail /etc/cron.weekly/
|
||||||
@ -25,3 +25,33 @@ hide_output systemctl restart systemd-journald.service
|
|||||||
cat > /root/.forward << EOF;
|
cat > /root/.forward << EOF;
|
||||||
administrator@$PRIMARY_HOSTNAME
|
administrator@$PRIMARY_HOSTNAME
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Install fake mail script
|
||||||
|
if [ ! -f /usr/local/bin/mail ]; then
|
||||||
|
hide_output install -m 755 tools/fake_mail /usr/local/bin
|
||||||
|
mv -f /usr/local/bin/fake_mail /usr/local/bin/mail
|
||||||
|
fi
|
||||||
|
|
||||||
|
tools/editconf.py /etc/rkhunter.conf \
|
||||||
|
UPDATE_MIRRORS=1 \
|
||||||
|
MIRRORS_MODE=0 \
|
||||||
|
WEB_CMD='""' \
|
||||||
|
ALLOWHIDDENDIR=/etc/.java
|
||||||
|
|
||||||
|
# Check presence of whitelist
|
||||||
|
if ! grep -Fxq "SCRIPTWHITELIST=/usr/local/bin/mail" /etc/rkhunter.conf > /dev/null; then
|
||||||
|
echo "SCRIPTWHITELIST=/usr/local/bin/mail" >> /etc/rkhunter.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
tools/editconf.py /etc/default/rkhunter \
|
||||||
|
CRON_DAILY_RUN='"true"' \
|
||||||
|
CRON_DB_UPDATE='"true"' \
|
||||||
|
APT_AUTOGEN='"true"'
|
||||||
|
|
||||||
|
tools/editconf.py /etc/chkrootkit.conf \
|
||||||
|
RUN_DAILY='"true"' \
|
||||||
|
DIFF_MODE='"true"'
|
||||||
|
|
||||||
|
# Should be last, update expected output
|
||||||
|
rkhunter --propupd
|
||||||
|
chkrootkit -q > /var/log/chkrootkit/log.expected
|
||||||
|
@ -45,7 +45,7 @@ if [ $needs_update == 1 ]; then
|
|||||||
wget_verify \
|
wget_verify \
|
||||||
"https://www.apache.org/dyn/closer.lua?action=download&filename=lucene/solr/$VERSION/solr-$VERSION.tgz" \
|
"https://www.apache.org/dyn/closer.lua?action=download&filename=lucene/solr/$VERSION/solr-$VERSION.tgz" \
|
||||||
$HASH \
|
$HASH \
|
||||||
/tmp/solr.tgz
|
/tmp/solr-$VERSION.tgz
|
||||||
|
|
||||||
tar xzf /tmp/solr-$VERSION.tgz -C /tmp solr-$VERSION/bin/install_solr_service.sh --strip-components=2
|
tar xzf /tmp/solr-$VERSION.tgz -C /tmp solr-$VERSION/bin/install_solr_service.sh --strip-components=2
|
||||||
# install to usr/local, force update, do not start service on installation complete
|
# install to usr/local, force update, do not start service on installation complete
|
||||||
@ -61,7 +61,7 @@ fi
|
|||||||
|
|
||||||
# Add security
|
# Add security
|
||||||
tools/editconf.py /etc/default/solr.in.sh \
|
tools/editconf.py /etc/default/solr.in.sh \
|
||||||
SOLR_IP_WHITELIST="127.0.0.1, [::1]"
|
SOLR_IP_WHITELIST='"127.0.0.1, [::1]"'
|
||||||
|
|
||||||
# Change log dir
|
# Change log dir
|
||||||
if [ ! -d "/var/log/solr" ]; then
|
if [ ! -d "/var/log/solr" ]; then
|
||||||
|
@ -111,7 +111,7 @@ source setup/dns.sh
|
|||||||
source setup/mail-postfix.sh
|
source setup/mail-postfix.sh
|
||||||
source setup/mail-dovecot.sh
|
source setup/mail-dovecot.sh
|
||||||
source setup/mail-users.sh
|
source setup/mail-users.sh
|
||||||
#source setup/solr.sh
|
source setup/solr.sh
|
||||||
source setup/dkim.sh
|
source setup/dkim.sh
|
||||||
source setup/spamassassin.sh
|
source setup/spamassassin.sh
|
||||||
source setup/web.sh
|
source setup/web.sh
|
||||||
|
22
tools/fake_mail
Normal file
22
tools/fake_mail
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Save the command-line information passed to the function
|
||||||
|
# so that I can translate info to call sendmail
|
||||||
|
if read -t 0; then
|
||||||
|
message=`cat`
|
||||||
|
fi
|
||||||
|
script="$0"
|
||||||
|
|
||||||
|
for arg in "$@"; do
|
||||||
|
if [ "$lastarg" == "-s" ]; then
|
||||||
|
subject="$arg"
|
||||||
|
fi
|
||||||
|
if [[ $arg =~ [[:space:]] ]]; then
|
||||||
|
arg=\"$arg\"
|
||||||
|
fi
|
||||||
|
lastarg="$arg"
|
||||||
|
done
|
||||||
|
|
||||||
|
# send message using sendmail
|
||||||
|
echo "Subject: $subject
|
||||||
|
|
||||||
|
$message" | sendmail -F "`hostname -f`" "$lastarg"
|
Loading…
Reference in New Issue
Block a user