Postini - qmail-remote connection died errors

Discussion in 'qmail' started by popowich, Jul 19, 2011.

  1. popowich

    popowich EQ Forum Admin Staff Member

    Joined:
    Aug 12, 2008
    Messages:
    8,999
    Likes Received:
    120
    PHP:
    --- qmail-1.03/qmail-remote.c   1998-06-15 04:53:16.000000000 -0600
    +++ qmail-1.03-571/qmail-remote.c       2011-04-25 11:39:07.513583926
    -0600
    @@ -158,+158,32 @@
         
    get(&ch);
         
    get(&ch);
       }
    -  while (
    ch != '\n'get(&ch);
    +  while (
    ch != '\n')
    +  {
    +    
    // Postini can return a 571 SMTP code terminated with a '\r' but no
    +    // '\n'.  The result is that we are trapped in this while loop
    until
    +    // saferead() times out and the message is drop()ed. This means a
    +    // message that should be a permanent failure is instead requeued
    +    // continually until it ages out.  Try to catch and prevent this:
    +    if (ch == '\r' && code == 571)
    +    {
    +
    +     
    // Cap smtptext with a '\n' so future uses of the string look
    right
    +      unsigned char LF;
    +      
    LF '\n';
    +      if (!
    stralloc_append(&smtptext,&LF)) temp_nomem();
    +
    +     
    // Returning here potentially leaves a '\n' in the fd (if someone
    +     // later correctly implements a 571 error with CRLF), but since
    +     // this means we will be quitting before we read() again we'll
    +     // not worry about it.
    +     return code;
    +    }
    +    else
    +    {
    +      
    get(&ch);
    +    }
    +  }

       return 
    code;
     }
     


Want to reply or ask your own question?

It only takes a minute to sign up (and it's free!). Click the orange sign up button to choose a username and then you can ask your own questions on the forum.
Loading...