saltstack-formulas / postfix-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
25 stars 130 forks source link

[BUG] smtpd_sasl_auth_enable: no not working #103

Closed gojufhv closed 4 years ago

gojufhv commented 4 years ago

Bug details

Describe the bug

If you want to disable sasl auth for example on a mx only server, this will result in a not working configuration.

If smtpd_sasl_auth_enable: no is set in pillar, this will result in smtpd_sasl_auth_enable = False in main.cf

postfix/smtpd[333]: fatal: bad boolean configuration: smtpd_sasl_auth_enable = False

Steps to reproduce the bug

Pillar:

postfix:
  config:
    smtpd_sasl_auth_enable: no

Expected behaviour

It should write "smtpd_sasl_auth_enable = no" in the main.cf config file.

EvaSDK commented 4 years ago

You are confused by YAML syntax. The formula does not try to be smart by switch boolean to strings for you. Simply quoting no here will do what you expect. https://docs.saltstack.com/en/latest/topics/troubleshooting/yaml_idiosyncrasies.html#true-false-yes-no-on-off

myii commented 4 years ago

Thanks @EvaSDK.

@gojufhv We're using yamllint in this repo, to specifically avoid this problem as much as possible. If you look at pillar.example, it shows you that the values are quoted:

https://github.com/saltstack-formulas/postfix-formula/blob/cae0c8431925e1ea4ade5a4b899b34a6b128a1c6/pillar.example#L130

So just change that to 'no' as @EvaSDK mentioned and you should be fine.

gojufhv commented 4 years ago

Thank you @EvaSDK and @myii - and sorry for wasting your time. I should have read the example more carefully. Using quotes solved my problem.