These patchs solves and infinite loop when sending mail

Without checking for POLLHUP on client's stderr the test

    while (!eof_fd || !eof_cstderr) {

would never fail, thus entering an infinite loop

That would at last fail because of the timeout