cherti / mailexporter

Export Prometheus-style metrics about mail server functionality
https://prometheus.io
GNU General Public License v3.0
45 stars 9 forks source link

mail_deliver_success #28

Closed supertwister closed 5 years ago

supertwister commented 6 years ago

Hi cherti, Can you describe how does the metric mail_deliver_success works?

I've configured the the parameter mailchecktimeout to 3m. For some reason, Although i can confirm than the mail has been received after a few seconds in the mailbox, I get timeout warning in the logs.

Here are the logs:

Jul 24 16:02:44 ip-10-60-10-69.eu-west-1.compute.internal mailexporter[27915]: DEBUG: composed payload: test-mail-MaY2HzByNBSad6XTfuO1QBJNo3h6PlkFXYHJzdgo-1532437364432026232
Jul 24 16:02:44 ip-10-60-10-69.eu-west-1.compute.internal mailexporter[27915]: DEBUG: sending mail
Jul 24 16:05:44 ip-10-60-10-69.eu-west-1.compute.internal mailexporter[27915]: WARNING: Delivery-Timeout, Message-ID: test-mail-MaY2HzByNBSad6XTfuO1QBJNo3h6PlkFXYHJzdgo-1532437364432026232@domain.com

Here is a screenshot of the email, Where you can see that the email has been received less than a 3 minutes after been sent: 2018_07_24_Mail_Inbox

cherti commented 6 years ago

mailexporter puts an inotify-watcher onto the configured directory and (if everything works correctly) gets the file that is created for the incoming mail once it is created, reading it, looking up if there is any probe pending with that payload and if there is, sets mail_deliver_success to 1. If the timeout runs out before any mail receive is detected, the token is disposed, mail_devliver_success is set to 0. And if the mail comes later when the token is already over timeout/any mail comes in with an unknown token, the counter mail_late_mails_total gets increased by 1.

So for debugging your problem:

supertwister commented 6 years ago

I'm running mailexporter as root.

My OS is Centos 7. inotify was not installed on my server. I have installed it according to this guide. It's seems that directory that has been configured as detectiondir is always empty (Before and after the installation of inotify).

What could be the issue?

cherti commented 6 years ago

Is your mailserver configured to be based on maildir? if that's the case: in which directory does the mail file end up and what is detectiondir configured to be?

cherti commented 5 years ago

Given the lack of activity in this issue, I consider it stale for now. If your problem still persists, feel free to reopen.