Skip to content

Address Copilot review feedback: remove fixEncoding, fix X-Forwarded-For, improve tests#162

Draft
Claude wants to merge 1 commit intoemail-reading-libfrom
claude/sub-pr-161
Draft

Address Copilot review feedback: remove fixEncoding, fix X-Forwarded-For, improve tests#162
Claude wants to merge 1 commit intoemail-reading-libfrom
claude/sub-pr-161

Conversation

@Claude
Copy link

@Claude Claude AI commented Feb 6, 2026

Addresses code review feedback on the Laminas → Zbateson migration PR. Removes redundant encoding fixes, corrects header handling for multiple values, and strengthens test assertions.

Changes

  • Remove redundant fixEncoding() method - Zbateson's getTextContent()/getHtmlContent() handle charset conversion automatically and always return UTF-8, making post-processing unnecessary

  • Fix X-Forwarded-For header extraction - Changed from getHeaderValue() (returns only first header) to getAllHeadersByName() with iteration to capture all instances:

    // Before: only captured first X-Forwarded-For
    $x_forwarded_for = $message->getHeaderValue('x-forwarded-for');
    
    // After: captures all X-Forwarded-For headers
    $xForwardedForHeaders = $message->getAllHeadersByName('x-forwarded-for');
    foreach ($xForwardedForHeaders as $header) {
        $addresses[] = $header->getValue();
    }
  • Preserve email header formatting - Use getRawValue() instead of toString() to maintain angle brackets and original header format in debug output

  • Strengthen test assertions - Replace debug echo statements with deterministic assertions that verify expected decoded values (e.g., "SV: Klage på målrettet utestengelse")

All Zbateson-specific tests pass (27 tests, 62 assertions).

@Claude
Copy link
Author

Claude AI commented Feb 6, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/PHP-DI/Invoker/zipball/3c1ddfdef181431fbc4be83378f6d036d59e81e1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/PHP-DI/PHP-DI/zipball/f88054cc052e40dbe7b383c8817c19442d480352
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/PHPMailer/PHPMailer/zipball/d1ac35d784bf9f5e61b424901d5a014967f15b12
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/laravel/serializable-closure/zipball/7581a4407012f5f53365e11bafc520fd7f36bc9b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/comparator/zipball/55dfef806eb7dfeb6e7a6935601fef866f8ca48d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/33198268dad71e926626b618f3ec3966661e4d90
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/symfony/polyfill-iconv/zipball/5f3b930437ae03ae5dff61269024d8ea1b3774aa
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/zbateson/mail-mime-parser/zipball/ff054c8e05310c445c2028c6128a4319cc9f6aa8
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/zbateson/mb-wrapper/zipball/50a14c0c9537f978a61cde9fdc192a0267cc9cff
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)
  • https://api.github.com/repos/zbateson/stream-decorators/zipball/32a2a62fb0f26313395c996ebd658d33c3f9c4e5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/d6XieG /usr/bin/composer install --no-interaction git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@Claude Claude AI changed the title [WIP] Replace Laminas Mail with Zbateson mail-mime-parser Address Copilot review feedback: remove fixEncoding, fix X-Forwarded-For, improve tests Feb 6, 2026
@Claude Claude AI requested a review from HNygard February 6, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants