Commit 3c64659
Email extraction: address-header fallback + better parse diagnostics
The Oslo kommune email with the mangled From header still fails in
production even though the exact header from the error log parses fine
locally (verified on PHP 8.2 and 8.3) - the real bytes must differ from
what the log shows. Three changes to both recover and get evidence:
1. Address-header fallback: when From/To/Cc/Bcc/Reply-To/Sender still
fails after all repairs but contains an angle-addr, drop the display
name, keep the address and retry. The display name is cosmetic; the
address is what extraction needs.
2. Diagnostic loop now accumulates complete folded headers before
test-parsing. Previously a folded address header was cut in half by
the partial parse (angle-addr left on the continuation line), which
could blame the wrong header and blocked the fallback above.
3. Hex dump of the problematic header in the diagnostic output, so the
next occurrence reveals the exact bytes the log cannot show.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 03c1d12 commit 3c64659
2 files changed
Lines changed: 92 additions & 5 deletions
File tree
- organizer/src
- class/Extraction
- tests/Extraction
Lines changed: 45 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
| 880 | + | |
880 | 881 | | |
881 | 882 | | |
| 883 | + | |
882 | 884 | | |
883 | 885 | | |
884 | 886 | | |
885 | 887 | | |
| 888 | + | |
886 | 889 | | |
887 | 890 | | |
888 | | - | |
| 891 | + | |
889 | 892 | | |
890 | 893 | | |
891 | 894 | | |
| |||
896 | 899 | | |
897 | 900 | | |
898 | 901 | | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
899 | 911 | | |
900 | 912 | | |
901 | 913 | | |
902 | 914 | | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
903 | 942 | | |
904 | | - | |
| 943 | + | |
905 | 944 | | |
906 | | - | |
907 | | - | |
| 945 | + | |
| 946 | + | |
908 | 947 | | |
909 | 948 | | |
910 | 949 | | |
911 | 950 | | |
912 | 951 | | |
913 | | - | |
| 952 | + | |
| 953 | + | |
914 | 954 | | |
915 | 955 | | |
916 | 956 | | |
| |||
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
327 | 374 | | |
328 | 375 | | |
329 | 376 | | |
| |||
0 commit comments