-----BEGIN PGP SIGNED MESSAGE-----

At 8:39 AM -0400 4/26/01, Eric Krichbaum wrote:
>Doesn't this break the if...then... else logic?    I didn't/can't
>test this because we don't use send on POP but shouldn't this be:
>  [snip]


I tested the previous patch, and it did work (actually, I left off a 
"fputc(...)" which swallows a newline  for an "escaped" '.'),
but the pagination of that section
of code was bad enough that it sure didn't look right.

Anyway, here, properly paginated, is what that section of code should 
look like, followed by the patch. I have tested this (PGP signatures 
verify, including for messages with escaped '.'s).

Jacques

%%%%%%%%%%%%% the code %%%%%%%%%%%%%%%%%%

int
pop_xmit_recv ( p, buffer )
POP  *p;
char *buffer;
{

     /*
      * Data written to a file should follow UNIX or local EOL format ('\n').
      * sendmail and some MTAs will ignore superfluous CRs, but not all will.
      */

     /*
      * Look for initial period
      */
     DEBUG_LOG2 ( p, "Receiving (%d): \"%.128s\"", strlen(buffer), buffer );
     if ( buffer[0] == '.' ) {
         /*
          * Exit on end of message
          */
         if ( buffer[1] == '\0' ) {
             DEBUG_LOG0 ( p, "Received end of msg" );
             fclose ( tmp );
             p->xmitting = FALSE;
             Pop ( &(p->InProcess) );
             pop_xmit_exec ( p );
         }

         /*
          * sendmail will not remove escaped ..
          */
         else {
             if ( buffer[1] == '.' ) {
                 fputs ( &buffer[1], tmp );
                 fputc ( '\n', tmp );
             }
             else {
                 fputs ( buffer, tmp );
                 fputc ( '\n', tmp );
             }
         }
     }
     else {
         fputs ( buffer, tmp );
         fputc ( '\n', tmp );
     }
     return 0;
}

%%%%%%%%%%%%%% the patch %%%%%%%%%%%%%%

*** popper/pop_xmit.c.orig      Tue Feb 20 19:15:21 2001
- --- popper/pop_xmit.c   Thu Apr 26 11:59:55 2001
***************
*** 161,172 ****
           /*
            * sendmail will not remove escaped ..
            */
!         else if ( buffer[1] == '.' )
!             fputs ( &buffer[1], tmp );
!         else
!             fputs ( buffer, tmp );
!     } else
           fputs ( buffer, tmp );
       return 0;
   }

- --- 162,182 ----
           /*
            * sendmail will not remove escaped ..
            */
!         else {
!             if ( buffer[1] == '.' ) {
!                 fputs ( &buffer[1], tmp );
!                 fputc ( '\n', tmp );
!             }
!             else {
!                 fputs ( buffer, tmp );
!                 fputc ( '\n', tmp );
!             }
!         }
!     }
!     else {
           fputs ( buffer, tmp );
+         fputc ( '\n', tmp );
+     }
       return 0;
   }


-----BEGIN PGP SIGNATURE-----
Version: PGP                                                          
Comment: Public Key - http://golem.ph.utexas.edu/~distler/distler.asc

iQCVAwUBOuhZ4aIBi34rsX+ZAQEavQQAzO14iuLtgyEVE1TrNoFIINSHu9iUaOOg
/Wx8eX+S4x7D1pS7YIZgYDALqY4jJRSENpPW0LgQwCYT0tcLekbC13m53RyaVuRx
Hcn7AsmrjLKSDi7zSodDfjytO5dF8gDhsmf7dIl2H0rhTsK1wnKqql5yOc5p28bR
wkGqZCjVNno=
=r3PC
-----END PGP SIGNATURE-----

Reply via email to