Reads Postfix's master.cf, for Sovite.Core.Postfix.Migration.
Each logical line (see Sovite.Core.Postfix.MainCf.logical_lines/1)
is a service: name, type, private, unpriv, chroot, wakeup, maxproc,
and the command with its arguments. Arguments are separated by
whitespace; { ... } groups one argument that contains whitespace.
-o name=value and -o { name = value } override a main.cf
parameter for the service.
Summary
Functions
The name=value attributes of a pipe or spawn service, with
"argv" as the list of the command and its arguments.
The address and port of an inet service name: smtp, 587,
127.0.0.1:10025, [::1]:25. The host is nil when the service
listens on inet_interfaces.
The value of -o name=... on service, or nil. The last one wins.
Parses contents into services, in file order. Malformed lines are skipped.
Splits a line into whitespace-separated tokens, keeping { ... }
groups whole.
Types
Functions
The name=value attributes of a pipe or spawn service, with
"argv" as the list of the command and its arguments.
iex> Sovite.Core.Postfix.MasterCf.attributes(["flags=Rq", "user=nobody", "argv=/bin/cat", "-n"])
%{"flags" => "Rq", "user" => "nobody", "argv" => ["/bin/cat", "-n"]}
@spec inet_address(String.t()) :: {:ok, String.t() | nil, :inet.port_number()} | :error
The address and port of an inet service name: smtp, 587,
127.0.0.1:10025, [::1]:25. The host is nil when the service
listens on inet_interfaces.
iex> Sovite.Core.Postfix.MasterCf.inet_address("127.0.0.1:10025")
{:ok, "127.0.0.1", 10025}
iex> Sovite.Core.Postfix.MasterCf.inet_address("submission")
{:ok, nil, 587}
The value of -o name=... on service, or nil. The last one wins.
Parses contents into services, in file order. Malformed lines are skipped.
Splits a line into whitespace-separated tokens, keeping { ... }
groups whole.
iex> Sovite.Core.Postfix.MasterCf.tokens("a -o { x = 1 } b")
["a", "-o", "{ x = 1 }", "b"]