Subject: Another ipop3d POP_PROXY mode problem

From: 최성훈 <[email-masked]>
Date: Fri, 17 Sep 2004 11:11:28 +0900 (KST)

In imap-2004b.DEV.SNAP-0409141527, another problem exist when QUIT.

QUIT command -> mm_log( ..., BYE ) -> syslog( "Mailbox closed .." ) -> _exit(1)

So, "QUIT" command does not reply and connection closed.(and many "Mailbox closed" syslog messages)

Please, check the following patch.

Thanks

========== ipop3d.c temporary patch ==========

*** ipop3d.c.orig	Fri Sep 17 10:53:24 2004
--- ipop3d.c	Fri Sep 17 10:58:03 2004
***************
*** 74,79 ****
--- 74,80 ----
  long *msg = NIL;		/* message translation vector */
  logouthook_t lgoh = NIL;	/* logout hook */
  char *sayonara = "+OK Sayonara\015\012";
+ int bye_check = T;

  /* Function prototypes */
***************
*** 445,450 ****
--- 446,452 ----
      mail_expunge (stream);
      syslog (LOG_INFO,"Logout user=%.80s host=%.80s nmsgs=%ld ndele=%ld",
  	    user,tcp_clienthost (),stream->nmsgs,ndele);
+     bye_check = NIL;
      mail_close (stream);
    }
    else syslog (LOG_INFO,"Logout user=%.80s host=%.80s",user ? user : "???",
***************
*** 471,476 ****
--- 473,479 ----
    else {			/* try to gracefully close the stream */
      if ((state == TRANSACTION) && !stream->lock) {
        rset ();
+       bye_check = NIL;
        mail_close (stream);
      }
      state = LOGOUT;
***************
*** 499,504 ****
--- 502,508 ----
      else {			/* try to gracefully close the stream */
        if ((state == TRANSACTION) && !stream->lock) {
  	rset ();
+         bye_check = NIL;
  	mail_close (stream);
        }
        state = LOGOUT;
***************
*** 525,530 ****
--- 529,535 ----
    else {			/* try to gracefully close the stream */
      if ((state == TRANSACTION) && !stream->lock) {
        rset ();
+       bye_check = NIL;
        mail_close (stream);
      }
      state = LOGOUT;
***************
*** 883,888 ****
--- 888,894 ----
      syslog (LOG_DEBUG,"%s",string);
      break;
    case BYE:			/* driver broke connection */
+     if (!bye_check) break;
      alarm (0);			/* disable all interrupts */
      server_init (NIL,NIL,NIL,SIG_IGN,SIG_IGN,SIG_IGN,SIG_IGN);
      syslog (LOG_INFO,"Mailbox closed (%.80s) user=%.80s host=%.80s",

------------------------------------------------

Choi, Sung-hoon 

DreamWiz Inc. - Development Team/Manager 

Major : Mail/Web/Network/System/Security 
Phone : +82-2-3434-3541 
MSN   : [email-masked] 
WWW   : http://my.dreamwiz.com/shoon/ 
E-mail: [email-masked]

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Thu, 16 Sep 2004 19:26:22 -0700 (Pacific Daylight Time)

It should suffice to check in the BYE case for (state != UPDATE), and 
don't do the "Mailbox closed" action if (state == UPDATE).

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

---

From: 최성훈 <[email-masked]>
Date: Fri, 17 Sep 2004 12:05:36 +0900 (KST)

It works correctly.

Thanks.

----- Original Message ----- 
From: "Mark Crispin" [email-masked]
To: [email-masked]
Cc: [email-masked]
Date: Thu, 16 Sep 2004 19:26:22 -0700 (Pacific Daylight Time)
Subject: Re: Another ipop3d POP_PROXY mode problem 

-- Mark -- 

Choi, Sung-hoon