{"record":{"id":"a12a908ddbd1a7ad","repo":"Billionmail/BillionMail","slug":"postfix-billionmail-networks-section-not-found","errorCode":null,"errorMessage":"postfix-billionmail networks section not found","messagePattern":"postfix-billionmail networks section not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/multi_ip_domain/config_manager.go","lineNumber":420,"sourceCode":"\t\t} else if postfixStartIdx != -1 && strings.Contains(line, \"networks:\") {\n\t\t\tpostfixNetworksStartIdx = i\n\t\t} else if postfixNetworksStartIdx != -1 && strings.TrimSpace(line) != \"\" &&\n\t\t\t!strings.HasPrefix(line, \"        \") && !strings.HasPrefix(line, \"\\t\\t\") {\n\t\t\tpostfixNetworksEndIdx = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif postfixStartIdx == -1 {\n\t\treturn lines, fmt.Errorf(\"postfix-billionmail service not found\")\n\t}\n\n\t// Copy content up to the postfix networks section\n\tif postfixNetworksStartIdx != -1 {\n\t\tresult = append(result, lines[:postfixNetworksStartIdx+1]...)\n\t} else {\n\t\t// If there is no networks configuration, it needs to be added\n\t\treturn lines, fmt.Errorf(\"postfix-billionmail networks section not found\")\n\t}\n\n\t// Add default billionmail-network configuration with fixed IP\n\tresult = append(result, \"        billionmail-network:\")\n\tresult = append(result, \"          aliases:\")\n\tresult = append(result, \"            - postfix\")\n\tresult = append(result, \"          ipv4_address: 172.66.1.100\")\n\n\t// Add custom network configurations\n\tfor _, cfg := range configs {\n\t\tif !gconv.Bool(cfg[\"active\"]) {\n\t\t\tcontinue\n\t\t}\n\n\t\tnetworkName := gconv.String(cfg[\"network_name\"])\n\t\tpostfixIP := gconv.String(cfg[\"postfix_ip\"])\n\t\taliases := gconv.String(cfg[\"aliases\"])\n","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/multi_ip_domain/config_manager.go#L402-L438","documentation":"Raised in modifyPostfixNetworksText: the 'postfix-billionmail:' service block was found in docker-compose.yml, but no 'networks:' sub-key exists inside it (postfixNetworksStartIdx stayed -1). The text-rewriting logic cannot determine where to splice the new network memberships, so it reports the missing networks section. The code path that appends one handles this case, so hitting the error indicates a structurally malformed service block.","triggerScenarios":"Thrown at core/internal/service/multi_ip_domain/config_manager.go:420 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Manually add a 'networks:' mapping under the postfix-billionmail service in docker-compose.yml and retry","Regenerate the compose file from a known-good template","Extend the parser to append a networks section instead of erroring when absent"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}