ported and modified spamd smtp connection state machine