Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mail stats not working in fresh install of 2.2.4 #3186

Open
pappastech opened this issue Feb 9, 2024 · 9 comments
Open

Mail stats not working in fresh install of 2.2.4 #3186

pappastech opened this issue Feb 9, 2024 · 9 comments

Comments

@pappastech
Copy link

  • OS Type: Debian
  • OS Version: 12.4
  • Database Type: MySQL
  • Modoboa: 2.2.4
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

Install modoboa with installer on Debian 12.4, configure domain(s), identities, get e-mail flowing, look at stats on new-admin and they're empty. A review of the /srv/modoboa/rrdfiles shows that only the "new_accounts.rrd" file is being created.

Current behavior

Only the new_accounts.rrd file is being created as part of the statistics cron job.

rrdfile directory:
image

Manually trying to run the logparser results in the following:
image

Expected behavior

More stats rrd files should be created including an rrd file for postfix log stats from the configured postfix log file (currently /var/log/mail.log)

@pappastech
Copy link
Author

Does anyone have any advice on this issue?

@tonioo
Copy link
Member

tonioo commented Feb 21, 2024

@pappastech Do you have a lot of traffic on this server?

@pappastech
Copy link
Author

@pappastech Do you have a lot of traffic on this server?

Not sure on your definition of "a lot of traffic". The average is usually 20-100 e-mails per hour.

@tonioo
Copy link
Member

tonioo commented Feb 22, 2024

@pappastech The log parser is not very efficient since it analyses the complete file every time it runs (so every 5 mins by default).
You should check how much time is required for it to complete and then adjust the frequency.

@pappastech
Copy link
Author

@pappastech The log parser is not very efficient since it analyses the complete file every time it runs (so every 5 mins by default). You should check how much time is required for it to complete and then adjust the frequency.

I've run the log parser manually and it doesn't take more than 15-20 seconds. The problem is that it's not generating the rrd file at all. My guess is that it's running into an error somewhere in the processing, but doesn't log any errors itself, so I'm not sure where it's going sideways.

As a separate issue, none of the MX, DKIM, DMARC, etc. checks are working correctly at the moment either. In other words, I have all those records created in DNS, but the process to check them somehow doesn't see those records. There's a general lack of things working and it's difficult for me to troubleshoot since the cron tasks aren't logging output anywhere.

@pappastech
Copy link
Author

I did figure out the MX, DKIM record checks. SEPM running on the Hyper-V host was causing that problem. I'm still not seeing log parsing working though; any ideas?

@layer3-fl
Copy link

I have something similar happening on a fresh install of 2.2.4 on top of fresh install of Debian 12. This is something I happened to notice, I don't think the graphs are something I would look at frequently.

root@mail:/home/matto# /srv/modoboa/env/bin/python /srv/modoboa/instance/manage.py logparser
/srv/modoboa/env/lib/python3.11/site-packages/modoboa/maillog/management/commands/logparser.py:97: FutureWarning: Possible nested set at position 29
self._regex = {k: re.compile(v) for k, v in self._regex.items()}

drwxrwx--- 2 modoboa modoboa 4096 Mar 17 08:00 .
drwxr-xr-x 7 modoboa modoboa 4096 Mar 17 07:06 ..
-rw-r--r-- 1 root root 2448 Mar 20 18:00 new_accounts.rrd

My rrdfiles directory is owned by modoboa:modoboa but the present new_accounts.rrd is owned by root where as pappastech's new_accounts.rrd is owned by modoboa. The new accounts graph is working on my setup.

Does python version play any relevance?
root@mail:/home/matto# /srv/modoboa/env/bin/python -V
Python 3.11.2

@tonioo
Copy link
Member

tonioo commented Mar 21, 2024

@layer3-fl And you confirm there is mail traffic on your server?

@layer3-fl
Copy link

@tonioo That is correct. I can also confirm my log file is /var/log/mail.log and I have not made any changes to the statistics parameters in the GUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants