'Get a reply from the server.
Returns a tuple consisting of:
- server response code (e.g. \'250\', or such, if all goes well)
Note: returns -1 if it can\'t read response code.
- server response string corresponding to response code (multiline
responses are converted to a single, multiline string).
Raises SMTPServerDisconnected if end-of-file is reached.'

def getreply(self):

    resp = []
    if (self.file is None):
        self.file = self.sock.makefile('rb')
    while 1:
        try:
            line = self.file.readline((_MAXLINE + 1))
        except socket.error as e:
            self.close()
            raise SMTPServerDisconnected(('Connection    unexpectedly    closed:    ' + str(e)))
        if (line == ''):
            self.close()
            raise SMTPServerDisconnected('Connection    unexpectedly    closed')
        if (self.debuglevel > 0):
            print >>stderr, 'reply:', repr(line)
        if (len(line) > _MAXLINE):
            raise SMTPResponseException(500, 'Line    too    long.')
        resp.append(line[4:].strip())
        code = line[:3]
        try:
            errcode = int(code)
        except ValueError:
            errcode = (-1)
            break
        if (line[3:4] != '-'):
            break
    errmsg = '\n'.join(resp)
    if (self.debuglevel > 0):
        print >>stderr, ('reply:    retcode    (%s);    Msg:    %s' % (errcode, errmsg))
    return (errcode, errmsg)
