Category
enhancement · php-src-strict · IMAP surface · pillar 4
Problem
IMAP is advertised (extension_loaded("imap"), imap_open), but imap_mail_compose() is missing. php-src builds MIME message text from envelope + body-section arrays — needed for outbound mail composition without shelling out.
Verified 2026-08-05 on tip 49577690f. Sibling gaps already tracked: #27681 utf7, #27674 imap_is_open, #27680 imap_timeout; mutf7 filed separately. Also missing nearby: imap_mail_copy / imap_mail_move (file follow-ups if still absent after this lands).
| Repro |
php-src stub |
VM (IMAP on) |
function_exists("imap_mail_compose") |
true |
false |
php-src reference
PHP implementation target
ext/imap/ PHP MIME compose helper matching Zend envelope/body keys (at least a documented subset: from/to/subject + text body section)
- Register in IMAP
Module.php; Reflection parity with stubs
- PHP-in-PHP; no new C runtime
Repro
./script/docker-exec.sh -- bash -lc '
cat > /tmp/imap_mail_compose.php <<'"'"'PHP'"'"'
<?php
echo "ext=", extension_loaded("imap") ? "Y" : "N", "\n";
echo "compose=", function_exists("imap_mail_compose") ? "Y" : "N", "\n";
if (function_exists("imap_mail_compose")) {
$envelope = ["from" => "a@example.com", "to" => "b@example.com", "subject" => "Hi"];
$body = [["type" => TYPEMULTIPART], ["type" => TYPETEXT, "subtype" => "plain", "contents.data" => "hello"]];
$msg = imap_mail_compose($envelope, $body);
echo is_string($msg) && str_contains($msg, "hello") ? "OK\n" : "BAD\n";
}
PHP
php bin/vm.php /tmp/imap_mail_compose.php
'
Done when
Gate context (2026-08-05)
user_release_ready: no — spine / north-star5-fast red (SscanfStrtolApply.php)
Category
enhancement· php-src-strict · IMAP surface · pillar 4Problem
IMAP is advertised (
extension_loaded("imap"),imap_open), butimap_mail_compose()is missing. php-src builds MIME message text from envelope + body-section arrays — needed for outbound mail composition without shelling out.Verified 2026-08-05 on tip
49577690f. Sibling gaps already tracked: #27681 utf7, #27674imap_is_open, #27680imap_timeout; mutf7 filed separately. Also missing nearby:imap_mail_copy/imap_mail_move(file follow-ups if still absent after this lands).function_exists("imap_mail_compose")truefalsephp-src reference
ext/imap/php_imap.stub.php—imap_mail_compose(array $envelope, array $bodies): string|falseext/imap/php_imap.c—PHP_FUNCTION(imap_mail_compose)PHP implementation target
ext/imap/PHP MIME compose helper matching Zend envelope/body keys (at least a documented subset:from/to/subject+ text body section)Module.php; Reflection parity with stubsRepro
Done when
function_exists("imap_mail_compose")true when IMAP advertised.phpt(document unsupported keys)Gate context (2026-08-05)
user_release_ready: no— spine /north-star5-fastred (SscanfStrtolApply.php)