MIME::QuotedPrint encode_qp emits LF instead of requested CRLF
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
Direzione di ricerca
Inizia da MIMEQuotedPrint.encodeQuotedPrintable, dove vengono emessi i normali caratteri di nuova riga dell'input, e confronta questa gestione con l'uso esistente di eol per le interruzioni di riga morbide. Aggiungi una copertura mirata per l'input CRLF e l'output CRLF richiesto, quindi esegui la suite upstream t/basic.t sia con ./jperl sia con ./jperl --interpreter; il lavoro è completato quando i byte sono esattamente CRLF e tutti i 13 test passano.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
PerlOnJava's bundled MIME::QuotedPrint provider emits LF line endings when
encode_qp is asked to use CRLF. This breaks Email::MIME::Encodings's
quoted-printable encoder, which is required to preserve RFC email line
endings.
Reproduction
Run the upstream Email::MIME::Encodings 1.317 test suite:
./jperl t/basic.t
./jperl --interpreter t/basic.t
The suite reports one failure in enc qp:
not ok 8 - enc qp
got: 'This is a test\nof various MIME=3Dstuff.=\n'
expected: 'This is a test\r\nof various MIME=3Dstuff.=\r\n'
The failure reproduces on both the JVM and interpreter backends. System Perl
passes the complete upstream suite: 13 tests successful.
A minimal provider-level reproducer is:
./jperl -MMIME::QuotedPrint -e 'my $x="a\r\nb"; my $y=encode_qp($x,"\r\n"); print unpack("H*",$y),"\n"'
The expected encoded bytes begin with 610d0a (a\\r\\n), but PerlOnJava
returns 610a (a\\n).
CPAN failure
The CPAN random-tester run 20260910-101908-8428 recorded FAIL for
Email::MIME::Encodings 1.317:
1/13 subtests failed; 1/2 test programs failed
The failing test is the distribution's stable t/basic.t test, assertion 8.
The distribution itself is pure Perl and has no external service or native
library prerequisite.
Technical cause
Email::MIME::Encodings::codec passes the requested EOL to
MIME::QuotedPrint::encode_qp:
return $sub->($what, $eol);
The PerlOnJava implementation in MIMEQuotedPrint.encodeQuotedPrintable
hardcodes LF when it encounters an input newline:
output.append(currentLine).append("\\n");
It should preserve the requested eol value (CRLF in this case). The same
implementation already uses eol for soft line breaks, so handling ordinary
newlines consistently with that parameter appears to be the missing piece.
Impact
Email and MIME libraries using PerlOnJava's quoted-printable provider can
produce non-conforming line endings even when explicitly requesting CRLF.
This can affect message serialization, canonicalization, signatures, and
interoperability with MIME consumers.
Suggested fix and regression coverage
Update MIMEQuotedPrint.encodeQuotedPrintable to append the requested EOL for
preserved newlines, while retaining existing binary-mode and CRLF-normalizing
behavior. Add a focused regression test that checks the exact bytes returned
by encode_qp for CRLF input and requested CRLF output, and run the
Email::MIME::Encodings test under both execution backends.
- Lingua principale
- Perl
- Stelle
- 64
- Fork
- 6
- Merge medio
- 4h 34m
- PR unite (30g)
- 181
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fglock/PerlOnJava
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fglock/PerlOnJava#1579 ·
I maintainer di solito rispondono entro 1 giorno
-
area:io area:runtime bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
fglock/PerlOnJava#1630 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port area:unicode bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
fglock/PerlOnJava#1629 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cpan-port bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
fglock/PerlOnJava#1626 ·
I maintainer di solito rispondono entro 1 giorno
-
area:parser bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 67/100
fglock/PerlOnJava#1625 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fglock/PerlOnJava
Issue simili
-
1.severity: security
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
NixOS/nixpkgs#569828 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
t/16 and t/17 fail to compile on perl 5.8: defined-or operator // usedForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 4 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
ESCOMP/CAM#1701 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Multiple IPs in hostnameApertabug OS Images
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
stfc/cloud-image-builders#233 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
language/en needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kubernetes/website#57846 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni