Setup - monozoide/MailLogSentinel GitHub Wiki

Installation & Setup

Prerequisites

  • Python: Python 3.6 or newer is recommended.
  • Mail Server: An active Postfix/Dovecot mail server that is configured to generate SASL authentication logs. These logs are typically found in /var/log/mail.log or a similar system log file, depending on the system's rsyslog or syslog-ng configuration.
  • Local MTA (Mail Transfer Agent): A functional MTA (e.g., Postfix, Sendmail, Exim) must be installed and correctly configured on the server where MailLogSentinel runs. This is essential for MailLogSentinel to be able to send email reports.
  • Permissions:
    • The user account under which maillogsentinel.py will run (the "operational user") requires read access to the mail server's log files. This often involves adding the user to a group like adm.
    • The operational user also needs write access to the working_dir and state_dir directories that will be specified in the configuration file.
    • Root (sudo) privileges are required only for the --setup command, as it may need to create system directories (like /etc/maillogsentinel.conf, /var/log/maillogsentinel), set their permissions, and potentially guide the user in adding the operational user to necessary groups.

Installation

Clone the Repository:

git clone https://github.com/cryptozoide/MailLogSentinel.git
cd MailLogSentinel

Install the Script: It is recommended to place the script in a system-wide accessible location (e.g., /usr/local/bin) and make it executable:

sudo cp bin/maillogsentinel.py /usr/local/bin/maillogsentinel
sudo chmod +x /usr/local/bin/maillogsentinel.py

After installation, you can typically run the script as maillogsentinel.py or by its full path /usr/local/bin/maillogsentinel/maillogsentinel.py.