darold / sendmailanalyzer

Sendmail log Analyzer is a tool to monitor sendmail usage and generate HTML and graph reports. It reports all you ever wanted to know about email trafic on your network. You can also use it in ISP environment with per domain and per mailbox report.
http://sendmailanalyzer.darold.net/
GNU General Public License v3.0
75 stars 13 forks source link

Report is empty with docker image #79

Closed trickert76 closed 2 years ago

trickert76 commented 2 years ago

Hi,

i've tried to analyse some logs via the docker image, but the report page is always empty. I can see the calendar and "Last record: 2021 Aug 25 17:43:09" but there are no messages displayed - even the log contains multiple entries. I'm not sure how to debug into the problem:

My docker-compose looks like this

version: '2.3'

services:
  sma:
    restart: always
    build: images/sma
    ports: 
      - 8081:80
    volumes:
      - /var/log/mail.log:/var/log/maillog:ro
      - ./data/data:/usr/local/sendmailanalyzer/data
      - ./data/docroot:/var/www/sendmailanalyzer
      - ./conf/sendmailanalyzer.conf:/usr/local/sendmailanalyzer/sendmailanalyzer.conf
      - ./conf/sendmailanalyzer.conf:/etc/sendmailanalyzer.conf

The image-folder contains the files that are stored in docker directory in this repo.

The config contains this lines

DEBUG         1
HTMP_CHARSET  utf-8
FULL          1
SMTP_AUTH     1
MTA_NAME      postfix
SPAM_TOOLS    dnsbl,clamd,spamd
LOG_FILE      /var/log/maillog

The logfile contains lines like this:

Aug 25 17:19:53 ac-hcp0003 postfix/smtpd[1687150]: connect from mail1301.domain.com[123.123.123.123]
Aug 25 17:19:53 ac-hcp0003 postfix/smtpd[1687150]: 915369C40D: client=mail1301.teamviewer.com[123.123.123.123]
Aug 25 17:19:53 ac-hcp0003 postfix/smtpd[1687150]: disconnect from mail1301.123.123.123.123.com[123.123.123.123] ehlo=2 starttls=1 mail=1 rcpt=1 data=1 quit=1 commands=7
Aug 25 17:19:57 ac-hcp0003 postfix/smtp[1687164]: B59D59C40D: to=<archive@archive.intern>, relay=ac-hrn0002.archive.net[10.240.0.10]:12900, delay=0.06, delays=0.03/0/0/0.03, dsn=2.0.0, status=sent (250 OK <WGRPZ60WS1C7TW8J>)
Aug 25 17:19:58 ac-hcp0003 postfix/smtp[1687167]: B59D59C40D: to=<support@caboya.de>, relay=s0126.domain2.de[234.234.234.234]:25, delay=0.33, delays=0.03/0/0.05/0.25, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C5C3FD1)

I would expect that sendmailanalyzer would found a match for "postfix" here.

The docker-compose logs command isn't very helpful. There is no "debug output at all"

sma_1  | 2021-08-25 15:42:43,383 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
sma_1  | 2021-08-25 15:42:43,384 INFO supervisord started with pid 1
sma_1  | 2021-08-25 15:42:44,387 INFO spawned: 'cron' with pid 11
sma_1  | 2021-08-25 15:42:44,389 INFO spawned: 'sendmailanalyzer' with pid 12
sma_1  | 2021-08-25 15:42:44,390 INFO spawned: 'apache2' with pid 13
sma_1  | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.20.0.2. Set the 'ServerName' directive globally to suppress this message
sma_1  | 2021-08-25 15:42:44,417 INFO success: cron entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
sma_1  | 2021-08-25 15:42:44,418 INFO success: sendmailanalyzer entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
sma_1  | AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 172.20.0.2. Set the 'ServerName' directive globally to suppress this message
sma_1  | [Wed Aug 25 15:42:44.422231 2021] [mpm_event:notice] [pid 15:tid 140440569185408] AH00489: Apache/2.4.48 (Unix) configured -- resuming normal operations
sma_1  | [Wed Aug 25 15:42:44.422475 2021] [core:notice] [pid 15:tid 140440569185408] AH00094: Command line: '/usr/local/apache2/bin/httpd -D FOREGROUND'
sma_1  | Running in verbose mode...
sma_1  | 
sma_1  |    sendmailanalyzer v9.4. (c) 2002-2020 - Gilles Darold <gilles@darold.net>
sma_1  | 
sma_1  | DEBUG: Detach from terminal with pid: 101
sma_1  | DEBUG: Entering main loop...
sma_1  | 2021-08-25 15:42:44,448 INFO exited: sendmailanalyzer (exit status 0; expected)
sma_1  | 2021-08-25 15:42:45,450 INFO success: apache2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
trickert76 commented 2 years ago

Ah, I found the reason - I didn't set DOMAIN_REPORT at all. So, it would be a good idea for docker-environment to add the config example here or at docker-hub to the documentation. It is a little bit confusing to find the necessary configurations and formats for a newbie of SendmailAnalyzer. Make a README.md and link to the example under /usr/local/sendmailanalyzer/doc/sendmailanalyzer.conf.example