/go/mynetworks sets Postfix's mynetworks parameter — the list of IP ranges Postfix treats as trusted, which are generally allowed to relay mail through the server without authenticating. It always includes localhost (127.0.0.0/8, [::1]/128) and this server's own public IPv4 address, plus whatever extra networks you pass as arguments. The call is appended to /var/log/go/mynetworks.log. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Trust an office network in addition to localhost and this server's own IP
/go/mynetworks 203.0.113.0/24
Options
| Argument | Notes |
|---|---|
<network> |
An IP, CIDR range, or whatever syntax Postfix’s mynetworks accepts, as one shell argument per network. Not validated — a malformed value is written to Postfix’s configuration as-is. |
Examples
# Localhost and this server's own IP only (the default, no extra trust)
/go/mynetworks
# Trust one additional network
/go/mynetworks 203.0.113.0/24
# Trust several networks at once — must all be given together
/go/mynetworks 203.0.113.0/24 198.51.100.0/24
# Check the result
postconf mynetworks
Output
The command prints nothing on success. Check the result yourself:
postconf mynetworks
Errors from postconf or from /go/mail restart (presumed to restart Postfix, based on context) print to the terminal, but the script doesn’t stop or report a summary either way.
See the full reference at /go/mynetworks and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
