Code Duplication    Length = 6-6 lines in 4 locations

src/engine/smtp.php 4 locations

@@ 100-105 (lines=6) @@
97
        return FALSE;
98
    }
99
100
    if (!smtp_read_response($link))
101
    {
102
        debug_write_log(DEBUG_WARNING, '[smtp_send_mail] SMTP server replied a failure.');
103
        fclose($link);
104
        return FALSE;
105
    }
106
107
    $requests = array('EHLO ' . php_uname('n'));
108
@@ 135-140 (lines=6) @@
132
        debug_write_log(DEBUG_DUMP, '[smtp_send_mail] ' . $request);
133
        fwrite($link, $request . "\n");
134
135
        if (!smtp_read_response($link))
136
        {
137
            debug_write_log(DEBUG_WARNING, '[smtp_send_mail] SMTP server replied a failure.');
138
            fclose($link);
139
            return FALSE;
140
        }
141
142
        if ($request == 'STARTTLS')
143
        {
@@ 160-165 (lines=6) @@
157
    debug_write_log(DEBUG_DUMP, '[smtp_send_mail] DATA');
158
    fwrite($link, "DATA\n");
159
160
    if (!smtp_read_response($link))
161
    {
162
        debug_write_log(DEBUG_WARNING, '[smtp_send_mail] SMTP server replied a failure.');
163
        fclose($link);
164
        return FALSE;
165
    }
166
167
    debug_write_log(DEBUG_DUMP, '[smtp_send_mail] ' . $headers);
168
    debug_write_log(DEBUG_DUMP, '[smtp_send_mail] Subject: ' . $subject);
@@ 177-182 (lines=6) @@
174
    fwrite($link, "{$message}\r\n");
175
    fwrite($link, ".\r\n");
176
177
    if (!smtp_read_response($link))
178
    {
179
        debug_write_log(DEBUG_WARNING, '[smtp_send_mail] SMTP server replied a failure.');
180
        fclose($link);
181
        return FALSE;
182
    }
183
184
    debug_write_log(DEBUG_DUMP, '[smtp_send_mail] QUIT');
185
    fwrite($link, "QUIT\n");