diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-03 19:57:30 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-03 19:57:30 -0500 |
| commit | a4362b04a8673f5ae5ba9c6c4e486fb7fdf6ea9a (patch) | |
| tree | 988e73d83c21bad3b393979d1176b89db9ad09c6 /tests/test-testutil-general.el | |
| parent | 431eca805355e017da96d18fbebdbe37dc28d0f4 (diff) | |
| download | dotemacs-a4362b04a8673f5ae5ba9c6c4e486fb7fdf6ea9a.tar.gz dotemacs-a4362b04a8673f5ae5ba9c6c4e486fb7fdf6ea9a.zip | |
fix: validate mail transport executables and default debug off
`mail-config.el` had three related issues. SMTP transport debug was hard-coded to t, which is sensitive since mail bodies and headers land in debug buffers. The use-package `:config` was also setting `sendmail-program` and `mu4e-get-mail-command` directly from `executable-find` results. So a host without msmtp or mbsync silently got `nil` or `(concat nil " -a")` instead of a clear failure mode.
I added `cj/smtpmail-debug-enabled` (default nil) plus `cj/set-smtpmail-debug` and `cj/toggle-smtpmail-debug` for temporary troubleshooting, mirroring the pattern from `auth-config.el`.
I extracted `cj/mail--executable-or-warn` so a missing program emits a one-time `display-warning` and returns nil. `cj/mail-configure-smtpmail` and `cj/mail--mbsync-command` both use it. Missing msmtp now leaves `sendmail-program` nil with a warning. Missing mbsync produces a nil sync command instead of the broken `(concat nil " -a")` string. I also wrapped the mbsync executable path in `shell-quote-argument` so unusual install paths don't fall apart on the `" -a"` concat.
I added `tests/test-mail-config-transport.el` with seven tests across Normal / Boundary / Error: debug-default-off, toggle wiring, msmtp present and missing, mbsync present, mbsync path with spaces, and mbsync missing. The `test-mail-config--with-executables` macro stubs `executable-find` from an alist so each test names its own environment.
Diffstat (limited to 'tests/test-testutil-general.el')
0 files changed, 0 insertions, 0 deletions
