hook: small refactor to store hooks as dict instead of list
We are about to take untrusted hooks into account (to report them as failures)
so we need to rearrange the code a bit to allow config overwriting each other
in a later patch.
mail: retain hostname for sslutil.wrapsocket (
issue5203)
SMTPS + STARTTLS need to provide serverhostname,
and we can't store it in sslkwargs because that breaks
something involving the https protocol.
tests: make test-trusted use print_function
There was some confusing output format at some places in
test-trusted.py.out, the new print function ends with a newline by
default whereas the old print statement uses a space generally. So the
output in test-trusted.py.out is changed because of some confusing
output format which was produced by print statement