mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-04 15:54:48 +01:00
Initial commit of a log capture and reporting feature
This adds a new section to the admin panel called "Activity", that supplies charts, graphs and details about messages entering and leaving the host. A new daemon captures details of system mail activity by monitoring the /var/log/mail.log file, summarizing it into a sqllite database that's kept in user-data.
This commit is contained in:
32
setup/management-capture.sh
Executable file
32
setup/management-capture.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
source setup/functions.sh
|
||||
source /etc/mailinabox.conf # load global vars
|
||||
|
||||
echo "Installing miabldap-capture daemon..."
|
||||
|
||||
conf="$STORAGE_ROOT/reporting/config.json"
|
||||
|
||||
if [ ! -e "$conf" ]; then
|
||||
mkdir -p $(dirname "$conf")
|
||||
cat > "$conf" <<EOF
|
||||
{
|
||||
"capture": true,
|
||||
"prune_policy": {
|
||||
"frequency_min": 2400,
|
||||
"older_than_days": 30
|
||||
},
|
||||
"drop_disposition": {
|
||||
"failed_login_attempt": false,
|
||||
"suspected_scanner": false,
|
||||
"reject": false
|
||||
}
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
sed "s|%BIN%|$(pwd)|g" conf/miabldap-capture.service > /etc/systemd/system/miabldap-capture.service
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable miabldap-capture
|
||||
systemctl start miabldap-capture
|
||||
@@ -115,6 +115,7 @@ source setup/webmail.sh
|
||||
source setup/nextcloud.sh
|
||||
source setup/zpush.sh
|
||||
source setup/management.sh
|
||||
source setup/management-capture.sh
|
||||
source setup/munin.sh
|
||||
|
||||
# Wait for the management daemon to start...
|
||||
|
||||
Reference in New Issue
Block a user