diff --git a/data/common.yaml b/data/common.yaml deleted file mode 100644 index 2fbf0ff..0000000 --- a/data/common.yaml +++ /dev/null @@ -1 +0,0 @@ ---- {} diff --git a/data/os/CentOS b/data/os/CentOS new file mode 120000 index 0000000..d4fdf69 --- /dev/null +++ b/data/os/CentOS @@ -0,0 +1 @@ +RedHat \ No newline at end of file diff --git a/data/os/Debian/6.yaml b/data/os/Debian/6.yaml index 57554da..8ccd9ab 100644 --- a/data/os/Debian/6.yaml +++ b/data/os/Debian/6.yaml @@ -1,3 +1,13 @@ --- postfix::main_daemon_directory: '/usr/lib/postfix' postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' \ No newline at end of file diff --git a/data/os/Debian/7.yaml b/data/os/Debian/7.yaml index 57554da..f344d42 100644 --- a/data/os/Debian/7.yaml +++ b/data/os/Debian/7.yaml @@ -1,3 +1,13 @@ --- postfix::main_daemon_directory: '/usr/lib/postfix' postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/OracleLinux b/data/os/OracleLinux new file mode 120000 index 0000000..d4fdf69 --- /dev/null +++ b/data/os/OracleLinux @@ -0,0 +1 @@ +RedHat \ No newline at end of file diff --git a/data/os/RedHat.yaml b/data/os/RedHat.yaml deleted file mode 100644 index 25d7589..0000000 --- a/data/os/RedHat.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -postfix::main_daemon_directory: '/usr/libexec/postfix' -postfix::main_setgid_group: 'postdrop' diff --git a/data/os/RedHat/5.yaml b/data/os/RedHat/5.yaml new file mode 100644 index 0000000..473bd18 --- /dev/null +++ b/data/os/RedHat/5.yaml @@ -0,0 +1,13 @@ +--- +postfix::main_daemon_directory: '/usr/libexec/postfix' +postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/RedHat/6.yaml b/data/os/RedHat/6.yaml new file mode 100644 index 0000000..473bd18 --- /dev/null +++ b/data/os/RedHat/6.yaml @@ -0,0 +1,13 @@ +--- +postfix::main_daemon_directory: '/usr/libexec/postfix' +postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/RedHat/7.yaml b/data/os/RedHat/7.yaml new file mode 100644 index 0000000..473bd18 --- /dev/null +++ b/data/os/RedHat/7.yaml @@ -0,0 +1,13 @@ +--- +postfix::main_daemon_directory: '/usr/libexec/postfix' +postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/RedHat/8.yaml b/data/os/RedHat/8.yaml new file mode 100644 index 0000000..473bd18 --- /dev/null +++ b/data/os/RedHat/8.yaml @@ -0,0 +1,13 @@ +--- +postfix::main_daemon_directory: '/usr/libexec/postfix' +postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/RedHat/9.yaml b/data/os/RedHat/9.yaml index 6d812a0..1b9aeb5 100644 --- a/data/os/RedHat/9.yaml +++ b/data/os/RedHat/9.yaml @@ -26,3 +26,13 @@ postfix::main_smtp_tls_cafile: '/etc/pki/tls/certs/ca-bundle.crt' postfix::main_smtp_tls_capath: '/etc/pki/tls/certs' postfix::main_smtp_tls_security_level: 'may' postfix::main_unknown_local_recipient_reject_code: 550 +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/SLED b/data/os/SLED new file mode 120000 index 0000000..155593e --- /dev/null +++ b/data/os/SLED @@ -0,0 +1 @@ +SLES \ No newline at end of file diff --git a/data/os/SLES/10.yaml b/data/os/SLES/10.yaml new file mode 100644 index 0000000..1b2b7de --- /dev/null +++ b/data/os/SLES/10.yaml @@ -0,0 +1,13 @@ +--- +postfix::main_daemon_directory: '/usr/lib/postfix' +postfix::main_setgid_group: 'maildrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/SLES/11.yaml b/data/os/SLES/11.yaml new file mode 100644 index 0000000..1b2b7de --- /dev/null +++ b/data/os/SLES/11.yaml @@ -0,0 +1,13 @@ +--- +postfix::main_daemon_directory: '/usr/lib/postfix' +postfix::main_setgid_group: 'maildrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/SLES/12.3.yaml b/data/os/SLES/12.3.yaml new file mode 100644 index 0000000..f1ac62f --- /dev/null +++ b/data/os/SLES/12.3.yaml @@ -0,0 +1,13 @@ +--- +postfix::main_daemon_directory: '/usr/lib/postfix/bin' +postfix::main_setgid_group: 'maildrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/SLES/12.yaml b/data/os/SLES/12.yaml new file mode 100644 index 0000000..1b2b7de --- /dev/null +++ b/data/os/SLES/12.yaml @@ -0,0 +1,13 @@ +--- +postfix::main_daemon_directory: '/usr/lib/postfix' +postfix::main_setgid_group: 'maildrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/Scientific b/data/os/Scientific new file mode 120000 index 0000000..d4fdf69 --- /dev/null +++ b/data/os/Scientific @@ -0,0 +1 @@ +RedHat \ No newline at end of file diff --git a/data/os/Suse.yaml b/data/os/Suse.yaml deleted file mode 100644 index 3219ada..0000000 --- a/data/os/Suse.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -postfix::main_daemon_directory: '/usr/lib/postfix/bin' -postfix::main_setgid_group: 'maildrop' diff --git a/data/os/Suse/10.yaml b/data/os/Suse/10.yaml deleted file mode 100644 index a2e153d..0000000 --- a/data/os/Suse/10.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -postfix::main_daemon_directory: '/usr/lib/postfix' diff --git a/data/os/Suse/11.yaml b/data/os/Suse/11.yaml deleted file mode 100644 index a2e153d..0000000 --- a/data/os/Suse/11.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -postfix::main_daemon_directory: '/usr/lib/postfix' diff --git a/data/os/Suse/12.0.yaml b/data/os/Suse/12.0.yaml deleted file mode 100644 index a2e153d..0000000 --- a/data/os/Suse/12.0.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -postfix::main_daemon_directory: '/usr/lib/postfix' diff --git a/data/os/Suse/12.1.yaml b/data/os/Suse/12.1.yaml deleted file mode 100644 index a2e153d..0000000 --- a/data/os/Suse/12.1.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -postfix::main_daemon_directory: '/usr/lib/postfix' diff --git a/data/os/Suse/12.2.yaml b/data/os/Suse/12.2.yaml deleted file mode 100644 index a2e153d..0000000 --- a/data/os/Suse/12.2.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -postfix::main_daemon_directory: '/usr/lib/postfix' diff --git a/data/os/Ubuntu/14.04.yaml b/data/os/Ubuntu/14.04.yaml index 57554da..f344d42 100644 --- a/data/os/Ubuntu/14.04.yaml +++ b/data/os/Ubuntu/14.04.yaml @@ -1,3 +1,13 @@ --- postfix::main_daemon_directory: '/usr/lib/postfix' postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/Ubuntu/16.04.yaml b/data/os/Ubuntu/16.04.yaml index 6b066a4..2269233 100644 --- a/data/os/Ubuntu/16.04.yaml +++ b/data/os/Ubuntu/16.04.yaml @@ -1,3 +1,13 @@ --- postfix::main_daemon_directory: '/usr/lib/postfix/sbin' postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/Ubuntu/18.04.yaml b/data/os/Ubuntu/18.04.yaml index 6b066a4..2269233 100644 --- a/data/os/Ubuntu/18.04.yaml +++ b/data/os/Ubuntu/18.04.yaml @@ -1,3 +1,13 @@ --- postfix::main_daemon_directory: '/usr/lib/postfix/sbin' postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/Ubuntu/20.04.yaml b/data/os/Ubuntu/20.04.yaml index 6b066a4..2269233 100644 --- a/data/os/Ubuntu/20.04.yaml +++ b/data/os/Ubuntu/20.04.yaml @@ -1,3 +1,13 @@ --- postfix::main_daemon_directory: '/usr/lib/postfix/sbin' postfix::main_setgid_group: 'postdrop' +postfix::main_append_dot_mydomain: 'no' +postfix::main_biff: 'no' +postfix::main_mailbox_size_limit: 0 +postfix::main_recipient_delimiter: '+' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_mydestination: 'localhost' +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' diff --git a/data/os/Ubuntu/22.04.yaml b/data/os/Ubuntu/22.04.yaml index 61a95fa..18e1705 100644 --- a/data/os/Ubuntu/22.04.yaml +++ b/data/os/Ubuntu/22.04.yaml @@ -15,6 +15,11 @@ postfix::main_mailbox_size_limit: 0 postfix::main_recipient_delimiter: '+' postfix::main_inet_interfaces: 'loopback-only' postfix::main_inet_protocols: 'all' +postfix::main_relayhost: "mailhost.%{facts.networking.domain}" +postfix::main_myorigin: '$myhostname' +postfix::main_myhostname: "%{facts.networking.fqdn}" +postfix::main_mynetworks: + - '127.0.0.0/8' postfix::main_custom: - 'smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache' diff --git a/hiera.yaml b/hiera.yaml index 7a33570..c426ca0 100644 --- a/hiera.yaml +++ b/hiera.yaml @@ -6,18 +6,7 @@ defaults: # Used for any hierarchy level that omits these keys. data_hash: yaml_data # Use the built-in YAML backend. hierarchy: - - name: "osfamily/major release.minor release" + - name: "OS specific data" paths: - # Used to distinguish between Debian and Ubuntu + - "os/%{facts.os.name}/%{facts.os.release.full}.yaml" - "os/%{facts.os.name}/%{facts.os.release.major}.yaml" - - "os/%{facts.os.family}/%{facts.os.release.major}.%{facts.os.release.minor}.yaml" - - name: "osfamily/major release" - paths: - - "os/%{facts.os.name}/%{facts.os.release.major}.yaml" - - "os/%{facts.os.family}/%{facts.os.release.major}.yaml" - - name: "osfamily" - paths: - - "os/%{facts.os.name}.yaml" - - "os/%{facts.os.family}.yaml" - - name: 'common' - path: 'common.yaml' diff --git a/manifests/init.pp b/manifests/init.pp index c8736bc..015222d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -380,7 +380,7 @@ # # @param service_enable # Whether a service should be enabled to start at boot. -# Valid values are 'true', 'false' and 'manual'. +# Valid values are true, false. # # @param service_ensure # Whether a service should be running. Valid values are 'stopped' or 'running'. @@ -432,8 +432,8 @@ class postfix ( String[1] $main_alias_database = 'hash:/etc/aliases', String[1] $main_alias_maps = 'hash:/etc/aliases', - Enum['yes', 'no'] $main_append_dot_mydomain = 'no', - Enum['yes', 'no'] $main_biff = 'no', + Optional[Enum['yes', 'no']] $main_append_dot_mydomain = undef, + Optional[Enum['yes', 'no']] $main_biff = undef, Stdlib::Absolutepath $main_command_directory = '/usr/sbin', Optional[String[1]] $main_compatibility_level = undef, Optional[Array[String[1]]] $main_custom = undef, @@ -445,23 +445,23 @@ String[1] $main_inet_protocols = 'ipv4', Optional[String[1]] $main_mailbox_command = undef, Optional[Stdlib::Absolutepath] $main_manpage_directory = undef, - Integer[0] $main_mailbox_size_limit = 0, + Optional[Integer[0]] $main_mailbox_size_limit = undef, Optional[Stdlib::Absolutepath] $main_mailq_path = undef, Optional[String[1]] $main_mail_owner = undef, Optional[Stdlib::Absolutepath] $main_meta_directory = undef, - String[1] $main_mydestination = 'localhost', + Optional[String[1]] $main_mydestination = undef, Optional[Stdlib::Host] $main_mydomain = undef, - Stdlib::Host $main_myhostname = $facts['networking']['fqdn'], - Variant[Array[String[1]], String[1]] $main_mynetworks = ['127.0.0.0/8'], - String[1] $main_myorigin = '$myhostname', + Optional[Stdlib::Host] $main_myhostname = undef, + Optional[Variant[Array[String[1]], String[1]]] $main_mynetworks = undef, + Optional[String[1]] $main_myorigin = undef, Optional[Stdlib::Absolutepath] $main_newaliases_path = undef, Stdlib::Absolutepath $main_queue_directory = '/var/spool/postfix', Optional[String[1]] $main_readme_directory = undef, - String[1] $main_recipient_delimiter = '+', + Optional[String[1]] $main_recipient_delimiter = undef, Optional[String[1]] $main_relay_domains = undef, Optional[Stdlib::Absolutepath] $main_sample_directory = undef, Optional[Stdlib::Absolutepath] $main_sendmail_path = undef, - Stdlib::Host $main_relayhost = "mailhost.${facts['networking']['domain']}", + Optional[Stdlib::Host] $main_relayhost = undef, Integer[0] $main_relayhost_port = 25, Optional[String[1]] $main_setgid_group = undef, Optional[Enum['yes', 'no']] $main_smtpd_helo_required = undef, @@ -484,7 +484,7 @@ Optional[String[1]] $main_virtual_alias_domains = undef, String[1] $main_virtual_alias_maps = 'hash:/etc/postfix/virtual', Array[String[1]] $packages = ['postfix'], - Variant[Boolean, Enum['true', 'false', 'manual']] $service_enable = true, + Variant[Boolean, Enum['true', 'false']] $service_enable = true, Stdlib::Ensure::Service $service_ensure = 'running', Boolean $service_hasrestart = true, Boolean $service_hasstatus = true, diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 52aa42d..2a271df 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -222,6 +222,12 @@ it { is_expected.to contain_file('postfix_main.cf').with_content(%r{manpage_directory = /test/ing}) } end + context "on #{os} with main_mailbox_size_limit set to valid 242" do + let(:params) { { main_mailbox_size_limit: 242 } } + + it { is_expected.to contain_file('postfix_main.cf').with_content(%r{mailbox_size_limit = 242}) } + end + context "on #{os} with main_mail_owner set to valid testing" do let(:params) { { main_mail_owner: 'testing' } } @@ -499,7 +505,7 @@ it { is_expected.to contain_package('ing') } end - [true, false, 'true', 'false', 'manual'].each do |param| + [true, false, 'true', 'false'].each do |param| context "on #{os} with service_enable set to valid #{param}" do let(:params) { { service_enable: param } } diff --git a/spec/classes/type_validations_spec.rb b/spec/classes/type_validations_spec.rb index b66524c..11cac41 100644 --- a/spec/classes/type_validations_spec.rb +++ b/spec/classes/type_validations_spec.rb @@ -21,26 +21,14 @@ invalid: ['', 'invalid', [1], [[1]], [{ 'ha' => 'sh' }], 3, 2.42, { 'ha' => 'sh' }, true, false], message: '(expects an Array value|index \d+ expects a String value)', }, - 'Array[String[1]] or String[1]' => { - name: ['main_mynetworks'], - valid: [['testing'], ['test', 'ing'], 'test'], - invalid: ['', [1], [[1]], [{ 'ha' => 'sh' }], 3, 2.42, { 'ha' => 'sh' }, true, false], - message: '(String or Array|String|Array)', - }, 'Boolean' => { name: ['service_hasrestart', 'service_hasstatus', 'transport_maps_external', 'virtual_aliases_external'], valid: [true, false], invalid: ['true', 'false', nil, 'invalid', 3, 2.42, ['array'], { 'ha' => 'sh' }], message: 'expects a Boolean', }, - 'Enum[yes, no]' => { - name: ['main_append_dot_mydomain', 'main_biff'], - valid: ['yes', 'no'], - invalid: [true, false, 'invalid', 3, 2.42, ['array'], { 'ha' => 'sh' }], - message: 'expects a match for Enum', - }, 'Integer[0]' => { - name: ['main_mailbox_size_limit', 'main_relayhost_port'], + name: ['main_relayhost_port'], valid: [0, 242, 51_200_000 ], invalid: [-1, 2.42, 'string', ['array'], { 'ha' => 'sh' }], message: '(expects an Integer value|expects an Integer\[0\] value)', @@ -51,14 +39,20 @@ invalid: ['invalid', [1], [[1]], [{ 'ha' => 'sh' }], 3, 2.42, { 'ha' => 'sh' }, true, false], message: '(expects a value of type Undef or Array|index \d+ expects a String value)', }, + 'Optional[Array[String[1]] or String[1]]' => { + name: ['main_mynetworks'], + valid: [['testing'], ['test', 'ing'], 'test'], + invalid: ['', [1], [[1]], [{ 'ha' => 'sh' }], 3, 2.42, { 'ha' => 'sh' }, true, false], + message: '(String or Array|String|Array)', + }, 'Optional[Enum[yes, no]]' => { - name: ['main_smtpd_helo_required'], + name: ['main_biff', 'main_append_dot_mydomain', 'main_smtpd_helo_required'], valid: ['yes', 'no'], invalid: [true, false, 'invalid', 3, 2.42, ['array'], { 'ha' => 'sh' }], message: 'expects an undef value or a match for Enum', }, 'Optional[Integer[0]]' => { - name: ['main_unknown_local_recipient_reject_code'], + name: ['main_mailbox_size_limit', 'main_unknown_local_recipient_reject_code'], valid: [0, 242, 51_200_000 ], invalid: [-1, 2.42, 'string', ['array'], { 'ha' => 'sh' }], message: '(value of type Undef or Integer)', @@ -73,7 +67,8 @@ name: ['main_compatibility_level', 'main_html_directory', 'main_debug_peer_level', 'main_mailbox_command', 'main_mail_owner', 'main_readme_directory', 'main_relay_domains', 'main_setgid_group', 'main_smtpd_banner', 'main_smtpd_relay_restrictions', 'main_smtpd_tls_mandatory_protocols', 'main_smtpd_tls_protocols', 'main_smtpd_tls_security_level', - 'main_smtp_tls_mandatory_protocols', 'main_smtp_tls_protocols', 'main_smtp_tls_security_level', 'main_virtual_alias_domains'], + 'main_smtp_tls_mandatory_protocols', 'main_smtp_tls_protocols', 'main_smtp_tls_security_level', 'main_virtual_alias_domains', + 'main_recipient_delimiter', 'main_mydestination', 'main_myorigin'], valid: ['valid'], invalid: [['array'], { 'ha' => 'sh' }], message: 'expects a value of type Undef or String', @@ -99,15 +94,14 @@ message: 'expects a Stdlib::Host', }, 'String[1]' => { - name: ['main_alias_database', 'main_alias_maps', 'main_inet_protocols', 'main_mydestination', 'main_myorigin', 'main_recipient_delimiter', - 'main_transport_maps', 'main_virtual_alias_maps', 'service_name'], + name: ['main_alias_database', 'main_alias_maps', 'main_inet_protocols', 'main_transport_maps', 'main_virtual_alias_maps', 'service_name'], valid: ['valid'], invalid: ['', 3, 2.42, ['array'], { 'ha' => 'sh' }], message: '(expects a String value|expects a String\[1\] value)', }, - 'Variant[Boolean, Enum[\'true\', \'false\', \'manual\']]' => { + 'Variant[Boolean, Enum[\'true\', \'false\']]' => { name: ['service_enable'], - valid: [true, false, 'true', 'false', 'manual'], + valid: [true, false, 'true', 'false'], invalid: ['invalid', 3, 2.42, ['array'], { 'ha' => 'sh' }], message: 'value of type Boolean or Enum', }, diff --git a/templates/main.cf.erb b/templates/main.cf.erb index 8efd3d7..455d1f4 100644 --- a/templates/main.cf.erb +++ b/templates/main.cf.erb @@ -82,7 +82,9 @@ html_directory = <%= @main_html_directory %> <% if @main_mailbox_command -%> mailbox_command = <%= @main_mailbox_command %> <% end -%> +<% if @main_mailbox_size_limit -%> mailbox_size_limit = <%= @main_mailbox_size_limit.to_s %> +<% end -%> <% if @main_mailq_path -%> mailq_path = <%= @main_mailq_path %> <% end -%> @@ -95,14 +97,16 @@ manpage_directory = <%= @main_manpage_directory %> <% if @main_meta_directory -%> meta_directory = <%= @main_meta_directory %> <% end -%> +<% if @main_mydestination -%> mydestination = <%= @main_mydestination %> +<% end -%> <% if @main_mydomain -%> mydomain = <%= @main_mydomain %> <% end -%> <% if @main_myhostname -%> myhostname = <%= @main_myhostname %> <% end -%> -<% if @main_mynetworks_array -%> +<% if @main_mynetworks -%> mynetworks = <%= @main_mynetworks_array.join(', ') %> <% end -%> <% if @main_myorigin -%> @@ -115,14 +119,18 @@ queue_directory = <%= @main_queue_directory %> <% if @main_readme_directory -%> readme_directory = <%= @main_readme_directory %> <% end -%> +<% if @main_recipient_delimiter -%> recipient_delimiter = <%= @main_recipient_delimiter %> +<% end -%> <% if @main_sample_directory -%> sample_directory = <%= @main_sample_directory %> <% end -%> <% if @main_sendmail_path -%> sendmail_path = <%= @main_sendmail_path %> <% end -%> +<% if @main_relayhost -%> relayhost = <%= @main_relayhost %>:<%= @main_relayhost_port.to_s %> +<% end -%> <% if @main_relay_domains -%> relay_domains = <%= @main_relay_domains %> <% end -%>