fdm icon indicating copy to clipboard operation
fdm copied to clipboard

Garbled headers after remove-headers action

Open dezifit opened this issue 5 years ago • 3 comments

Using the remove-headers function leaves all multi line headers unwrapped. This affects the received lines and some other headers, which now are all written in a single line.

I'm trying to strip some X-MS-* headers (partly multi line also) before writing mails in mbox format. It seems that deliver-remove-header fails to restore the wrapping, possibly as a result of wrong offset calculation.

dezifit avatar Nov 25 '20 22:11 dezifit

Am I meant to use my ESP powers to work out your fdm version and see your config and -vv output?

nicm avatar Nov 26 '20 08:11 nicm

It's the latest released version 2.0 (from VOID linux), see attached files. I also tested with sources compiled from git-master: same issue. header-removal-test.zip

dezifit avatar Nov 26 '20 09:11 dezifit

After some more tests and reading the code I'm sure that the issue is caused by calling set_wrapped inside the loop of headers to remove. The first call of set_wrapped works as expected, while the 2nd fails to find any multi-line headers (as they are already wrapped) - the wrap position array is empty now, which suppresses the final unwrap step.

dezifit avatar Nov 26 '20 11:11 dezifit