implement main smtp loop (single thread)