Billionmail/BillionMail · error

postfix-billionmail networks section not found

Error message

postfix-billionmail networks section not found

What it means

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.

Source

Thrown at core/internal/service/multi_ip_domain/config_manager.go:420

		} else if postfixStartIdx != -1 && strings.Contains(line, "networks:") {
			postfixNetworksStartIdx = i
		} else if postfixNetworksStartIdx != -1 && strings.TrimSpace(line) != "" &&
			!strings.HasPrefix(line, "        ") && !strings.HasPrefix(line, "\t\t") {
			postfixNetworksEndIdx = i
			break
		}
	}

	if postfixStartIdx == -1 {
		return lines, fmt.Errorf("postfix-billionmail service not found")
	}

	// Copy content up to the postfix networks section
	if postfixNetworksStartIdx != -1 {
		result = append(result, lines[:postfixNetworksStartIdx+1]...)
	} else {
		// If there is no networks configuration, it needs to be added
		return lines, fmt.Errorf("postfix-billionmail networks section not found")
	}

	// Add default billionmail-network configuration with fixed IP
	result = append(result, "        billionmail-network:")
	result = append(result, "          aliases:")
	result = append(result, "            - postfix")
	result = append(result, "          ipv4_address: 172.66.1.100")

	// Add custom network configurations
	for _, cfg := range configs {
		if !gconv.Bool(cfg["active"]) {
			continue
		}

		networkName := gconv.String(cfg["network_name"])
		postfixIP := gconv.String(cfg["postfix_ip"])
		aliases := gconv.String(cfg["aliases"])

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Manually add a 'networks:' mapping under the postfix-billionmail service in docker-compose.yml and retry
  2. Regenerate the compose file from a known-good template
  3. Extend the parser to append a networks section instead of erroring when absent
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at core/internal/service/multi_ip_domain/config_manager.go:420 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/a12a908ddbd1a7ad. Report an issue: GitHub.