diff --git a/README.md b/README.md index 9ea4f56..0cab69a 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ user and .forward. - *Module Default*: '+' -main_relayhost (default: empty) +main_relayhost & main_relayhost_port (default: empty) ------------------------------- The next-hop destination of non-local mail; overrides non-local domains in recipient addresses. This information is overruled with relay_transport, sender_dependent_default_transport_maps, @@ -188,7 +188,8 @@ default_transport, sender_dependent_relayhost_maps and with the transport(5) tab In the case of SMTP, specify a domain name, hostname, hostname:port, [hostname]:port, [hostaddress] or [hostaddress]:port. The form [hostname] turns off MX lookups. -- *Module Default*: "mailhost.${::domain}" +- *Module Default* for host: "mailhost.${::domain}" +- *Module Default* for port: '25' main_setgid_group (default: postdrop) diff --git a/manifests/init.pp b/manifests/init.pp index 714eed5..17f07e4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,6 +20,7 @@ $main_queue_directory = 'USE_DEFAULTS', $main_recipient_delimiter = '+', $main_relayhost = "mailhost.${::domain}", + $main_relayhost_port = '25', $main_setgid_group = 'USE_DEFAULTS', $packages = 'USE_DEFAULTS', $service_enable = 'true', @@ -113,7 +114,8 @@ 'USE_DEFAULTS' => $default_main_recipient_delimiter, default => $main_recipient_delimiter } - $main_relayhost_real = $main_relayhost + $main_relayhost_real = $main_relayhost + $main_relayhost_port_real = $main_relayhost_port $main_setgid_group_real = $main_setgid_group ? { 'USE_DEFAULTS' => $default_main_setgid_group, @@ -151,6 +153,7 @@ validate_absolute_path($main_queue_directory_real) # main_recipient_delimiter can not be checkek, it can contain nothing to everything if is_domain_name($main_relayhost_real) == false { fail("main_relayhost must be a domain name and is set to <${$main_relayhost_real}>") } + if is_integer($main_relayhost_port_real) == false { fail("main_relayhost_port must be an integer and is set to <${$main_relayhost_port_real}>") } if empty($main_setgid_group_real) == true { fail("main_setgid_group must contain a valid value and is set to <${main_setgid_group_real}>") } if empty($packages_real) == true { fail("packages must contain a valid value and is set to <${packages_real}>") } validate_re($service_enable_real, '^(true|false|manual)$', "service_enable may be either 'true', 'false' or 'manual' and is set to <${service_enable_real}>") diff --git a/templates/main.cf.erb b/templates/main.cf.erb index 6f709cb..170ebe5 100644 --- a/templates/main.cf.erb +++ b/templates/main.cf.erb @@ -51,7 +51,7 @@ queue_directory = <%= @main_queue_directory_real %> recipient_delimiter = <%= @main_recipient_delimiter_real %> # relayhost = -relayhost = <%= @main_relayhost_real %> +relayhost = <%= @main_relayhost_real %>:<%= @main_relayhost_port_real %> # setgid_group = postdrop setgid_group = <%= @main_setgid_group_real %>