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

"parsing dynamic config file: :94: expected indent" after deleting an account or local part #133

Closed
ally9335 opened this issue Feb 17, 2024 · 3 comments

Comments

@ally9335
Copy link

ally9335 commented Feb 17, 2024

After removing an account or local part, I don't remember which, in the config x will remain hanging thus causing an error when mox is restarted

image

===>

l=fatal m="loading config file" err="parsing dynamic config file: :94: expected indent" pkg=mox
@mjl-
Copy link
Owner

mjl- commented Feb 17, 2024

This looks like a snippet from the example configuration file. Such as shown at https://www.xmox.nl/config/#cfg-domains-conf-Accounts-x-Destinations-x. But that snippet isn't complete yet. The "x" should be an email address, followed by a colon, followed by either additional lines with extra indenting containing config options (such as shown in the config link, e.g. Rulesets) or by just nil right after "x: " to indicate there are no further options (but making it a valid "map" from email address to values (the "nil" isn't pretty...).

If the line said "x: nil", there would be no error (but "x" is probably not the email address you wanted to configure). Because there is no value after the colon on the same line, the config parser will look at the next line, expecting to find another indent. But it finds a line that has a shorter indent, instead of the expectated 1 longer.

Was this addition the result of an operation by the admin web interface? Or did you copy/paste a snippet from an example config file? If the first, that's certainly something to fix. If the second, hopefully we can update instructions/explanation in places to prevent future confusion. Suggestions welcome!

@ally9335
Copy link
Author

No idea how this could've happened. I've fixed it.

@mjl-
Copy link
Owner

mjl- commented Mar 9, 2024

I ran into this just now too, mox can create this broken config file by itself. I'll fix it soon. I should have investigated this more thoroughly, sorry. Thanks for reporting!

mjl- added a commit that referenced this issue Mar 9, 2024
preventing writing out a domains.conf that is invalid and can't be parsed
again. this happens when the last address was removed from an account. just a
click in the admin web interface.

accounts without email address cannot log in.

for issue #133 by ally9335
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

2 participants