Skip to content

Stdlib: mail.add_x_header — X-PHP-Originating-Script (ext/standard/mail.c) #21433

Description

@PurHur

Category

stdlib | child of #3285 (mail transport depth)

Problem

When mail.add_x_header=1, php-src prepends X-PHP-Originating-Script: {uid}:{basename} to additional headers before piping to sendmail. This compiler ignores the INI (mirrored/default) and never emits the header.

php-src reference

Repro

mail.add_x_header=1
sendmail_path={PWD}/mock_sendmail.sh
<?php
mail('a@b.c', 'subj', 'body', 'From: x@y');
// mock capture must contain X-PHP-Originating-Script:

Scope

Path Work
ext/standard/VmMail.php read INI; prepend header
ext/standard/VmIni.php ensure mail.add_x_header get/set or host mirror
Tests compliance with mock sendmail + --INI--

Done when (php-src-strict)

  • With mail.add_x_header=1, mock sendmail stdin contains X-PHP-Originating-Script:
  • With =0, header absent
  • Compliance green on VM

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions