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

Problems with overriding via yaml? #66

Closed
adamkusmirek opened this issue May 7, 2022 · 0 comments · Fixed by #77
Closed

Problems with overriding via yaml? #66

adamkusmirek opened this issue May 7, 2022 · 0 comments · Fixed by #77

Comments

@adamkusmirek
Copy link

adamkusmirek commented May 7, 2022

I noticed that when adding a smtp.yaml to the config path, the values are not being loaded on startup.

Example: no smtp.ini present in config path and smtp.yaml has contents

"!smtp.ini":
  "main":
     "nodes": 0
"!smtpgreeting": [ "This is some custom greeting!"]

The logoutput on startup then includes:

Overriding file smtp.ini with config from /usr/local/haraka/config/smtp.yaml
Overriding file smtpgreeting with config from /usr/local/haraka/config/smtp.yaml
[WARN] [-] [core] smtp.ini.nodes unset, using 1, see https://github.com/haraka/Haraka/wiki/Performance-Tuning

which tells me, that my override was not applied.

Printing out the contents of Server.cfg at where this message is being printed yields:

{
  "main": {
     "daemonize":false,
     "strict_rfc1869":false,
     "smtputf8":true,
     "graceful_shutdown":false
  },
 "headers":{
     "add_received":true,
     "show_version":true,
     "clean_auth_results":true
 }
}

which apparently are the passed default booleans in the Server.config.get('smtp.ini'...... call in Server.load_smtp_ini.

Weirdly enough, the !smtpgreeting override works and is being loaded/used.

edit: this problem only applies to .ini file overrides

I also tried to comment out the default booleans in Server.load_smtp_ini and in this case the !smpt.ini override is being loaded correctly.

I suspect that there could be a problem in configfile.js, specifically in get_cache_key() regarding the way booleans are handled there since I noticed that they get appended to the name for some reason?

Maybe I also have a misconception about how this mechanism is supposed to work, especially regarding the booleans.
The documentation is a little bit sparse on this detail.

Any help or pointers would be welcome!

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

Successfully merging a pull request may close this issue.

1 participant