Metadata-Version: 2.3
Name: exim-analytics
Version: 0.1.7
Summary: Tools for parsing exim logs and generating analytics reports.
Author: noaha
Author-email: noaha <noaha@inmotionhosting.com>
Requires-Dist: pyyaml>=6.0
Requires-Dist: rads>=4.2.3
Requires-Dist: requests>=2.32.5
Requires-Python: >=3.13
Description-Content-Type: text/markdown

Library for tracking exim sent mails.

* offset file: this is used to check where we are tailing exim log
* parsed log: this intermediate file contains parsed messages
* sending messages: they're sent to https://git.imhadmin.net/coreys/maillog-api

Used in:
* https://git.imhadmin.net/sharedrads/rads
* https://git.imhadmin.net/vpsrads/vpsrads

```python
from exim_analytics import scraper, parser, Host, config


def run(dry_run: bool = False):
    config.load_config('/opt/dedrads/mailparse/analytics.yaml')
    scraper.init_logging()

    Path("/var/log/mail_analytics").mkdir(parents=True, exist_ok=True)
    scraper.process_hosts(
        [
            Host(
                exim_log_path="/var/log/exim_mainlog",
                offset_file_path="/var/log/exim-analytics/offset.json",
                parsed_log_path="/var/log/exim-analytics/parsed",
                hostname='example01.example.co'
            )
        ],
        platform="dedi",
        dry_run=dry_run,
    )
```