Skip to content

Feature request: JSON config format #548

Open

Description

@Sohalt

Use case

Maddy's uses a custom config format. This makes it hard to integrate maddy with solutions for automatic configuration management (both generating maddy config or parsing maddy config). NixOS for example can very easily generate JSON from it's structured module system, but it is much harder to generate the current maddy config format in a meaningful way from nix.

Your idea for a solution

I propose to introduce a canonical JSON representation of the configuration and a way to convert from the current configuration format to the JSON format (similar to how Caddy uses the human readable Caddyfile format and a machine readable JSON format). This also makes it easier to write various adapters that can translate from other mailserver config (e.g. dovecot) to the equivalent maddy config on a best effort basis (similar to how Caddy has adapters e.g. for nginx).

  • I'm willing to help with the implementation

Activity

  1. vtolstov commented on Oct 28, 2022

    @vtolstov

    I'm not agree with json. Yaml more suitable for config file

  2. Sohalt commented on Oct 28, 2022

    @Sohalt
    Author

    The goal is not to write JSON by hand, but to have a widely used format that's easy to parse and generate from various tools to build automation around maddy config. Also since YAML is a superset of JSON, any valid JSON is also valid YAML (but not the other way around).

  3. foxcpp commented on Oct 28, 2026

    @foxcpp
    Owner

    That would require major refactoring for 2 reasons:

    • maddy config data model does not align well with JSON, it is more XML-like than JSON-like. That would require some ugly hacks to map 1:1.
    • maddy modules directly register configuration directives. There would need to be a new boundary between human-written configuration syntax and used configuration.

    I already plan to do 2 to reduce amount of ugly configuration reading code. I will keep this open with blocked - when such refactoring is completed, we can go back to considering JSON config as an alternative format.

  4. added
    blockedWork needs to be done somewhere else before this can be worked on
    on Oct 28, 2026
  5. moved this from Triage to TODO in Maddy Mail Server Task Trackeron Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedWork needs to be done somewhere else before this can be worked onnew featureNew feature.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions