{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "description": "The server (smtpd) running configuration",
    "markdownDescription": "The server (`smtpd`) [running configuration](https://docs.halon.io/manual/archive/master/config_smtpd.html)",
    "additionalProperties": false,
    "required": [
        "version"
    ],
    "properties": {
        "version": {
            "type": "string",
            "enum": [
                "6.11"
            ],
            "description": "The software version the configuration was created for"
        },
        "servers": {
            "type": "array",
            "uniqueItems": true,
            "description": "The virtual servers (listeners)",
            "items": {
                "oneOf": [
                    {
                        "type": "object",
                        "required": [
                            "id",
                            "transport"
                        ],
                        "additionalProperties": false,
                        "properties": {
                            "id": {
                                "$ref": "#/definitions/objectid",
                                "description": "Server ID"
                            },
                            "type": {
                                "enum": [
                                    "smtp"
                                ],
                                "default": "smtp"
                            },
                            "phases": {
                                "type": "object",
                                "description": "Settings and script hooks for the SMTP phases",
                                "additionalProperties": false,
                                "properties": {
                                    "connect": {
                                        "type": "object",
                                        "description": "The connect phase",
                                        "markdownDescription": "The [connect](https://docs.halon.io/hsl/connect.html) phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "hook": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "Connect script ID to run"
                                            },
                                            "remoteptr": {
                                                "type": "boolean",
                                                "default": false,
                                                "description": "Perform a forward-confirmed reverse DNS (FCrDNS) lookup"
                                            }
                                        }
                                    },
                                    "proxy": {
                                        "type": "object",
                                        "description": "The proxy script hook, that runs before any other script for the specified commands",
                                        "markdownDescription": "The [proxy](https://docs.halon.io/hsl/proxy.html) script hook, that runs before any other script for the specified commands",
                                        "additionalProperties": false,
                                        "required": [
                                            "hook"
                                        ],
                                        "properties": {
                                            "hook": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "Proxy script ID to run"
                                            },
                                            "patterns": {
                                                "type": "array",
                                                "uniqueItems": true,
                                                "description": "The command pattern for which to run the proxy script",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "helo": {
                                        "type": "object",
                                        "description": "The HELO/EHLO phase",
                                        "markdownDescription": "The [HELO/EHLO](https://docs.halon.io/hsl/helo.html) phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "hook": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "HELO script ID to run",
                                                "markdownDescription": "`HELO` script ID to run"
                                            },
                                            "required": {
                                                "type": "boolean",
                                                "default": false,
                                                "description": "If the client is required to send the HELO command",
                                                "markdownDescription": "If the client is required to send the `HELO` command"
                                            }
                                        }
                                    },
                                    "auth": {
                                        "type": "object",
                                        "description": "The AUTH phase",
                                        "markdownDescription": "The [AUTH](https://docs.halon.io/hsl/auth.html) phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "hook": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "AUTH script ID to run",
                                                "markdownDescription": "`AUTH` script ID to run"
                                            },
                                            "mechanisms": {
                                                "type": "array",
                                                "uniqueItems": true,
                                                "description": "The SASL mechanisms to announce, defaults to the built-in types [\"LOGIN\", \"PLAIN\"] if omitted",
                                                "markdownDescription": "The SASL mechanisms to announce, defaults to the built-in types `[\"LOGIN\", \"PLAIN\"]` if omitted",
                                                "items": {
                                                    "type": "string"
                                                }
                                            },
                                            "tlsrequired": {
                                                "type": "boolean",
                                                "default": false,
                                                "description": "Require TLS for authentication"
                                            }
                                        }
                                    },
                                    "mailfrom": {
                                        "type": "object",
                                        "description": "The MAIL FROM phase",
                                        "markdownDescription": "The [MAIL FROM](https://docs.halon.io/hsl/mailfrom.html) phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "hook": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "MAIL FROM script ID to run",
                                                "markdownDescription": "`MAIL FROM` script ID to run"
                                            },
                                            "maxmessages": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "description": "The max number of messages per connection"
                                            },
                                            "unqualified": {
                                                "type": "boolean",
                                                "default": false,
                                                "description": "Allow unqualified MAIL FROM domain"
                                            }
                                        }
                                    },
                                    "rcptto": {
                                        "oneOf": [
                                            {
                                                "type": "object",
                                                "description": "The RCPT TO phase",
                                                "markdownDescription": "The [RCPT TO](https://docs.halon.io/hsl/rcptto.html) phase",
                                                "additionalProperties": false,
                                                "properties": {
                                                    "hook": {
                                                        "$ref": "#/definitions/objectid",
                                                        "description": "RCPT TO script ID to run",
                                                        "markdownDescription": "`RCPT TO` script ID to run"
                                                    },
                                                    "maxrecipients": {
                                                        "type": "integer",
                                                        "default": 1000,
                                                        "description": "The max number of recipients per message"
                                                    },
                                                    "maxdomains": {
                                                        "type": "integer",
                                                        "description": "The max number of unique recipient domains per message"
                                                    },
                                                    "unqualified": {
                                                        "type": "boolean",
                                                        "default": false,
                                                        "description": "Allow unqualified RCPT TO domain"
                                                    }
                                                }
                                            },
                                            {
                                                "type": "object",
                                                "description": "The RCPT TO phase",
                                                "markdownDescription": "The [RCPT TO](https://docs.halon.io/hsl/rcptto.html) phase",
                                                "required": [
                                                    "hook"
                                                ],
                                                "additionalProperties": false,
                                                "properties": {
                                                    "hook": {
                                                        "type": "object",
                                                        "description": "The RCPT TO phase",
                                                        "markdownDescription": "The [RCPT TO](https://docs.halon.io/hsl/rcptto.html) phase",
                                                        "additionalProperties": false,
                                                        "properties": {
                                                            "id": {
                                                                "$ref": "#/definitions/objectid",
                                                                "description": "RCPT TO script ID to run",
                                                                "markdownDescription": "`RCPT TO` script ID to run"
                                                            },
                                                            "maxrecipients": {
                                                                "type": "integer",
                                                                "default": 1000,
                                                                "description": "The max number of recipients per message"
                                                            },
                                                            "maxdomains": {
                                                                "type": "integer",
                                                                "description": "The max number of unique recipient domains per message"
                                                            },
                                                            "unqualified": {
                                                                "type": "boolean",
                                                                "default": false,
                                                                "description": "Allow unqualified RCPT TO domain"
                                                            },
                                                            "recipientdomains": {
                                                                "type": "object",
                                                                "description": "The RCPT TO phase",
                                                                "markdownDescription": "The [RCPT TO](https://docs.halon.io/hsl/rcptto.html) phase",
                                                                "additionalProperties": true
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        ]
                                    },
                                    "data": {
                                        "type": "object",
                                        "description": "The DATA command phase",
                                        "markdownDescription": "The `DATA` command phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "maxsize": {
                                                "oneOf": [
                                                    {
                                                        "type": "integer",
                                                        "default": 10485760,
                                                        "description": "The max message size (in bytes)"
                                                    },
                                                    {
                                                        "$ref": "#/definitions/byteformat",
                                                        "description": "The max message size (in byte format)"
                                                    }
                                                ]
                                            },
                                            "maxheadersize": {
                                                "oneOf": [
                                                    {
                                                        "type": "integer",
                                                        "default": 524288,
                                                        "description": "The max message header size (in bytes)"
                                                    },
                                                    {
                                                        "$ref": "#/definitions/byteformat",
                                                        "description": "The max message header size (in byte format)"
                                                    }
                                                ]
                                            },
                                            "maxhops": {
                                                "type": "integer",
                                                "default": 50,
                                                "description": "The max number of Received headers allowed (loop detection)"
                                            },
                                            "receivedheader": {
                                                "default": true,
                                                "description": "Add a Received header",
                                                "anyOf": [
                                                    {
                                                        "type": "object",
                                                        "additionalProperties": false,
                                                        "properties": {
                                                            "from": {
                                                                "type": "boolean",
                                                                "default": true,
                                                                "description": "Add recipient information (from)"
                                                            },
                                                            "for": {
                                                                "type": "boolean",
                                                                "default": false,
                                                                "description": "Add recipient information (for)"
                                                            },
                                                            "tls": {
                                                                "type": "boolean",
                                                                "default": false,
                                                                "description": "Add TLS information (tls)"
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "type": "boolean"
                                                    }
                                                ]
                                            },
                                            "fixheaders": {
                                                "type": "boolean",
                                                "default": false,
                                                "description": "Start the message body (by adding a newline) if a bad header is found"
                                            },
                                            "multipart": {
                                                "default": true,
                                                "description": "Parse MIME multipart content of message",
                                                "anyOf": [
                                                    {
                                                        "type": "object",
                                                        "additionalProperties": false,
                                                        "properties": {
                                                            "maxparts": {
                                                                "default": 512,
                                                                "type": "integer",
                                                                "minimum": 1,
                                                                "description": "Max multipart bodies per message"
                                                            },
                                                            "fixheaders": {
                                                                "type": "boolean",
                                                                "default": false,
                                                                "description": "Start the MIME multipart body (by adding a newline) if a bad header is found"
                                                            },
                                                            "strict": {
                                                                "type": "boolean",
                                                                "default": true,
                                                                "description": "Enforce stricter multipart parsing"
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "type": "boolean"
                                                    }
                                                ]
                                            }
                                        }
                                    },
                                    "eod": {
                                        "type": "object",
                                        "description": "The end-of-DATA phase",
                                        "markdownDescription": "The [end-of-DATA](https://docs.halon.io/hsl/eodonce.html) phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "hook": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "The EOD script ID",
                                                "markdownDescription": "End-of-`DATA` script ID to run"
                                            }
                                        }
                                    },
                                    "disconnect": {
                                        "type": "object",
                                        "description": "The disconnect phase",
                                        "markdownDescription": "The [disconnect](https://docs.halon.io/hsl/disconnect.html) phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "hook": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "Disconnect script ID to run"
                                            }
                                        }
                                    }
                                }
                            },
                            "transport": {
                                "oneOf": [
                                    {
                                        "$ref": "#/definitions/objectid",
                                        "description": "Transport label ID"
                                    },
                                    {
                                        "type": "object",
                                        "description": "Transport label IDs",
                                        "required": [
                                            "id"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "id": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "Default transport label ID"
                                            },
                                            "recipientdomains": {
                                                "type": "object",
                                                "description": "Transport label per recipient domain",
                                                "additionalProperties": true
                                            }
                                        }
                                    }
                                ]
                            },
                            "hostname": {
                                "type": "string",
                                "minLength": 1,
                                "description": "HELO/EHLO hostname"
                            },
                            "extensions": {
                                "type": "object",
                                "description": "SMTP extensions",
                                "additionalProperties": false,
                                "properties": {
                                    "xclient": {
                                        "description": "Allow use of the XCLIENT command from IP(s)",
                                        "default": false,
                                        "anyOf": [
                                            {
                                                "type": "array",
                                                "uniqueItems": true,
                                                "items": {
                                                    "oneOf": [
                                                        {
                                                            "$ref": "#/definitions/ipv4"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv4net"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv6"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv6net"
                                                        }
                                                    ]
                                                },
                                                "description": "A list of IP addresses"
                                            },
                                            {
                                                "type": "boolean",
                                                "description": "true is any IP address and false is disabled",
                                                "markdownDescription": "`true` is any IP address and `false` is disabled"
                                            }
                                        ]
                                    },
                                    "pipelining": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Enable support for the PIPELINING extension"
                                    },
                                    "smtputf8": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Enable support for the SMTPUTF8 extension"
                                    },
                                    "chunking": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Enable support for the CHUNKING extension"
                                    }
                                }
                            },
                            "tls": {
                                "type": "object",
                                "description": "TLS related settings",
                                "required": [
                                    "certs"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "certs": {
                                        "description": "The certificates to present",
                                        "type": "object",
                                        "required": [
                                            "cert"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "cert": {
                                                "oneOf": [
                                                    {
                                                        "$ref": "#/definitions/objectid",
                                                        "description": "The key ID"
                                                    },
                                                    {
                                                        "type": "array",
                                                        "uniqueItems": true,
                                                        "items": {
                                                            "$ref": "#/definitions/objectid",
                                                            "description": "The key ID"
                                                        },
                                                        "description": "A list of certificates"
                                                    }
                                                ]
                                            },
                                            "sni": {
                                                "type": "array",
                                                "uniqueItems": true,
                                                "description": "The SNI settings",
                                                "items": {
                                                    "type": "object",
                                                    "required": [
                                                        "cert"
                                                    ],
                                                    "additionalProperties": false,
                                                    "properties": {
                                                        "cert": {
                                                            "oneOf": [
                                                                {
                                                                    "$ref": "#/definitions/objectid",
                                                                    "description": "The key ID"
                                                                },
                                                                {
                                                                    "type": "array",
                                                                    "uniqueItems": true,
                                                                    "items": {
                                                                        "$ref": "#/definitions/objectid",
                                                                        "description": "The key ID"
                                                                    },
                                                                    "description": "A list of certificates"
                                                                }
                                                            ]
                                                        },
                                                        "subjects": {
                                                            "type": "array",
                                                            "uniqueItems": true,
                                                            "items": {
                                                                "type": "string",
                                                                "description": "Subject"
                                                            },
                                                            "description": "A list of subjects"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    "protocols": {
                                        "type": "string",
                                        "description": "Which TLS protocols to support",
                                        "default": "!SSLv2,!SSLv3"
                                    },
                                    "ciphers": {
                                        "type": "string",
                                        "description": "Which TLS ciphers to support (<=TLSv1.2)",
                                        "default": "aNULL:-aNULL:HIGH:MEDIUM:+RC4:@STRENGTH"
                                    },
                                    "ciphersuites": {
                                        "type": "string",
                                        "description": "Which TLS cipher suites to support (TLSv1.3)"
                                    },
                                    "groups": {
                                        "type": "string",
                                        "description": "Which TLS supported groups to use for key exchange"
                                    },
                                    "clientcert": {
                                        "description": "Request client certificate from IP(s)",
                                        "default": false,
                                        "anyOf": [
                                            {
                                                "type": "array",
                                                "uniqueItems": true,
                                                "items": {
                                                    "oneOf": [
                                                        {
                                                            "$ref": "#/definitions/ipv4"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv4net"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv6"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv6net"
                                                        }
                                                    ]
                                                },
                                                "description": "A list of IP addresses"
                                            },
                                            {
                                                "type": "boolean",
                                                "description": "true is any IP address and false is disabled",
                                                "markdownDescription": "`true` is any IP address and `false` is disabled"
                                            }
                                        ]
                                    },
                                    "implicit": {
                                        "description": "Enable implicit TLS",
                                        "default": false,
                                        "anyOf": [
                                            {
                                                "type": "array",
                                                "uniqueItems": true,
                                                "items": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string",
                                                            "description": "Listen ID"
                                                        }
                                                    ]
                                                },
                                                "description": "A list of ID of listeners"
                                            },
                                            {
                                                "type": "boolean",
                                                "description": "Use true to enable for all listeners",
                                                "markdownDescription": "Use `true` to enable for all listeners"
                                            }
                                        ]
                                    }
                                }
                            },
                            "concurrency": {
                                "type": "object",
                                "description": "The concurrency settings",
                                "additionalProperties": false,
                                "properties": {
                                    "total": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "default": 1000,
                                        "description": "The max amount of concurrent connections"
                                    },
                                    "ip": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "description": "The max amount of concurrent connections per IP"
                                    },
                                    "reserved": {
                                        "type": "object",
                                        "description": "The reserved concurrent connections",
                                        "additionalProperties": false,
                                        "properties": {
                                            "total": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "description": "The number of reserved connections"
                                            },
                                            "priority": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "description": "The priority of reserved connections"
                                            },
                                            "remoteips": {
                                                "description": "A list of IP addresses",
                                                "type": "array",
                                                "uniqueItems": true,
                                                "items": {
                                                    "anyOf": [
                                                        {
                                                            "$ref": "#/definitions/ipv4"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv6"
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            "priority": {
                                "type": "object",
                                "description": "Priority connections",
                                "additionalProperties": false,
                                "properties": {
                                    "remoteips": {
                                        "description": "A list of IP addresses",
                                        "type": "array",
                                        "uniqueItems": true,
                                        "items": {
                                            "anyOf": [
                                                {
                                                    "$ref": "#/definitions/ipv4"
                                                },
                                                {
                                                    "$ref": "#/definitions/ipv4net"
                                                },
                                                {
                                                    "$ref": "#/definitions/ipv6"
                                                },
                                                {
                                                    "$ref": "#/definitions/ipv6net"
                                                }
                                            ]
                                        }
                                    }
                                }
                            },
                            "commands": {
                                "type": "object",
                                "description": "Command specific limitations",
                                "additionalProperties": false,
                                "properties": {
                                    "maxidle": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "default": 100,
                                        "description": "The max amount of idle commands (RSET, NOOP) before disconnect"
                                    },
                                    "maxbad": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "default": 10,
                                        "description": "The max amount of bad commands (syntax errors or bad commands) before disconnect"
                                    }
                                }
                            },
                            "timeout": {
                                "type": "object",
                                "description": "The timeout settings",
                                "additionalProperties": false,
                                "properties": {
                                    "idle": {
                                        "oneOf": [
                                            {
                                                "type": "integer",
                                                "minimum": 1,
                                                "default": 300,
                                                "description": "The max idle time"
                                            },
                                            {
                                                "$ref": "#/definitions/timeformat",
                                                "description": "The max idle time (in time format)"
                                            }
                                        ]
                                    }
                                }
                            },
                            "logging": {
                                "type": "object",
                                "description": "The logging related settings",
                                "additionalProperties": false,
                                "properties": {
                                    "protocol": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Enable protocol logging"
                                    },
                                    "hook": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Enable hook pre- and postamble logging"
                                    }
                                }
                            },
                            "productname": {
                                "type": "string",
                                "default": "Halon",
                                "description": "The software name"
                            },
                            "compatibility": {
                                "type": "object",
                                "description": "The compatibility related settings",
                                "additionalProperties": false,
                                "properties": {
                                    "synchronization": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "Enable strict protocol synchronization"
                                    },
                                    "barelf": {
                                        "description": "Allow Bare LF in SMTP (forbidden in rfc5321). The default is to auto-detect.",
                                        "anyOf": [
                                            {
                                                "type": "array",
                                                "uniqueItems": true,
                                                "items": {
                                                    "oneOf": [
                                                        {
                                                            "$ref": "#/definitions/ipv4"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv4net"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv6"
                                                        },
                                                        {
                                                            "$ref": "#/definitions/ipv6net"
                                                        }
                                                    ]
                                                },
                                                "description": "A list of IP addresses to allow bare LF"
                                            },
                                            {
                                                "type": "boolean"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    {
                        "type": "object",
                        "required": [
                            "id",
                            "type",
                            "transport"
                        ],
                        "additionalProperties": false,
                        "allOf": [
                            {
                                "if": {
                                    "properties": {
                                        "type": {
                                            "const": "https"
                                        }
                                    }
                                },
                                "then": {
                                    "required": [
                                        "tls"
                                    ]
                                }
                            },
                            {
                                "if": {
                                    "required": [
                                        "type"
                                    ],
                                    "properties": {
                                        "type": {
                                            "const": "http"
                                        }
                                    }
                                },
                                "then": {
                                    "not": {
                                        "required": [
                                            "tls"
                                        ]
                                    }
                                }
                            }
                        ],
                        "dependentSchemas": {
                            "tls": {
                                "properties": {
                                    "type": {
                                        "enum": [
                                            "https"
                                        ]
                                    }
                                },
                                "required": [
                                    "tls"
                                ]
                            }
                        },
                        "properties": {
                            "id": {
                                "$ref": "#/definitions/objectid",
                                "description": "Server ID"
                            },
                            "type": {
                                "enum": [
                                    "http",
                                    "https"
                                ]
                            },
                            "phases": {
                                "type": "object",
                                "description": "Settings and script hooks for the HTTP phases",
                                "additionalProperties": false,
                                "properties": {
                                    "auth": {
                                        "type": "object",
                                        "description": "The AUTH phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "apikeys": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "data": {
                                        "type": "object",
                                        "description": "The DATA command phase",
                                        "markdownDescription": "The `DATA` command phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "maxsize": {
                                                "oneOf": [
                                                    {
                                                        "type": "integer",
                                                        "default": 10485760,
                                                        "description": "The max message size (in bytes)"
                                                    },
                                                    {
                                                        "$ref": "#/definitions/byteformat",
                                                        "description": "The max message size (in byte format)"
                                                    }
                                                ]
                                            },
                                            "receivedheader": {
                                                "default": true,
                                                "description": "Add a Received header",
                                                "anyOf": [
                                                    {
                                                        "type": "object",
                                                        "additionalProperties": false,
                                                        "properties": {
                                                            "from": {
                                                                "type": "boolean",
                                                                "default": true,
                                                                "description": "Add recipient information (from)"
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "type": "boolean"
                                                    }
                                                ]
                                            },
                                            "multipart": {
                                                "default": true,
                                                "description": "Parse MIME multipart content of message",
                                                "type": "boolean"
                                            }
                                        }
                                    },
                                    "eod": {
                                        "type": "object",
                                        "description": "The end-of-DATA phase",
                                        "markdownDescription": "The [end-of-DATA](https://docs.halon.io/hsl/eodonce.html) phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "hook": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "The EOD script ID",
                                                "markdownDescription": "End-of-`DATA` script ID to run"
                                            }
                                        }
                                    }
                                }
                            },
                            "transport": {
                                "oneOf": [
                                    {
                                        "$ref": "#/definitions/objectid",
                                        "description": "Transport label ID"
                                    },
                                    {
                                        "type": "object",
                                        "description": "Transport label IDs",
                                        "required": [
                                            "id"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "id": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "Default transport label ID"
                                            },
                                            "recipientdomains": {
                                                "type": "object",
                                                "description": "Transport label per recipient domain",
                                                "additionalProperties": true
                                            }
                                        }
                                    }
                                ]
                            },
                            "hostname": {
                                "type": "string",
                                "minLength": 1,
                                "description": "HELO/EHLO hostname"
                            },
                            "logging": {
                                "type": "object",
                                "description": "The logging related settings",
                                "additionalProperties": false,
                                "properties": {
                                    "hook": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Enable hook pre- and postamble logging"
                                    }
                                }
                            },
                            "productname": {
                                "type": "string",
                                "default": "Halon",
                                "description": "The software name"
                            },
                            "tls": {
                                "type": "object",
                                "description": "TLS related settings",
                                "required": [
                                    "certs"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "certs": {
                                        "description": "The certificates to present",
                                        "type": "object",
                                        "required": [
                                            "cert"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "cert": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "The key ID"
                                            }
                                        }
                                    }
                                }
                            },
                            "concurrency": {
                                "type": "object",
                                "description": "The concurrency settings",
                                "additionalProperties": false,
                                "properties": {
                                    "total": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "default": 1000,
                                        "description": "The max amount of concurrent connections"
                                    }
                                }
                            },
                            "proxy": {
                                "type": "object",
                                "additionalProperties": false,
                                "description": "The proxy settings",
                                "properties": {
                                    "xforwardedfor": {
                                        "type": "boolean",
                                        "default": false,
                                        "description": "If the 'X-Forwarded-For' header should be trusted"
                                    }
                                }
                            }
                        }
                    },
                    {
                        "type": "object",
                        "required": [
                            "id",
                            "type",
                            "transport"
                        ],
                        "additionalProperties": false,
                        "properties": {
                            "id": {
                                "$ref": "#/definitions/objectid",
                                "description": "Server ID"
                            },
                            "type": {
                                "enum": [
                                    "plugin"
                                ]
                            },
                            "phases": {
                                "type": "object",
                                "description": "Settings and script hooks for the plugin phases",
                                "additionalProperties": false,
                                "properties": {
                                    "data": {
                                        "type": "object",
                                        "description": "The DATA command phase",
                                        "markdownDescription": "The `DATA` command phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "multipart": {
                                                "default": true,
                                                "description": "Parse MIME multipart content of message",
                                                "type": "boolean"
                                            }
                                        }
                                    },
                                    "eod": {
                                        "type": "object",
                                        "description": "The end-of-DATA phase",
                                        "markdownDescription": "The [end-of-DATA](https://docs.halon.io/hsl/eodonce.html) phase",
                                        "additionalProperties": false,
                                        "properties": {
                                            "hook": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "The EOD script ID",
                                                "markdownDescription": "End-of-`DATA` script ID to run"
                                            }
                                        }
                                    }
                                }
                            },
                            "transport": {
                                "oneOf": [
                                    {
                                        "$ref": "#/definitions/objectid",
                                        "description": "Transport label ID"
                                    },
                                    {
                                        "type": "object",
                                        "description": "Transport label IDs",
                                        "required": [
                                            "id"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "id": {
                                                "$ref": "#/definitions/objectid",
                                                "description": "Default transport label ID"
                                            },
                                            "recipientdomains": {
                                                "type": "object",
                                                "description": "Transport label per recipient domain",
                                                "additionalProperties": true
                                            }
                                        }
                                    }
                                ]
                            },
                            "hostname": {
                                "type": "string",
                                "minLength": 1,
                                "description": "HELO/EHLO hostname"
                            },
                            "logging": {
                                "type": "object",
                                "description": "The logging related settings",
                                "additionalProperties": false,
                                "properties": {
                                    "hook": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "Enable hook pre- and postamble logging"
                                    }
                                }
                            },
                            "productname": {
                                "type": "string",
                                "default": "Halon",
                                "description": "The software name"
                            }
                        }
                    }
                ]
            }
        },
        "queues": {
            "type": "object",
            "description": "Queue settings",
            "additionalProperties": false,
            "properties": {
                "concurrency": {
                    "type": "object",
                    "description": "Concurrency settings",
                    "additionalProperties": false,
                    "properties": {
                        "total": {
                            "type": "integer",
                            "description": "Max concurrent connections",
                            "default": 10000,
                            "minimum": 1
                        }
                    }
                },
                "pooling": {
                    "type": "object",
                    "description": "Pooling settings",
                    "additionalProperties": false,
                    "properties": {
                        "size": {
                            "type": "integer",
                            "description": "Max idle connections in the connection pool",
                            "default": 1000,
                            "minimum": 0
                        },
                        "policy": {
                            "type": "string",
                            "enum": [
                                "remote",
                                "remotemx",
                                "grouping"
                            ],
                            "default": "remote",
                            "description": "Connection pooling reuse policy"
                        }
                    }
                },
                "maxmessages": {
                    "type": "integer",
                    "description": "Max messages in all queues",
                    "default": 0
                },
                "grouping": {
                    "type": "object",
                    "description": "Global groupings",
                    "additionalProperties": false,
                    "properties": {
                        "default": {
                            "type": "string",
                            "enum": [
                                "remotemx",
                                "recipientdomain",
                                "remoteip"
                            ],
                            "description": "The default grouping value"
                        },
                        "groupings": {
                            "description": "List of groupings",
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "id"
                                ],
                                "properties": {
                                    "id": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "Grouping ID"
                                    },
                                    "unique": {
                                        "type": "string",
                                        "enum": [
                                            "remoteip"
                                        ],
                                        "description": "Create groupings per unique"
                                    },
                                    "remotemx": {
                                        "description": "List of remotemx groupings",
                                        "type": "array",
                                        "minItems": 1,
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "$ref": "#/definitions/wildcard"
                                                },
                                                {
                                                    "$ref": "#/definitions/regex"
                                                },
                                                {
                                                    "$ref": "#/definitions/domain"
                                                }
                                            ]
                                        }
                                    },
                                    "recipientdomain": {
                                        "description": "List of recipientdomain groupings",
                                        "type": "array",
                                        "minItems": 1,
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "$ref": "#/definitions/wildcard"
                                                },
                                                {
                                                    "$ref": "#/definitions/regex"
                                                },
                                                {
                                                    "$ref": "#/definitions/domain"
                                                }
                                            ]
                                        }
                                    },
                                    "remoteip": {
                                        "description": "List of remoteip groupings",
                                        "type": "array",
                                        "minItems": 1,
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "$ref": "#/definitions/ipv4"
                                                },
                                                {
                                                    "$ref": "#/definitions/ipv4net"
                                                },
                                                {
                                                    "$ref": "#/definitions/ipv6"
                                                },
                                                {
                                                    "$ref": "#/definitions/ipv6net"
                                                }
                                            ]
                                        }
                                    }
                                }
                            },
                            "minProperties": 1
                        }
                    }
                },
                "pickup": {
                    "type": "object",
                    "description": "Queue pickup settings",
                    "additionalProperties": false,
                    "properties": {
                        "prereaddata": {
                            "oneOf": [
                                {
                                    "type": "integer",
                                    "minimum": 1,
                                    "description": "Pre-fetch data for messages from disk (up to X bytes)"
                                },
                                {
                                    "$ref": "#/definitions/byteformat",
                                    "description": "Pre-fetch data for messages from disk (up to X bytes in byte format)"
                                }
                            ]
                        },
                        "backpressure": {
                            "type": "integer",
                            "minimum": 1,
                            "description": "Enable backpressure if there are more than amount of uncompleted post-delivery tasks"
                        }
                    }
                }
            }
        },
        "resolver": {
            "type": "object",
            "description": "DNS resolver settings",
            "additionalProperties": false,
            "properties": {
                "domain": {
                    "type": "object",
                    "description": "Domain cache",
                    "additionalProperties": false,
                    "properties": {
                        "cache": {
                            "type": "object",
                            "description": "Domain cache",
                            "required": [
                                "size"
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "size": {
                                    "type": "integer",
                                    "description": "Max size (entries) the domain cache",
                                    "default": 10000,
                                    "minimum": 1
                                }
                            }
                        },
                        "priority": {
                            "type": "array",
                            "uniqueItems": true,
                            "description": "A list of priority domains",
                            "items": {
                                "$ref": "#/definitions/domain"
                            }
                        }
                    }
                },
                "priority": {
                    "type": "object",
                    "description": "Resolver priority settings",
                    "properties": {
                        "dedup": {
                            "type": "integer",
                            "description": "Upgrade dedup queues with this amount of items to high priority",
                            "default": 1000,
                            "minimum": 0
                        }
                    }
                },
                "cache": {
                    "type": "object",
                    "description": "Enable the DNS cache",
                    "required": [
                        "size"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "ttl": {
                            "type": "object",
                            "description": "Normalize TTL values in the DNS cache",
                            "additionalProperties": false,
                            "properties": {
                                "min": {
                                    "oneOf": [
                                        {
                                            "type": "integer",
                                            "description": "Minimum TTL (in seconds)",
                                            "minimum": 1
                                        },
                                        {
                                            "$ref": "#/definitions/timeformat",
                                            "description": "Minimum TTL (in time format)"
                                        }
                                    ]
                                },
                                "max": {
                                    "oneOf": [
                                        {
                                            "type": "integer",
                                            "description": "Maximum TTL (in seconds)",
                                            "minimum": 1
                                        },
                                        {
                                            "$ref": "#/definitions/timeformat",
                                            "description": "Maximum TTL (in time format)"
                                        }
                                    ]
                                }
                            }
                        },
                        "size": {
                            "type": "integer",
                            "description": "Max size (entries) the DNS cache",
                            "minimum": 1
                        }
                    }
                },
                "concurrency": {
                    "type": "integer",
                    "description": "Max concurrent DNS queries",
                    "default": 100,
                    "minimum": 1
                },
                "preference": {
                    "oneOf": [
                        {
                            "type": "string",
                            "enum": [
                                "ipv4",
                                "ipv6"
                            ],
                            "default": "ipv6",
                            "description": "Address family preference"
                        },
                        {
                            "type": "null",
                            "description": "No address family preference"
                        }
                    ]
                },
                "exclude": {
                    "type": "array",
                    "uniqueItems": true,
                    "description": "A list of type to exclude",
                    "items": {
                        "type": "string",
                        "enum": [
                            "ipv4",
                            "ipv6",
                            "tlsa"
                        ]
                    }
                },
                "mx": {
                    "type": "object",
                    "description": "MX resolving settings",
                    "required": [
                        "exclude"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "exclude": {
                            "type": "object",
                            "description": "Exclude RR from results",
                            "additionalProperties": false,
                            "properties": {
                                "ip": {
                                    "type": "array",
                                    "uniqueItems": true,
                                    "description": "Exclude IP from results",
                                    "items": {
                                        "oneOf": [
                                            {
                                                "$ref": "#/definitions/ipv4"
                                            },
                                            {
                                                "$ref": "#/definitions/ipv4net"
                                            },
                                            {
                                                "$ref": "#/definitions/ipv6"
                                            },
                                            {
                                                "$ref": "#/definitions/ipv6net"
                                            }
                                        ]
                                    }
                                },
                                "mx": {
                                    "type": "array",
                                    "uniqueItems": true,
                                    "description": "Exclude MX from results",
                                    "items": {
                                        "oneOf": [
                                            {
                                                "$ref": "#/definitions/wildcard"
                                            },
                                            {
                                                "$ref": "#/definitions/domain"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "plugins": {
            "type": "array",
            "uniqueItems": true,
            "description": "A list of following plugins",
            "items": {
                "type": "object",
                "required": [
                    "id"
                ],
                "additionalProperties": false,
                "properties": {
                    "id": {
                        "$ref": "#/definitions/objectid",
                        "description": "Plugin ID"
                    },
                    "config": {
                        "oneOf": [
                            {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "The plugin config"
                            },
                            {
                                "type": "string",
                                "description": "A path to the configuration"
                            }
                        ]
                    }
                }
            }
        },
        "scripting": {
            "type": "object",
            "description": "The scripting related settings",
            "additionalProperties": false,
            "properties": {
                "hooks": {
                    "type": "object",
                    "description": "The phase script hooks",
                    "additionalProperties": false,
                    "properties": {
                        "connect": {
                            "type": "array",
                            "description": "The connect phase scripts",
                            "markdownDescription": "The [connect](https://docs.halon.io/hsl/connect.html) phase scripts",
                            "items": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "data"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The Connect script ID"
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "The script"
                                    }
                                }
                            }
                        },
                        "proxy": {
                            "type": "array",
                            "description": "The proxy scripts",
                            "markdownDescription": "The [proxy](https://docs.halon.io/hsl/proxy.html) scripts",
                            "items": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "data"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The proxy script ID"
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "The script"
                                    }
                                }
                            }
                        },
                        "helo": {
                            "type": "array",
                            "description": "The HELO/EHLO phase scripts",
                            "markdownDescription": "The [HELO/EHLO](https://docs.halon.io/hsl/helo.html) phase scripts",
                            "items": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "data"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The HELO script ID",
                                        "markdownDescription": "The `HELO` script ID"
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "The script"
                                    }
                                }
                            }
                        },
                        "auth": {
                            "type": "array",
                            "description": "The AUTH phase scripts",
                            "markdownDescription": "The [AUTH](https://docs.halon.io/hsl/auth.html) phase scripts",
                            "items": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "data"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The AUTH script ID",
                                        "markdownDescription": "The `AUTH` script ID"
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "The script"
                                    }
                                }
                            }
                        },
                        "mailfrom": {
                            "type": "array",
                            "description": "The MAIL FROM phase scripts",
                            "markdownDescription": "The [MAIL FROM](https://docs.halon.io/hsl/mailfrom.html) phase scripts",
                            "items": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "data"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The MAIL FROM script ID",
                                        "markdownDescriptions": "The `MAIL FROM` script ID"
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "The script"
                                    }
                                }
                            }
                        },
                        "rcptto": {
                            "type": "array",
                            "description": "The RCPT TO phase scripts",
                            "markdownDescription": "The [RCPT TO](https://docs.halon.io/hsl/rcptto.html) phase scripts",
                            "items": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "data"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The RCPT TO script ID",
                                        "markdownDescription": "The `RCPT TO` script ID"
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "The script"
                                    }
                                }
                            }
                        },
                        "eod": {
                            "type": "array",
                            "description": "The end-of-DATA phase scripts",
                            "markdownDescription": "The [end-of-DATA](https://docs.halon.io/hsl/eodonce.html) phase scripts",
                            "items": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "data"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The end-of-DATA script ID",
                                        "markdownDescription": "The end-of-`DATA` script ID"
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "The script"
                                    }
                                }
                            }
                        },
                        "disconnect": {
                            "type": "array",
                            "description": "The disconnect phase scripts",
                            "markdownDescription": "The [disconnect](https://docs.halon.io/hsl/disconnect.html) phase scripts",
                            "items": {
                                "type": "object",
                                "required": [
                                    "id",
                                    "data"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The Disconnect script ID"
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "The script"
                                    }
                                }
                            }
                        },
                        "predelivery": {
                            "description": "The pre-delivery script",
                            "markdownDescription": "The [pre-delivery](https://docs.halon.io/hsl/predelivery.html) script",
                            "type": "string"
                        },
                        "postdelivery": {
                            "description": "The post-delivery script",
                            "markdownDescription": "The [post-delivery](https://docs.halon.io/hsl/postdelivery.html) script",
                            "type": "string"
                        }
                    }
                },
                "files": {
                    "type": "array",
                    "uniqueItems": true,
                    "description": "The virtual files; script, text or CSV",
                    "items": {
                        "oneOf": [
                            {
                                "type": "object",
                                "required": [
                                    "id",
                                    "data"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 64,
                                        "description": "The file ID"
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "The script"
                                    },
                                    "binary": {
                                        "type": "boolean",
                                        "description": "True if the data property contains base64 encoded (binary) data"
                                    }
                                }
                            },
                            {
                                "type": "object",
                                "required": [
                                    "id",
                                    "path"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "id": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 64,
                                        "description": "The file ID"
                                    },
                                    "path": {
                                        "type": "string",
                                        "description": "The script file path relative to scripting.rootpath"
                                    }
                                }
                            }
                        ]
                    }
                }
            }
        },
        "postmaster": {
            "type": "object",
            "description": "Postmaster contact information",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "type": "string",
                    "minLength": 1,
                    "default": "Postmaster",
                    "description": "The name"
                },
                "address": {
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 3,
                            "description": "The postmaster address"
                        },
                        {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "localpart"
                            ],
                            "properties": {
                                "localpart": {
                                    "type": "string",
                                    "minLength": 1,
                                    "default": "postmaster",
                                    "description": "The postmaster address localpart"
                                },
                                "domain": {
                                    "type": "string",
                                    "minLength": 1,
                                    "description": "The postmaster address domain. The default is the reporting MTA."
                                }
                            }
                        }
                    ]
                }
            }
        },
        "transportgroups": {
            "type": "array",
            "uniqueItems": true,
            "description": "The transport group profiles",
            "items": {
                "type": "object",
                "required": [
                    "id"
                ],
                "additionalProperties": false,
                "properties": {
                    "id": {
                        "$ref": "#/definitions/objectid",
                        "description": "The transport group ID"
                    },
                    "connection": {
                        "$ref": "#/definitions/connection"
                    },
                    "session": {
                        "$ref": "#/definitions/session"
                    },
                    "retry": {
                        "$ref": "#/definitions/retry"
                    },
                    "dsn": {
                        "$ref": "#/definitions/dsn"
                    },
                    "transports": {
                        "type": "array",
                        "uniqueItems": true,
                        "description": "The transport profiles",
                        "items": {
                            "type": "object",
                            "required": [
                                "id"
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "id": {
                                    "$ref": "#/definitions/objectid",
                                    "description": "The transport ID"
                                },
                                "connection": {
                                    "$ref": "#/definitions/connection"
                                },
                                "session": {
                                    "$ref": "#/definitions/session"
                                },
                                "retry": {
                                    "$ref": "#/definitions/retry"
                                },
                                "dsn": {
                                    "oneOf": [
                                        {
                                            "$ref": "#/definitions/dsn"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "pki": {
            "type": "object",
            "description": "The X.509 certificates and private keys",
            "additionalProperties": false,
            "properties": {
                "private": {
                    "type": "array",
                    "uniqueItems": true,
                    "description": "Private keys, possibly with X.509 certificates",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "id"
                        ],
                        "properties": {
                            "id": {
                                "$ref": "#/definitions/objectid",
                                "description": "The key ID"
                            },
                            "certificate": {
                                "oneOf": [
                                    {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "required": [
                                            "data"
                                        ],
                                        "properties": {
                                            "data": {
                                                "type": "string",
                                                "minLength": 1,
                                                "description": "The PKCS #8 PEM data"
                                            }
                                        }
                                    },
                                    {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "required": [
                                            "path"
                                        ],
                                        "properties": {
                                            "path": {
                                                "type": "string",
                                                "minLength": 1,
                                                "description": "The PKCS #8 PEM path"
                                            }
                                        }
                                    }
                                ]
                            },
                            "privatekey": {
                                "oneOf": [
                                    {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "required": [
                                            "data"
                                        ],
                                        "properties": {
                                            "data": {
                                                "type": "string",
                                                "minLength": 1,
                                                "description": "The private key data"
                                            }
                                        }
                                    },
                                    {
                                        "type": "object",
                                        "additionalProperties": false,
                                        "required": [
                                            "path"
                                        ],
                                        "properties": {
                                            "path": {
                                                "type": "string",
                                                "minLength": 1,
                                                "description": "The private key path"
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        },
        "addresses": {
            "type": "array",
            "uniqueItems": true,
            "description": "Address mapping",
            "items": {
                "type": "object",
                "required": [
                    "id",
                    "address"
                ],
                "additionalProperties": false,
                "properties": {
                    "id": {
                        "$ref": "#/definitions/objectid",
                        "description": "The address ID"
                    },
                    "address": {
                        "description": "The IP address",
                        "anyOf": [
                            {
                                "$ref": "#/definitions/ipv4"
                            },
                            {
                                "$ref": "#/definitions/ipv6"
                            }
                        ]
                    },
                    "hostname": {
                        "type": "string",
                        "description": "Reverse address",
                        "minLength": 1
                    },
                    "proxyprotocol": {
                        "$ref": "#/definitions/proxyprotocol"
                    }
                }
            }
        },
        "lists": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "jobid": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/jobid"
                                },
                                {
                                    "$ref": "#/definitions/regex"
                                }
                            ]
                        }
                    },
                    "minProperties": 1
                },
                "tenantid": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/tenantid"
                                },
                                {
                                    "$ref": "#/definitions/regex"
                                }
                            ]
                        }
                    },
                    "minProperties": 1
                },
                "grouping": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/grouping"
                                },
                                {
                                    "$ref": "#/definitions/wildcard"
                                },
                                {
                                    "$ref": "#/definitions/regex"
                                }
                            ]
                        }
                    },
                    "minProperties": 1
                },
                "localip": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/ipv4"
                                },
                                {
                                    "$ref": "#/definitions/ipv4net"
                                },
                                {
                                    "$ref": "#/definitions/ipv6"
                                },
                                {
                                    "$ref": "#/definitions/ipv6net"
                                }
                            ]
                        }
                    },
                    "minProperties": 1
                },
                "remoteip": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/ipv4"
                                },
                                {
                                    "$ref": "#/definitions/ipv4net"
                                },
                                {
                                    "$ref": "#/definitions/ipv6"
                                },
                                {
                                    "$ref": "#/definitions/ipv6net"
                                }
                            ]
                        }
                    },
                    "minProperties": 1
                },
                "transportid": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/objectid"
                                },
                                {
                                    "$ref": "#/definitions/regex"
                                }
                            ]
                        }
                    },
                    "minProperties": 1
                },
                "recipientdomain": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/wildcard"
                                },
                                {
                                    "$ref": "#/definitions/regex"
                                },
                                {
                                    "$ref": "#/definitions/domain"
                                }
                            ]
                        }
                    },
                    "minProperties": 1
                },
                "remotemx": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "array",
                        "items": {
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/wildcard"
                                },
                                {
                                    "$ref": "#/definitions/regex"
                                },
                                {
                                    "$ref": "#/definitions/domain"
                                }
                            ]
                        }
                    },
                    "minProperties": 1
                }
            }
        },
        "monitor": {
            "type": "object",
            "description": "Monitoring interface settings",
            "additionalProperties": false,
            "allOf": [
                {
                    "if": {
                        "properties": {
                            "type": {
                                "const": "https"
                            }
                        }
                    },
                    "then": {
                        "required": [
                            "tls"
                        ]
                    }
                },
                {
                    "if": {
                        "required": [
                            "type"
                        ],
                        "properties": {
                            "type": {
                                "const": "http"
                            }
                        }
                    },
                    "then": {
                        "not": {
                            "required": [
                                "tls"
                            ]
                        }
                    }
                }
            ],
            "dependentSchemas": {
                "tls": {
                    "properties": {
                        "type": {
                            "enum": [
                                "https"
                            ]
                        }
                    },
                    "required": [
                        "tls"
                    ]
                }
            },
            "properties": {
                "type": {
                    "enum": [
                        "http",
                        "https"
                    ]
                },
                "tls": {
                    "type": "object",
                    "description": "TLS related settings",
                    "required": [
                        "certs"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "certs": {
                            "description": "The certificates to present",
                            "type": "object",
                            "required": [
                                "cert"
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "cert": {
                                    "$ref": "#/definitions/objectid",
                                    "description": "The key ID"
                                }
                            }
                        }
                    }
                },
                "apikeys": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "metrics": {
                    "type": "array",
                    "uniqueItems": false,
                    "minItems": 1,
                    "description": "Custom metrics",
                    "items": {
                        "oneOf": [
                            {
                                "type": "object",
                                "required": [
                                    "name",
                                    "type"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Metric name",
                                        "minLength": 1
                                    },
                                    "help": {
                                        "type": "string",
                                        "description": "Metric help"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "counter",
                                            "gauge"
                                        ],
                                        "description": "Metric type"
                                    }
                                }
                            },
                            {
                                "type": "object",
                                "required": [
                                    "name",
                                    "type",
                                    "buckets"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Metric name",
                                        "minLength": 1
                                    },
                                    "help": {
                                        "type": "string",
                                        "description": "Metric help"
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "histogram"
                                        ],
                                        "description": "Metric type"
                                    },
                                    "buckets": {
                                        "type": "array",
                                        "minItems": 1,
                                        "description": "Metric buckets",
                                        "items": {
                                            "type": "number"
                                        }
                                    }
                                }
                            }
                        ]
                    }
                },
                "concurrency": {
                    "type": "object",
                    "description": "The concurrency settings",
                    "additionalProperties": false,
                    "properties": {
                        "total": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1000,
                            "description": "The max amount of concurrent connections"
                        }
                    }
                },
                "healthy": {
                    "type": "object",
                    "description": "Additional healthy settings",
                    "additionalProperties": false,
                    "properties": {
                        "maxmessages": {
                            "type": "object",
                            "description": "Max messages in queue (for healthy check to fail)",
                            "additionalProperties": false,
                            "properties": {
                                "upper": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "description": "Max messages in all queues"
                                },
                                "lower": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "description": "Lower bound to reenable the system. The default is upper - 1"
                                }
                            }
                        },
                        "spoolfreebytes": {
                            "type": "object",
                            "description": "Minimum free bytes on the spool disk (for healthy check to fail)",
                            "additionalProperties": false,
                            "properties": {
                                "upper": {
                                    "oneOf": [
                                        {
                                            "type": "integer",
                                            "minimum": 1,
                                            "description": "Minimum free bytes on the spool disk"
                                        },
                                        {
                                            "$ref": "#/definitions/byteformat",
                                            "description": "Minimum free bytes on the spool disk (in byte format)"
                                        }
                                    ]
                                },
                                "lower": {
                                    "oneOf": [
                                        {
                                            "type": "integer",
                                            "minimum": 0,
                                            "description": "Lower bound to reenable the system. The default is upper - 1"
                                        },
                                        {
                                            "$ref": "#/definitions/byteformat",
                                            "description": "Lower bound to reenable the system (in byte format). The default is upper - 1"
                                        }
                                    ]
                                }
                            }
                        },
                        "spoolfreeinodes": {
                            "type": "object",
                            "description": "Minimum free inodes on the spool disk (for healthy check to fail)",
                            "additionalProperties": false,
                            "properties": {
                                "upper": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "description": "Minimum free inodes on the spool disk"
                                },
                                "lower": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "description": "Lower bound to reenable the system. The default is upper - 1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "x-experimental": {
            "type": "object",
            "description": "Test experimental features",
            "additionalProperties": true
        }
    },
    "definitions": {
        "objectid": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9-_.]+$",
            "minLength": 1,
            "maxLength": 64
        },
        "jobid": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$).*$",
            "minLength": 1
        },
        "tenantid": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$).*$",
            "minLength": 1
        },
        "grouping": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$).*$",
            "minLength": 1
        },
        "regex": {
            "type": "string",
            "pattern": "^/.*/$",
            "minLength": 2
        },
        "ipv4": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)(?:(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(\\.(?!$)|$)){4}$",
            "minLength": 7
        },
        "ipv4net": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)(?:(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(\\.(?!$)|\/[0-9]+$)){4}$",
            "minLength": 9
        },
        "ipv6": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$",
            "minLength": 3
        },
        "ipv6net": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/[0-9]+$",
            "minLength": 3
        },
        "wildcard": {
            "type": "string",
            "pattern": "^[*][.][a-zA-Z0-9_.-]+$",
            "minLength": 3
        },
        "domain": {
            "type": "string",
            "pattern": "^(?!(?:\/.*\/|[#@].*|.*[*].*)$)[a-zA-Z0-9_.-]+$",
            "minLength": 1
        },
        "timeformat": {
            "type": "string",
            "pattern": "^([0-9]+d)?([0-9]+h)?([0-9]+m)?([0-9]+s)?$",
            "minLength": 2
        },
        "byteformat": {
            "type": "string",
            "pattern": "^([0-9]+)(B|KiB|MiB|GiB|TiB)$",
            "minLength": 2
        },
        "retry": {
            "type": "object",
            "description": "The retry settings",
            "dependencies": {
                "count": {
                    "not": {
                        "required": [
                            "during"
                        ]
                    }
                },
                "during": {
                    "not": {
                        "required": [
                            "count"
                        ]
                    }
                }
            },
            "additionalProperties": false,
            "properties": {
                "intervals": {
                    "type": "array",
                    "uniqueItems": false,
                    "minItems": 1,
                    "description": "The retry intervals",
                    "items": {
                        "type": "object",
                        "required": [
                            "interval"
                        ],
                        "additionalProperties": false,
                        "properties": {
                            "interval": {
                                "oneOf": [
                                    {
                                        "type": "integer",
                                        "minimum": 0,
                                        "description": "The interval (in seconds)"
                                    },
                                    {
                                        "$ref": "#/definitions/timeformat",
                                        "description": "The interval (in time format)"
                                    }
                                ]
                            },
                            "notify": {
                                "type": "boolean",
                                "default": false,
                                "description": "If a delayed notification should be sent"
                            }
                        }
                    }
                },
                "count": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "The retry count"
                },
                "during": {
                    "$ref": "#/definitions/timeformat",
                    "description": "The retry duration"
                }
            }
        },
        "connection": {
            "type": "object",
            "description": "The connection settings",
            "additionalProperties": false,
            "properties": {
                "server": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/ipv4"
                        },
                        {
                            "$ref": "#/definitions/ipv6"
                        },
                        {
                            "$ref": "#/definitions/domain"
                        },
                        {
                            "type": "object",
                            "description": "A next hop object",
                            "additionalProperties": false,
                            "properties": {
                                "host": {
                                    "type": "string",
                                    "description": "The destination host"
                                },
                                "mx": {
                                    "type": "boolean",
                                    "default": false,
                                    "description": "Do MX resolving"
                                }
                            }
                        }
                    ],
                    "description": "The destination host, otherwise MX lookup will be used"
                },
                "port": {
                    "type": "integer",
                    "maximum": 65535,
                    "minimum": 1,
                    "default": 25,
                    "description": "The port number"
                },
                "proxyprotocol": {
                    "$ref": "#/definitions/proxyprotocol"
                },
                "sourceip": {
                    "type": "object",
                    "description": "The source IP settings",
                    "additionalProperties": false,
                    "properties": {
                        "ipv4": {
                            "default": true,
                            "anyOf": [
                                {
                                    "type": "boolean",
                                    "default": true,
                                    "description": "Bind any IPv4 address"
                                },
                                {
                                    "type": "array",
                                    "uniqueItems": true,
                                    "minItems": 1,
                                    "description": "List of IPv4 addresses",
                                    "items": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The IPv4 address ID"
                                    }
                                }
                            ]
                        },
                        "ipv6": {
                            "default": true,
                            "anyOf": [
                                {
                                    "type": "boolean",
                                    "default": true,
                                    "description": "Bind any IPv6 address"
                                },
                                {
                                    "type": "array",
                                    "uniqueItems": true,
                                    "minItems": 1,
                                    "description": "List of IPv6 addresses",
                                    "items": {
                                        "$ref": "#/definitions/objectid",
                                        "description": "The IPv6 address ID"
                                    }
                                }
                            ]
                        },
                        "random": {
                            "type": "boolean",
                            "default": true,
                            "description": "Use a random source IP"
                        }
                    }
                }
            }
        },
        "session": {
            "type": "object",
            "description": "The session settings",
            "additionalProperties": false,
            "properties": {
                "protocol": {
                    "type": "string",
                    "enum": [
                        "smtp",
                        "lmtp"
                    ],
                    "default": "smtp",
                    "description": "The protocol"
                },
                "hostname": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The hostname"
                },
                "extensions": {
                    "type": "object",
                    "description": "SMTP extensions",
                    "additionalProperties": false,
                    "properties": {
                        "chunking": {
                            "type": "boolean",
                            "default": true,
                            "description": "Enable support for the CHUNKING extension"
                        },
                        "pipelining": {
                            "type": "boolean",
                            "default": true,
                            "description": "Enable support for the PIPELINING extension"
                        }
                    }
                },
                "tls": {
                    "type": "object",
                    "description": "The TLS settings",
                    "required": [
                        "mode"
                    ],
                    "additionalProperties": false,
                    "if": {
                        "required": [
                            "implicit"
                        ],
                        "properties": {
                            "implicit": {
                                "const": true
                            }
                        }
                    },
                    "then": {
                        "properties": {
                            "mode": {
                                "enum": [
                                    "require",
                                    "require_verify",
                                    "dane",
                                    "dane_require",
                                    "dane_fallback_require",
                                    "dane_fallback_require_verify"
                                ]
                            }
                        }
                    },
                    "properties": {
                        "mode": {
                            "type": "string",
                            "enum": [
                                "disabled",
                                "optional",
                                "optional_verify",
                                "require",
                                "require_verify",
                                "dane",
                                "dane_require",
                                "dane_fallback_require",
                                "dane_fallback_require_verify"
                            ],
                            "description": "The TLS mode"
                        },
                        "implicit": {
                            "type": "boolean",
                            "default": false,
                            "description": "Enable implicit TLS"
                        },
                        "protocols": {
                            "type": "string",
                            "description": "Which TLS protocols to support",
                            "default": "!SSLv2,!SSLv3,!TLSv1,!TLSv1.1"
                        },
                        "ciphers": {
                            "type": "string",
                            "description": "Which TLS ciphers to support (<=TLSv1.2)",
                            "default": "aNULL:-aNULL:HIGH:MEDIUM:+RC4:@STRENGTH"
                        },
                        "ciphersuites": {
                            "type": "string",
                            "description": "Which TLS cipher suites to support (TLSv1.3)"
                        },
                        "groups": {
                            "type": "string",
                            "description": "Which TLS supported groups to use for key exchange"
                        }
                    }
                },
                "authentication": {
                    "type": "object",
                    "description": "The authentication settings",
                    "required": [
                        "username",
                        "password"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "username": {
                            "type": "string",
                            "minLength": 1,
                            "description": "The username"
                        },
                        "password": {
                            "type": "string",
                            "minLength": 1,
                            "description": "The password"
                        }
                    }
                }
            }
        },
        "dsn": {
            "type": "object",
            "description": "The DSN settings",
            "required": [
                "transport"
            ],
            "additionalProperties": false,
            "properties": {
                "transport": {
                    "$ref": "#/definitions/objectid",
                    "description": "The transport ID"
                }
            }
        },
        "proxyprotocol": {
            "type": "object",
            "description": "Connect to PROXY server",
            "additionalProperties": false,
            "properties": {
                "server": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/ipv4"
                        },
                        {
                            "$ref": "#/definitions/ipv6"
                        }
                    ]
                },
                "port": {
                    "type": "integer",
                    "maximum": 65535,
                    "minimum": 1,
                    "default": 25,
                    "description": "The port number"
                },
                "sourceip": {
                    "description": "Address to use when connecting to the proxy",
                    "anyOf": [
                        {
                            "$ref": "#/definitions/ipv4"
                        },
                        {
                            "$ref": "#/definitions/ipv6"
                        }
                    ]
                }
            }
        }
    }
}