i redirected STDERR (yes, the debug output goes to STDERR) to a file and i found that the mail server was returning errors but it didn't close the connection until the DATA command was issued, then it returns the "Invalid command order" error and close the connection (in fact in all the cases the first error issued was an invalid mailbox error)