php / php/php-src

mail() truncates message on full stop between two newlines

オープン
#12,632 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Extension: standard Feature
主要言語
C
スター
40.4k
フォーク
8.1k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

Description

The following code:

<?php
mail("myself@mydomain.com", "Subject whatever", "Foo bar\n\nWhatever\n\n.\n\nLorem ipsum dolor sit amet");

Resulted in this email body being sent:

Foo bar

Whatever

(not sure whether with or without the \ns at the end and how many of them)

But I expected this output instead:

Foo bar

Whatever

.

Lorem ipsum dolor sit amet

I know that a line with only a full stop is how the email body is terminated in the SMTP protocol, but this is not the SMTP protocol, this is a php function that takes a message and sends it via email. If the caller is supposed to encode the message the way it would be encoded in the SMTP protocol, the docs should say so; but again, that would be stupid.

PHP Version

8.0.12

Operating System

debian 10

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、PHP の mail() 実装と、ローカルメールトランスポート用にメッセージ本文をシリアライズするパスを特定します。次に、提示された PHP 8.0.12 の例を再現し、その後、ピリオドだけを含む行が保持され、期待される完全な本文が送信されるように、リグレッションテストを追加または更新します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
backend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。