MBOX-Line: From mrc at CAC.Washington.EDU  Thu Feb 23 09:06:06 2006
To: imap-protocol@u.washington.edu
From: Mark Crispin <mrc@CAC.Washington.EDU>
Date: Fri Jun  8 12:34:36 2018
Subject: [Imap-protocol] Problem in receiving mail using imap
In-Reply-To: <7FEBB30F0CE41B419B38295024A58EE34D63B9@oxygen.mail.telnet.tunis>
References: <7FEBB30F0CE41B419B38295024A58EE34D63B9@oxygen.mail.telnet.tunis>
Message-ID: <Pine.OSX.4.64.0602230856470.13900@pangtzu.panda.com>

For future reference, please send questions involving the UW IMAP software 
to the imap-uw mailing list.  The imap-protocol mailing list is for 
questions dealing with the IMAP protocol architecture and not for software 
questions.  Thank you.

There are several problems.

First, you MUST NOT call mail_link() directly, and especially you should 
not do it in a subroutine.  Instead, at the very start of your main() 
function, you should have:
 	#include "linkage.c"

It is unpredictable what would happen if you fail to use the proper 
linkage.c, or if you call mail_link() for the same driver multiple times.

Second, I observe that you are doing:
 						//reouverture
 					   l_mstream=mail_open(l_mstream,g_a_cOpenMailString,T);
 					   //raifraichissement
 					   l_mstream=mail_open(l_mstream,g_a_cOpenMailString,T);
immediately after the mail_expunge() call.  I don't know why these 
statements are there, but they are definitely wrong.

Also note that in POP3, the action of an expunge does not actually happen 
until a proper close.  That is because the POP3 protocol does not remove 
messages until QUIT time.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.

