voxpupuli / puppet-postfix

Puppet postfix module
Apache License 2.0
70 stars 174 forks source link

Not possible to configure Postfix as null client #262

Closed tuxmea closed 3 years ago

tuxmea commented 4 years ago

According to Postfix documentation the parameter mydestination should be set to no value (http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client)

The module requires a string. See error message, when setting to an empty string:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Class[Postfix::Mta]: parameter 'mydestination' expects a match for Pattern[/^\S+(?:,\s*\S+)*$/], got '' (file: /etc/puppetlabs/code/environments/production/modules/postfix/manifests/init.pp, line: 154, column: 5) 
traylenator commented 4 years ago

Also want to set set mydestination to ''.

traylenator commented 4 years ago

I started adding a patch to allow mydestination to be set to '' but then I found the blank magic.

Following is I think a null client:

class{'postfix':
  myorigin            => 'example.ch',
  mta                 => true,
  mydestination       => 'blank',
  relayhost           => '[mx.example.ch]'
  root_mail_recipient => $root_email,
  inet_interfaces     => 'loopback-only',
}
igalic commented 4 years ago

where did you find it??

traylenator commented 4 years ago

where did you find it??

The blank magic?

I found the special case when I was adding rspec tests.

https://github.com/camptocamp/puppet-postfix#postfixconfig

does have blank in the docs. It is just not immediately obvious that blank is available to the main class parameters until you look down a few levels.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.