Update the mta internals to clarify the logic and make it easier to
deal with limits and additianl features later.  The relay tries to
create new connectors, and connectors try to spawn sessions.
count connections on domain
Fix bogus AF mismatch error report if there is a pending MX.
Merge branch 'master' into mta-rework

Conflicts:
	smtpd/mta.c
trace all messages
Merge branch 'master' into mta-rework
fix event handling and pauses in ssl layer to avoid possible crash
Merge branch 'master' into mta-rework
Add flags on route to alter the way they are used to create new
connections:

A route is flagged as NEW until the first connection on it becomes
ready to send mail.  No new connection is attmepted on this route
before that.

A route can be marked as DISABLED, in which case it is ignored in
route lookups, but triggers an error on the connector if no other valid
route is found.  For now, a route is disabled if it is NEW and the
first connection failed to establish a proper SMTP link. It is
re-enabled after a while, and flagged as NEW again.
make client socket non blocking to avoid evil client from causing
trouble in a SSL handshake. while at it, make event masking a bit
more strict to avoid possible bugs
Merge branch 'master' into mta-rework
cleanup ssl-tree building and make sure it is done in smtpd -n case too
Check error with getsockopt() to properly detect the timeout on connect.
Check error with getsockopt() to properly detect the timeout on connect.
sync with OpenBSD
Keep a "penalty" counter on a route that gets incremented when a route
gets disabled for some reason.  The route is disabled for a duration
that depends on the current penalty value. When it expires, the
route is set to new again, the penalty is lowered and a timer
is set to further reduce the penalty later until it drops to 0.
When too many mails are rejected in a row on a connection, consider the
route as down, and disable it for a while.
Add a higher penalty for host to which conection failed right away.
Merge branch 'master' into mta-rework
fix format string