Skip to content

Stdlib: mail() sendmail_path popen transport (#3285) - #21435

Merged
PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-3285-mail-sendmail
Jul 20, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-3285-mail-sendmail

Conversation

@PurHur

@PurHur PurHur commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement mail() sendmail delivery in PHP (VmMail::send) matching php-src ext/standard/mail.c php_mail(): popen(sendmail_path), RFC822 To/Subject/headers/body on stdin, accept EX_OK/EX_TEMPFAIL.
  • Wire bin/vm.php -d sendmail_path=… / PHPT --INI-- via VmIni::applyStartupIniOverride → mirrored INI override (same pattern as browscap).
  • Compliance: mock sendmail fixture + transport .phpt; keep “false when sendmail missing” registration case.
  • Trust: remove duplicate testVmRegistersMbUcwordsOnForwardProfile that fatals PHPUnit on master.

php-src ref: ext/standard/mail.c (PHP_FUNCTION(mail), php_mail).
PHP impl: ext/standard/VmMail.php, ext/standard/mail.php.

Closes #3285

Batch next (claimed): #21432 headers array, #21433 mail.add_x_header, #21434 additional_params / force_extra_parameters.

Test plan

  • php bin/vm.php -d sendmail_path=…/mock_sendmail.sh test/repro/issue_3285_mail_sendmail.phptrue / OK
  • vendor/bin/phpunit test/compliance/VMTest.php --filter 'mail_sendmail_transport|mail_registered' → OK (4)
  • php script/bootstrap-inventory.php --checkOK 6163/6163
  • CompilerVersionGateTest loads without fatal redeclaration

Verification transcript

true
OK
OK (4 tests, 4 assertions)
OK 6163/6163
gate_ok

Made with Cursor

Replace the always-false mail() stub with php-src php_mail()-shaped delivery via popen(sendmail_path), wire CLI/PHPT -d overrides for sendmail_path, and drop a duplicate CompilerVersionGateTest method that fatals PHPUnit on master.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit f6d09a6 into master Jul 20, 2026
1 check failed
@PurHur
PurHur deleted the agent/advanced-stdlib-3285-mail-sendmail branch July 20, 2026 11:36
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.

Stdlib: mail() — send message via sendmail/MTA (ext/standard/mail.c parity)

1 participant