protected Response getReply() {
        try {
            if (read == null) {
                read = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            }
            String line;
            int code = -1;
            ArrayList<String> responses = new ArrayList<String>();
            while ((line = read.readLine()) != null) {
                if (line.length() < 4)
                    throw new SMTPDisconnectedException("Not enough data read.");
                if (debug) {
                    java.lang.System.out.print('<');
                    java.lang.System.out.println(line);
                }
                code = Integer.parseInt(line.substring(0, 3));
                responses.add(line.substring(4));
                if (line.charAt(3) != '-')
                    break;
            }
            return new Response(code, join("\n", responses));
        } catch (IOException e) {
            throw new SMTPException(e);
        }
    }