{"id":13705337,"url":"https://github.com/tierpod/dmarc-report-converter","last_synced_at":"2026-01-03T04:14:58.866Z","repository":{"id":33478291,"uuid":"130162138","full_name":"tierpod/dmarc-report-converter","owner":"tierpod","description":"Convert dmarc reports from xml to human-readable formats","archived":false,"fork":false,"pushed_at":"2024-04-13T23:28:13.000Z","size":1535,"stargazers_count":206,"open_issues_count":9,"forks_count":21,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-14T04:11:31.307Z","etag":null,"topics":["dkim","dmarc","dmarc-reports","golang","html","imap","spf","xml"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tierpod.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}},"created_at":"2018-04-19T05:11:04.000Z","updated_at":"2024-04-15T16:52:08.745Z","dependencies_parsed_at":"2024-03-09T05:31:01.784Z","dependency_job_id":"8d1dfb53-1305-4dfb-99f8-5526df0bcdf7","html_url":"https://github.com/tierpod/dmarc-report-converter","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tierpod%2Fdmarc-report-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tierpod%2Fdmarc-report-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tierpod%2Fdmarc-report-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tierpod%2Fdmarc-report-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tierpod","download_url":"https://codeload.github.com/tierpod/dmarc-report-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224455843,"owners_count":17314193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["dkim","dmarc","dmarc-reports","golang","html","imap","spf","xml"],"created_at":"2024-08-02T22:00:37.959Z","updated_at":"2026-01-03T04:14:58.817Z","avatar_url":"https://github.com/tierpod.png","language":"Go","funding_links":[],"categories":["Security","Go"],"sub_categories":["DMARC"],"readme":"dmarc-report-converter\n======================\n\nConvert DMARC report files from xml to human-readable formats. Files can be located on a local\nfilesystem or on an IMAP server.\n\nExample of html_static output:\n![html](screenshots/html_static.png)\n\nSupport input formats:\n\n* **.xml** file: dmarc report in xml format\n\n* **.gz** file: gzipped dmarc report in xml format\n\n* **.zip** file: zipped dmarc report in xml format\n\n* **.eml** file: an electronic mail format or email saved in plain text - dovecot-report-converter\n  tries to extract .xml, .gz or .zip attachments from found eml files to `input.dir`\n\nSupport output formats:\n\n* **html_static** output file is a HTML, generated from builtin template htmlStaticTmpl (consts.go).\n  This format uses bootstrap hosted on bootstrapcdn, so you don't need to configure self-hosted\n  bootsrap assets.\n\n* **html** output file is a HTML, generated from builtin template htmlTmpl (consts.go ).\n  This format uses self-hosted bootsrap and javascript assets, so you need to configure your web\n  server and *output -\u003e assets_path* option.\n\n* **txt** output file is the plain text, generated from builtin template txtTmpl (consts.go).\n\n* **json** output file is the json, represents dmarc.Report struct.\n\n* **external_template** output file generated from external template file. Path to this file\n  must be set with *output -\u003e external_template* option. Builtin template txtTmpl (consts.go) can\n  be used as example.\n\nInstallation\n------------\n\n1. Get installation archive. There are two ways: download pre-built archive from\n   [github releases](https://github.com/tierpod/dmarc-report-converter/releases) page or\n   [build from sources](#building-from-sources)\n\n2. Unpack to destination directory, for example to \"/opt\":\n\n   ```bash\n   sudo tar -xvf dmarc-report-converter*.tar.gz -C /opt\n   ```\n\n3. Copy example config file and [edit](#configuration):\n\n   ```bash\n   cd /opt/dmarc-report-converter/\n   sudo cp config.dist.yaml config.yaml\n   sudo nano config.yaml\n   ```\n\n4. If you want to use \"html\" output, you have to configure your web server to serve **assets**\n   directory and change assets_path in configuration file. Example for nginx:\n\n   ```bash\n   sudo cp -r assets /usr/share/nginx/html\n   ```\n\n   config.yaml:\n\n   ```yaml\n   output:\n     assets_path: \"/dmarc/assets\"\n   ```\n\n   location configuration:\n\n   ```nginx\n   location /dmarc/ {\n       root /usr/share/nginx/html;\n       autoindex           on;\n       autoindex_localtime on;\n   }\n   ```\n\n    and go to the http://your-web-server/dmarc\n\n### docker compose\n\nThere is a Docker Compose wrapper created by @nielsbom (thanks!):\n\nhttps://github.com/nielsbom/dmarc_report_viewer\n\n### Nix\n\nThere is a Nix package [dmarc-report-converter][1] created by @Nebucatnetzer (thanks!):\n\nConfiguration\n-------------\n\nCopy config/config.dist.yaml to config.yaml and change parameters:\n\n* **lookup_addr** (bool): perform reverse lookup? If enabled, may take some time.\n\n* **lookup_limit** (int): limit lookup pool size; must be positive; default = 50\n\n* **merge_reports** (bool): merge multiple similar reports to one?\n\n* **merge_key** (string): Go template string used to generate a key to merge\n  reports.  Only used when `merge_reports` is enabled.\n  Default is `{{ .ReportMetadata.OrgName }}!{{ .ReportMetadata.Email }}!{{ .PolicyPublished.Domain }}`.\n\n* **log_debug** (bool): print debug log messages?\n\n* **log_datetime** (bool): add datetime to log messages?\n\n**input** section:\n\n* **dir** (str): directory with input files\n\n* **delete** (bool): delete source files after conversion?\n\n* **imap** *(optional section)*: dmarc-report-converter can fetch reports from IMAP server and save\n  them to **input -\u003e dir** before conversion started. To achieve this, configure this subsection.\n\n  * **server**, **username**, **password**, **mailbox** (str): IMAP server address, credentials and\n    mailbox name\n\n  * **delete** (bool): delete email messages from IMAP server if reports are fetched successfully\n\n  * **debug** (bool): print debug messages during IMAP session?\n\n  * **security** (str): select encryption between \"tls\" (default), \"starttls\" or \"plaintext\"\n\n**output** section:\n\n* **file** (str): output file, should be string or golang template. If value is empty string *\"\"* or\n  *\"stdout\"*, print result to stdout. Inside golang template any field from *dmarc.Report* struct\n  can be used, or shortcuts *.ID*, *.TodayID*\n\n* **format** (str): output format (txt, json, html_static, html, external_template)\n\n* **assets_path** (str, *optional for html format*): path to assets for html output format.\n\n* **external_template** (str, *mandatory for external_template format*): path to external template\n  file\n\nTemplates\n---------\n\nExternal templates can reference to dmarc.Report struct as `.` (dot, see consts.go for example).\n\nAdditional functions can be used:\n\n* `now \"2006-2-1\"` returns current date and time, first argument is the golang time format.\n\nDaily reports\n--------------\n\nIf you want to convert reports daily:\n\n* Set **input -\u003e delete: yes** and **input -\u003e imap -\u003e delete: yes**, because all old reports should\n  be deleted from the source\n\n* Set **merge_reports: no** (do not merge any reports, use as-is)\n\n* Execute dmarc-report-converter every day (add daily crontab job or systemd timer):\n\n  ```bash\n  sudo cp install/dmarc-report-converter.sh /etc/cron.daily/\n  ```\n\n* Use **{{ .ID }}** or **{{ .TodayID }}** shortcut in **output -\u003e file**\n\nWeekly or monthly reports\n-------------------------\n\nMany providers send reports to your email address every day. If you want to make weekly or monthly\nreports:\n\n* Set **input -\u003e delete: yes** and **input -\u003e imap -\u003e delete: yes**, because all old reports should\n  be deleted from the source\n\n* Set **merge_reports: yes**, because all similar reports should be merged\n\n* Execute dmarc-report-converter every **week** / **month** (add weekly / monthly crontab job or\n  systemd timer)\n\n* Use **{{ .TodayID }}** shortcut in **output -\u003e file**, if you want to create output file with\n  current date in filename (instead of begin report date).\n\nBuilding from sources\n---------------------\n\n1. Install go compiler and building tools:\n\n   ```bash\n   # debian/ubuntu\n   sudo apt-get install golang-go make git tar\n\n   # centos/fedora, enable epel-release repo first\n   sudo yum install epel-release\n   sudo yum install golang make git tar\n   ```\n\n   or follow [official instruction](https://golang.org/dl/)\n\n2. Download sources:\n\n   ```bash\n   git clone https://github.com/tierpod/dmarc-report-converter.git\n   ```\n\n3. Build binary and create installation archive:\n\n   ```bash\n   cd dmarc-report-converter\n   make release\n   ```\n\n4. Installation archive will be places inside _dist_ directory. Also, if you want to test\n   dmarc-report-converter without installation, you can execute:\n\n   ```bash\n   ./bin/dmarc-report-converter -config /path/to/config.yaml\n   ```\n\nThanks\n------\n\n* [bootstrap](https://getbootstrap.com/)\n* [jquery](http://jquery.com/)\n* [ChartJS](http://chartjs.org/)\n* [golang emersion packages](https://github.com/emersion) (go-imap, go-message, go-sasl, go-textwrapper)\n\nAnd we have a lot of [contributors](https://github.com/tierpod/dmarc-report-converter/graphs/contributors)!\n\n[1]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/dm/dmarc-report-converter/package.nix\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftierpod%2Fdmarc-report-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftierpod%2Fdmarc-report-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftierpod%2Fdmarc-report-converter/lists"}