in reply to pop3 termination octet

The RFC actually reads:

When all lines of the response have been sent, a final line is sent, consisting of a termination octet (decimal code 046, ".") and a CRLF pair.
What you want to be printing is:
print ".\r\n";

/J\