diff -urNb qpopper4.0.5/popper/main.c qpopper4.0.5_logfile2/popper/main.c --- qpopper4.0.5/popper/main.c Tue Mar 25 13:52:04 2003 +++ qpopper4.0.5_logfile2/popper/main.c Fri Mar 21 12:54:36 2003 @@ -526,6 +526,15 @@ fileno(stdin), fileno(stdout), fileno(stderr), i, rslt, msg_out ); #endif /* not _DEBUG */ + if ( logfile_file != NULL ) + { + logit ( logfile_file, POP_DEBUG, HERE, + "Info %s%.*s%s version %s (non-standalone)", + QPOP_NAME, + (strlen(BANNERSFX)>0 ? 1 : 0), " ", + BANNERSFX, + VERSION ); + } /* * Set up the socket on which we listen @@ -688,6 +697,14 @@ inet_ntoa ( cli_addr.sin_addr ), ntohs ( cli_addr.sin_port ) ); + if ( logfile_file != NULL) + { + logit( logfile_file, POP_INFO, HERE, + "Connection %s %d", + inet_ntoa ( cli_addr.sin_addr ), + ntohs ( cli_addr.sin_port ) ); + } + if ( newsockfd > 0 ) motherforker ( newsockfd, sockfd ); else @@ -779,6 +796,8 @@ fprintf ( err_out, "%s\n", msg_buf ); logit ( trace_file, POP_PRIORITY, fn, ln, "%s", msg_buf ); + if ( logfile_file != NULL) + logit ( logfile_file, POP_PRIORITY, fn, ln, "%s", msg_buf ); if ( Qargv_alloc ) { @@ -850,6 +869,8 @@ fprintf ( err_out, "%s\n", msg_buf ); logit ( trace_file, POP_PRIORITY, fn, ln, "%s", msg_buf ); + if ( logfile_file != NULL) + logit ( logfile_file, POP_PRIORITY, fn, ln, "%s", msg_buf ); fflush ( err_out ); } diff -urNb qpopper4.0.5/popper/pop_get_command.c qpopper4.0.5_logfile2/popper/pop_get_command.c --- qpopper4.0.5/popper/pop_get_command.c Tue Mar 25 13:51:16 2003 +++ qpopper4.0.5_logfile2/popper/pop_get_command.c Tue Mar 25 14:15:50 2003 @@ -78,7 +78,7 @@ /* * Save a copy of the original client line */ - if ( DEBUGGING && p->debug ) + if ( (DEBUGGING && p->debug) || p->logfile != NULL) strncpy(buf, mp, sizeof(buf)); /* @@ -103,6 +103,24 @@ buf [ len ] = '\0'; pop_log ( p, POP_DEBUG, HERE, "Received (%d): \"%s\"", len, buf ); + } + } + + if ( p->logfile ) { + if ( strcmp ( p->pop_command, "pass" ) == 0 ) + logit ( p->logfile, POP_DEBUG, HERE, + "Recv %s@%s \"%s xxxxxxxxx\"", + p->user, p->ipaddr, p->pop_command ); + else { + int len = strlen(buf); + while ( len > 0 && + ( buf [ len - 1 ] == '\n' || buf [ len - 1 ] == '\r' ) ) + len--; + + buf [ len ] = '\0'; + logit ( p->logfile, POP_DEBUG, HERE, + "Recv %s@%s \"%s\"", + p->user, p->ipaddr, buf ); } } diff -urNb qpopper4.0.5/popper/pop_updt.c qpopper4.0.5_logfile2/popper/pop_updt.c --- qpopper4.0.5/popper/pop_updt.c Tue Mar 25 13:51:18 2003 +++ qpopper4.0.5_logfile2/popper/pop_updt.c Fri Mar 21 12:54:36 2003 @@ -293,11 +293,21 @@ DEBUG_LOG0 ( p, "Checking to see if all messages were deleted" ); if ( p->bStats ) { + if ( p->logfile ) { + logit( p->logfile, POP_PRIORITY, HERE, + "Stats %s %d %ld %d %ld %s %s", + p->user, p->msgs_deleted, p->bytes_deleted, + p->msg_count - p->msgs_deleted, + p->drop_size - p->bytes_deleted, + p->client, p->ipaddr ); + } else { pop_log ( p, POP_PRIORITY, HERE, "Stats: %s %d %ld %d %ld %s %s", p->user, p->msgs_deleted, p->bytes_deleted, p->msg_count - p->msgs_deleted, p->drop_size - p->bytes_deleted, p->client, p->ipaddr ); + } + } if ( p->server_mode && p->dirty == FALSE ) {