Skip to content

feat(config): load default values from Config(), not chatmail.ini.f#853

Merged
missytake merged 5 commits into
mainfrom
config-empty-defaults
May 12, 2026
Merged

feat(config): load default values from Config(), not chatmail.ini.f#853
missytake merged 5 commits into
mainfrom
config-empty-defaults

Conversation

@missytake
Copy link
Copy Markdown
Contributor

We should not rely on the chatmail.ini.f default config file for filling the empty values, but do this in the python3 Config() constructor. This enables #852 to have different default values for older chatmail.ini files than for more recent configs, and is generally more consistent.

@missytake missytake had a problem deploying to staging-ipv4.testrun.org February 17, 2026 23:39 — with GitHub Actions Error
@missytake missytake force-pushed the config-empty-defaults branch from e5b75bd to 6d28cf0 Compare February 17, 2026 23:41
@missytake missytake temporarily deployed to staging2.testrun.org February 17, 2026 23:41 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging-ipv4.testrun.org February 17, 2026 23:41 — with GitHub Actions Inactive
@missytake missytake requested a review from hpk42 February 18, 2026 00:00
@missytake missytake changed the title config: load default values from Config(), not chatmail.ini.f feat(config): load default values from Config(), not chatmail.ini.f Feb 18, 2026
@missytake missytake force-pushed the config-empty-defaults branch from 6d28cf0 to 13dd647 Compare February 19, 2026 20:41
@missytake missytake temporarily deployed to staging-ipv4.testrun.org February 19, 2026 20:41 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging2.testrun.org February 20, 2026 09:55 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@j4n j4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; one issue I see is that now we have two places there are defaults; probably we should generate the chatmail.ini.f from the config.py defaults?

Comment thread chatmaild/src/chatmaild/config.py Outdated
Comment thread chatmaild/src/chatmaild/config.py
@missytake
Copy link
Copy Markdown
Contributor Author

missytake commented Feb 24, 2026

lgtm; one issue I see is that now we have two places there are defaults; probably we should generate the chatmail.ini.f from the config.py defaults?

Hm, I think the better approach is commenting out the values in chatmail.ini.f, then the defaults in config.py count if you don't explicitly uncomment them. This is how many other config formats are doing it as well.

The commented out values still document the default values for new users, but if we forget to update them, nothing breaks. And it's clear to us that the commented out line isn't the meaningful one.

@missytake missytake temporarily deployed to staging2.testrun.org February 24, 2026 13:44 — with GitHub Actions Inactive
@missytake missytake temporarily deployed to staging-ipv4.testrun.org February 24, 2026 13:44 — with GitHub Actions Inactive
@missytake missytake force-pushed the config-empty-defaults branch from 4f8b958 to bce0595 Compare May 12, 2026 13:06
@missytake missytake force-pushed the config-empty-defaults branch from bce0595 to fef67b8 Compare May 12, 2026 13:20
Copy link
Copy Markdown
Contributor

@hpk42 hpk42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! would remove the port configuration from chatmail.ini.f

Comment on lines 66 to 73
# SMTP outgoing filtermail and reinjection
filtermail_smtp_port = 10080
postfix_reinject_port = 10025
#filtermail_smtp_port = 10080
#postfix_reinject_port = 10025

# SMTP incoming filtermail and reinjection
filtermail_smtp_port_incoming = 10081
postfix_reinject_port_incoming = 10026
#filtermail_smtp_port_incoming = 10081
#postfix_reinject_port_incoming = 10026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd remove them entirely from chatmail.ini
filtermail_http_port_incoming and filtermail_lmtp_port_transport are already missing.
If someone really wants to fiddle at this level, they need to read the source for config.py.

@missytake missytake merged commit ed664cd into main May 12, 2026
8 checks passed
@missytake missytake deleted the config-empty-defaults branch May 12, 2026 20:44
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 this pull request may close these issues.

3 participants