Skip to content

Conversation

@missytake
Copy link
Contributor

@missytake missytake commented Jan 20, 2026

This should fail CI, at least the commit failed when deployed manually.

When we confirmed that CI fails on broken config, we can fix the dovecot config and merge to main.

@missytake
Copy link
Contributor Author

Fails with:

Jan 20 18:40:43 staging2 systemd[1]: dovecot.service: Scheduled restart job, restart counter is at 17.
Jan 20 18:40:43 staging2 systemd[1]: Stopped dovecot.service - Dovecot IMAP/POP3 email server.
Jan 20 18:40:43 staging2 systemd[1]: Starting dovecot.service - Dovecot IMAP/POP3 email server...
Jan 20 18:40:43 staging2 dovecot[30980]: doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf: event filter: syntax error, unexpected invalid token, expecting '=' or '>' or '<'
Jan 20 18:40:43 staging2 systemd[1]: dovecot.service: Main process exited, code=exited, status=89/n/a
Jan 20 18:40:43 staging2 systemd[1]: dovecot.service: Failed with result 'exit-code'.
Jan 20 18:40:43 staging2 systemd[1]: Failed to start dovecot.service - Dovecot IMAP/POP3 email server.

@j4n
Copy link
Contributor

j4n commented Jan 21, 2026

Ok, addressed the syntax error (I sincerely wonder how this slipped through, I suppose it only manifests on a full dovecot restart); and added a config check before restarting so syntax errors don't bring down the service again.

@j4n
Copy link
Contributor

j4n commented Jan 21, 2026

maybe it makes sense to do such a check on postfix as well?

@missytake
Copy link
Contributor Author

maybe it makes sense to do such a check on postfix as well?

trickier, postconf returns exit code 0 on warnings. But I found a way.

if need_restart:
server.shell(
name="Validate postfix configuration",
commands=["postconf -n >/dev/null"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will not fail on warnings, only fatal errors; e.g. wrong config keys only cause warnings. But that's fine I guess, at least the service will start normally.

@missytake missytake changed the title CI: enable mtail, reapply idle/hibernate metrics cmdeploy: fail on errors in postfix/dovecot config Jan 21, 2026
missytake and others added 3 commits January 21, 2026 15:02
github deployments: be lenient on the whitespace in sed replace of
mtail_address
The ! character in != is an invalid token in Dovecot's unified filter
language (2.3.12+). The parser expected a comparison operator (=, >, <)
and choked on !.
@j4n j4n force-pushed the fix-dovecot-metrics-ci branch from ea128dc to 5410bb3 Compare January 21, 2026 14:04
@j4n j4n temporarily deployed to staging-ipv4.testrun.org January 21, 2026 14:04 — with GitHub Actions Inactive
@j4n j4n temporarily deployed to staging2.testrun.org January 21, 2026 14:04 — with GitHub Actions Inactive
Copy link
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.

improved postconf checks (not as nice as doveconf)

@missytake missytake merged commit 2d0ccdb into main Jan 21, 2026
6 checks passed
@missytake missytake deleted the fix-dovecot-metrics-ci branch January 21, 2026 15:33
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