fix encoding header for SMIME signed messages with long lines

This commit is contained in:
Georg Sieber 2025-09-11 16:07:09 +02:00 committed by Georg Sieber
parent 5ddea0610b
commit fd9f8d33cb
No known key found for this signature in database
GPG Key ID: DA41AC14EC357849
1 changed files with 6 additions and 4 deletions

View File

@ -2961,10 +2961,6 @@ class PHPMailer
//Create unique IDs and preset boundaries
$this->setBoundaries();
if ($this->sign_key_file) {
$body .= $this->getMailMIME() . static::$LE;
}
$this->setWordWrap();
$bodyEncoding = $this->Encoding;
@ -2996,6 +2992,12 @@ class PHPMailer
if (static::ENCODING_BASE64 !== $altBodyEncoding && static::hasLineLongerThanMax($this->AltBody)) {
$altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE;
}
if ($this->sign_key_file) {
$this->Encoding = $bodyEncoding;
$body .= $this->getMailMIME() . static::$LE;
}
//Use this as a preamble in all multipart message types
$mimepre = '';
switch ($this->message_type) {