Fix SMTP rejection check, dropped news posts, and format-string defects - #3
Merged
Conversation
- mail.c: `!line->data[0] == '2'` parsed as `(!line->data[0]) == '2'` (always false), so a non-2xx reply to SMTP MAIL FROM was never treated as an error. Use `line->data[0] != '2'` so relay rejections are caught. - menusend.c: non-anonymous local news posting opened a pipe to NEWS but never wrote the message or closed it, silently dropping the post and leaking the descriptor. Write the message and close the pipe. - menustats.c / rem.c: pass non-literal strings through "%s" to avoid format-string interpretation (config-controlled ALLPINGERSURL, mbox From-line), fixing -Wformat-security warnings.
brainx
force-pushed
the
fix/smtp-and-news-bugs
branch
from
June 17, 2026 18:24
23bcc7e to
e7373c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three compiler-flagged bugs found in the Mixmaster source and fixed:
Src/mail.c— SMTPMAIL FROMrejection never detected. The checkif (!line->data[0] == '2')is parsed as(!line->data[0]) == '2', i.e.comparing a boolean (0/1) to
'2'(50) — always false. A non-2xx reply toMAIL FROMwas therefore never treated as an error and delivery proceededanyway. Changed to
line->data[0] != '2'.Src/menusend.c— non-anonymous local news posting silently dropped.The post/news branch did
f = openpipe(NEWS)but never wrote the message orclosed the pipe, so the article was never injected and the descriptor leaked.
Now writes the message and closes the pipe (matching the
logmail()pattern).Src/menustats.c/Src/rem.c— format-string defects (-Wformat-security).printw(ALLPINGERSURL)uses a config-controlled string as a format string;fprintf(mbox, line)likewise. Both routed through"%s".Test plan
./scripts/build-macos.shbuildsbin/mixmaster+bin/mixremailercleanly-Wlogical-not-parentheses,-Wtautological-constant-out-of-range-compare,-Wformat-security, news-pipeset but not used) no longer emitted./bin/mixmaster --versionand./bin/mixremailer -Vrunparse_yearmonthdayunit test passesMade with Cursor