{"id":16104754,"url":"https://github.com/sergeymakinen/postfix_exporter","last_synced_at":"2026-03-07T03:03:10.575Z","repository":{"id":57649100,"uuid":"445679669","full_name":"sergeymakinen/postfix_exporter","owner":"sergeymakinen","description":"Export Postfix stats to Prometheus","archived":false,"fork":false,"pushed_at":"2025-11-22T00:19:36.000Z","size":164,"stargazers_count":22,"open_issues_count":6,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T02:27:07.804Z","etag":null,"topics":["go","golang","lmtp","mail","postfix","prometheus","prometheus-exporter","smtp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sergeymakinen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-01-07T23:35:55.000Z","updated_at":"2025-11-22T00:19:38.000Z","dependencies_parsed_at":"2023-12-03T15:22:01.084Z","dependency_job_id":"640a21e4-07c5-4c37-98a6-32e073ade83d","html_url":"https://github.com/sergeymakinen/postfix_exporter","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":"0.13793103448275867","last_synced_commit":"744fd93b9cad1994c96f27ec86f84553de26b96b"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/sergeymakinen/postfix_exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fpostfix_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fpostfix_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fpostfix_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fpostfix_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergeymakinen","download_url":"https://codeload.github.com/sergeymakinen/postfix_exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergeymakinen%2Fpostfix_exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30206339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"online","status_checked_at":"2026-03-07T02:00:06.765Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","lmtp","mail","postfix","prometheus","prometheus-exporter","smtp"],"created_at":"2024-10-09T19:06:12.752Z","updated_at":"2026-03-07T03:03:10.567Z","avatar_url":"https://github.com/sergeymakinen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postfix Exporter\n\n[![Test](https://github.com/sergeymakinen/postfix_exporter/actions/workflows/test.yml/badge.svg)](https://github.com/sergeymakinen/postfix_exporter/actions/workflows/test.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sergeymakinen/postfix_exporter/v2)](https://goreportcard.com/report/github.com/sergeymakinen/postfix_exporter/v2)\n[![codecov](https://codecov.io/gh/sergeymakinen/postfix_exporter/branch/main/graph/badge.svg)](https://codecov.io/gh/sergeymakinen/postfix_exporter)\n[![Docker Pulls](https://img.shields.io/docker/pulls/sergeymakinen/postfix_exporter)](https://hub.docker.com/r/sergeymakinen/postfix_exporter)\n\nExport Postfix stats from logs to Prometheus.\n\nTo run it:\n\n```bash\nmake\n./postfix_exporter [flags]\n```\n\n## Using Docker\n\nYou can deploy this exporter using\nthe [sergeymakinen/postfix_exporter](https://hub.docker.com/r/sergeymakinen/postfix_exporter) Docker image.\n\nFor example:\n\n```bash\ndocker pull sergeymakinen/postfix_exporter\n\ndocker run -d -p 9907:9907 -v postfix_logs:/var/log/postfix sergeymakinen/postfix_exporter \\\n  --file.log /var/log/postfix/postfix.log\n```\n\n## Exported metrics\n\n| Metric | Meaning | Labels\n| --- | --- | ---\n| postfix_errors_total | Total number of log records parsing resulted in an error. |\n| postfix_foreign_total | Total number of foreign log records. |\n| postfix_unsupported_total | Total number of unsupported log records. |\n| postfix_postscreen_actions_total | Total number of times postscreen events were collected. | action\n| postfix_connects_total | Total number of times connect events were collected. | subprogram\n| postfix_disconnects_total | Total number of times disconnect events were collected. | subprogram\n| postfix_lost_connections_total | Total number of times lost connection events were collected. | subprogram\n| postfix_not_resolved_hostnames_total | Total number of times not resolved hostname events were collected. | subprogram\n| postfix_statuses_total | Total number of times server message status change events were collected. | subprogram, status\n| postfix_delay_seconds | Delay in seconds for a server to process a message. | subprogram, status\n| postfix_status_replies_total | Total number of times server message status change event replies were collected. Requires [configuration](CONFIGURATION.md) to be present. | subprogram, status, code, enhanced_code, text\n| postfix_smtp_replies_total | Total number of times SMTP server replies were collected. Requires [configuration](CONFIGURATION.md) to be present. | code, enhanced_code, text\n| postfix_milter_actions_total | Total number of times milter events were collected. | subprogram, action\n| postfix_login_failures_total | Total number of times login failure events were collected. | subprogram, method\n| postfix_qmgr_statuses_total | Total number of times Postfix queue manager message status change events were collected. | status\n| postfix_logs_total | Total number of log records processed. | subprogram, severity\n| postfix_noqueue_reject_replies_total | Total number of times NOQUEUE: reject event replies were collected. Requires [configuration](CONFIGURATION.md) to be present. | subprogram, command, code, enhanced_code, text\n\n## Flags\n\n```bash\n./postfix_exporter --help\n```\n\n* __`config.file`:__ Postfix exporter [configuration file](CONFIGURATION.md).\n* __`config.check`:__ If true, validate the config file and then exit.\n* __`collector`:__ Collector type to scrape metrics with. `file` or `journald`.\n* __`postfix.instance`:__ Postfix instance name. `postfix` by default.\n* __`file.log`:__ Path to a file containing Postfix logs. Example: `/var/log/mail.log`.\n* __`journald.path`:__ Path where a systemd journal residing in. A local journal is being used by default.\n* __`journald.unit`:__ Postfix systemd service name. `postfix@-.service` by default.\n* __`journald.since`:__ Time since which to read from a systemd journal. Now by default.\n* __`test`:__ If true, read logs, print metrics and then exit.\n* __`web.listen-address`:__ Address to listen on for web interface and telemetry.\n* __`web.telemetry-path`:__ Path under which to expose metrics.\n* __`log.level`:__ Logging level. `info` by default.\n* __`log.format`:__ Set the log target and format. Example: `logger:syslog?appname=bob\u0026local=7`\n  or `logger:stdout?json=true`.\n\n### TLS and basic authentication\n\nThe postfix_exporter supports TLS and basic authentication.\nTo use TLS and/or basic authentication, you need to pass a configuration file\nusing the `--web.config.file` parameter. The format of the file is described\n[in the exporter-toolkit repository](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md).\n\n### Testing postfix_exporter on your system\n\nThe metrics are computed from the logs, with a time range that goes from the time postfix_exporter is run up to the time where postfix_exporter metrics path is called.  \nIn order to test postfix_exporter regex rulesets on earlier logs, postfix_exporter can be run with with `--test` flag.  \nPlease bear in mind that when using journald as log source, you'll have to specify a minimum journald parsing range, like the last 24h.  \nExample:\n```\npostfix_exporter --config.check --collector journald --journald.unit postfix.service --journald.since 24h --test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergeymakinen%2Fpostfix_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergeymakinen%2Fpostfix_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergeymakinen%2Fpostfix_exporter/lists"}