similar to imap. the code should be merged. this also reads the abort-line after authentication failure.