Hi, this is the third iteration of this series. There was a request to rebase the changes on the refactoring patch b6049542 ("send-email: extract email-parsing code into a subroutine", 2017-12-15). This is the result. The diffstat is the same compared to the last revision. It could be made smaller by sacrificing readibility and breaking the scheme introduced by the refactoring patch. But I do agree that send-email's readability could benefit from slicing it into handy functions. And the refactoring patch reduces the nesting of loops/conditionals. But it's your code, you decide. I can re-send a fixed-up v2 without the rebasing. So long, - Christian