php / php/php-src

mail() truncates message on full stop between two newlines

Offen
#12,632 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Extension: standard Feature
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Implementierung von PHPs mail() und den Pfad zu finden, der Nachrichtentexte für den lokalen Mailtransport serialisiert. Stelle anschließend das bereitgestellte Beispiel für PHP 8.0.12 nach und füge einen Regressionstest hinzu oder aktualisiere ihn, sodass eine Zeile, die nur einen Punkt enthält, erhalten bleibt und der vollständige erwartete Text gesendet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
php
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.