On Mon, 2013-03-25 at 17:00 -0700, kd6...@yahoo.com wrote:
> This is what I saw:
> >  if ($retval ne 'CONTINUE') {
> >  $sock->print("QUIT\r\n");
> 
> Looks pretty conditional to me.  If the return value is the continue literal, 
> no quit is issued.

I've now pulled mimedefang.pl.in from the 2.73 tarball off the website.
Here's the function from HELO onwards:

    $sock->print("HELO $helo\r\n");
    $sock->flush();

    ($retval, $code, $dsn, $text) = get_smtp_return_code($sock, $recip, 
$server);
    if ($retval ne 'CONTINUE') {
        $sock->print("QUIT\r\n");
        $sock->flush();
        # Swallow return value
        get_smtp_return_code($sock, $recip, $server);
        $sock->close();
        return ($retval, $text, $code, $dsn);
    }

    $sock->print("MAIL FROM:$sender\r\n");
    $sock->flush();

    ($retval, $code, $dsn, $text) = get_smtp_return_code($sock, $recip, 
$server);
    if ($retval ne 'CONTINUE') {
        $sock->print("QUIT\r\n");
        $sock->flush();
        # Swallow return value
        get_smtp_return_code($sock, $recip, $server);
        $sock->close();
        return ($retval, $text, $code, $dsn);
    }

    $sock->print("RCPT TO:$recip\r\n");
    $sock->flush();

    ($retval, $code, $dsn, $text) = get_smtp_return_code($sock, $recip, 
$server);
    $sock->print("QUIT\r\n");
    $sock->flush();
    # Swallow return value
    get_smtp_return_code($sock, $recip, $server);
    $sock->close();
    return ($retval, $text, $code, $dsn);

Here, in the last chunk, is the unconditional QUIT. The other,
conditional, QUIT commands handle error cases. If the whitespace was
like this instead, it'd be easier to see:

    $sock->print("RCPT TO:$recip\r\n");
    $sock->flush();
    ($retval, $code, $dsn, $text) = get_smtp_return_code($sock, $recip, 
$server);

    $sock->print("QUIT\r\n");
    ...

-- 
Richard

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to