antedebaas / Viesti-Reports

DMARC & SMTP-TLS Reports processor and visualizer and BIMI file hoster
https://hub.docker.com/repository/docker/antedebaas/viesti-reports/general
GNU General Public License v2.0
75 stars 16 forks source link

BUG: twice or triple mail retrieval #59

Closed bundyland closed 4 months ago

bundyland commented 5 months ago

Hi Ante,

I have noticed that for some time now, the mails have been retrieved three times in a row although according to CRON this should only happen once every hour:

Screenshot 2024-03-22 130009

As a result, if a new report is available in the mailbox, it is imported twice or three times. For example today:

import

I have checked the mailbox, but this report came in definitely only once and not repeated.

As always, many thanks for your work and support.

antedebaas commented 5 months ago

i cant reproduce this. please check if you dont run the command multiple times at once

bundyland commented 4 months ago

i cant reproduce this. please check if you dont run the command multiple times at once

Hi Ante,

sorry to re-open this issue, but I still have the same problem even with the latest release.

As I don't run the mail retrieval command manually, it must be some kind of bug with the integrated CRON scheduler. I have noticed that this doesn't happen immediately after starting the containers, but some times later. Maybe a day or two.

My logs look like this:

Screenshot 2024-04-14 140330

I have just restarted the containers and the mailcheck happens just once in the moment, but later it will happen twice or even triple for sure. Normally I wouldn't care, but unfortunately the new arrived reports are also imported multiple times. That is the real problem.

Is there a way to completely deactivate the integrated CRON mailcheck? I would rather prefer to carry out the mail query manually to avoid this problem. I have deleted the corresponding line from the docker-compose.yml, but this does not seem to deactivate the mail check.

Thank you.

antedebaas commented 4 months ago

i dont have any option to disable the cron implemented no.

can you check the contents of /etc/crontabs/root for me? it should never be called more than once at a time

bundyland commented 4 months ago

Sure, that looks like this:

Screenshot 2024-04-14 140330

antedebaas commented 4 months ago

Hmm looks normal to me. It should check only once per hour. Which it is not doing. I think your calling the check mail command from somewhere else (docker host?) every 30 mins It’s definitely being called from somewhere else. The cron only gets executed on the whole hour.

bundyland commented 4 months ago

I know it sounds strange, but I really don't execute the cron manually. And all other applications that I run in parallel in Docker should not actually have any influence to the Dmarc reader.

Well, I have now changed the cron scheduler to check only once per year and will do the checks manually through a script. If there is really something else who causes the unexpected checks, it should still appear in the logs then. Let's see.

Thanks again for your help.

antedebaas commented 4 months ago

I remember differently; see #27 :)

bundyland commented 4 months ago

Yes, but this was before you have created the possibility to change the cron via the docker compose file. Since that I had removed my script because it was useless. :)

antedebaas commented 4 months ago

ah ok. and just to check you are not running multiple instances of it? (multiple dmarc-report containers and 1 database for example)

antedebaas commented 4 months ago

guess what i managed to reproduce locally: image ill be looking into this

bundyland commented 4 months ago

Hahaha, I thought I'm too stupid. :-)

Thank you!

antedebaas commented 4 months ago

no the container startup script was at fault. it would add a new checkmail.sh line to the crontab on each start of the container fixed in 1.9.4

bundyland commented 4 months ago

Great job, Ante. Thank you very much!