Sorry, somehow I missed reading parts of your comment, misunderstanding you got sort of working solution.
I think it is still good to make a PR, because there I can assist you easier on how to get the value from From header, commenting on patch lines.