Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module fails with blank mydestination on a satellite #339

Open
jchonig opened this issue Nov 23, 2022 · 8 comments
Open

Module fails with blank mydestination on a satellite #339

jchonig opened this issue Nov 23, 2022 · 8 comments

Comments

@jchonig
Copy link

jchonig commented Nov 23, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7 aio
  • Ruby:
  • Distribution: Ubuntu 20.04/22.04
  • Module version: 3.0.0

How to reproduce (e.g Puppet code you use)

This should be a minimal configuration that will recreate the issue.

class {'::postfix':
  satellite => true,
  relayhost => $relayhost,
  masquerade_domains => [
    $masquerade_domain,
  ],
}

What are you seeing

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, pick(): must receive at least one non empty value (file: /etc/puppetlabs/code/environments/postfix/modules/postfix/manifests/satellite.pp, line: 40, column: 21) on node

What behaviour did you expect instead

Setting $mydestination to an empty value w/o a puppet Evaluation Error

Output log

See above

Any additional information you'd like to impart

I'm trying to configure a satellite relay with no local delivery, hence setting mydestination to an empty string. This causes the pick() command to fail as I have not specified satellite::mydestination. It seems that this is not a good use of pick.

@kenyon kenyon changed the title Module fails with blank mydestinoation on a satellite Module fails with blank mydestination on a satellite Nov 23, 2022
@kenyon
Copy link
Member

kenyon commented Nov 23, 2022

mydestination should still be set to the default value, even for satellites: https://www.postfix.org/postconf.5.html#mydestination

@jchonig
Copy link
Author

jchonig commented Nov 23, 2022

@kenyon I read that section several times before submitting the bug report. I do not see how that can be inferred from the text.

I have found this example in their documentation which shows mydestination being empty.

Maybe I'm confused exactly what this module means by mta and satellite. Basically I'm want to run postfix so that it forwards all mail to a relay.

@kenyon
Copy link
Member

kenyon commented Nov 23, 2022

I also use this module to configure postfix in satellite mode. I leave mydestination at the postfix default, and still all mail goes to the relayhost. It works because of the virtual map that forwards everything to root

postfix::virtual { "@${postfix::myorigin}":
ensure => 'present',
destination => 'root',
}
and your setting of root_mail_recipient as shown in the example at https://github.com/voxpupuli/puppet-postfix/blob/master/REFERENCE.md#configure-postfix-as-satellite.

I guess if you want to do it differently, a patch may be needed.

@jchonig
Copy link
Author

jchonig commented Nov 23, 2022

@kenyon thanks for the pointer to Reference.md, that has more detail than is showing on puppet forge. Reading that, satellite is not what I want, I should configure postfix::mta and set the parameters I need. I have some aliases configured and they are ignored.

I do still think it's a bug that it fails with mydestination being empty. While not necessary, I think it's a valid configuration.

@jchonig
Copy link
Author

jchonig commented Nov 23, 2022

@treydock
Copy link
Contributor

Looking at my configs I am using this in my common.yaml:

postfix::mydestination: 'blank'
postfix::mta: true
postfix::relayhost: '[mail.OMIT]'

This is what forces all Postfix mail through my site's relay host. The relay host then is responsible for sending mail:

postfix::mta: true
postfix::relayhost: 'direct'
postfix::mydestination: 'pcre:/etc/postfix/hpc_hosts.pcre'

@jchonig
Copy link
Author

jchonig commented Nov 28, 2022

@treydock That is basically the workaround I'm using:

postfix::mydestination: '-'

and just proves my point. Postfix allows for and recommends using an empty mydestination field. The used of pick() is causing an error when it should not.

Thanks.

Jeff

@fayeg21
Copy link

fayeg21 commented Jan 10, 2023

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants