[Imap-protocol] Deleting selected mailbox

Andris Reinman <[email protected]> Sat, 30 Dec 2017 04:15:14 +0200
Newsgroups gmane.mail.imap.general
Message-ID <CAPacwgy_nVaePkawv3r2SVOM3yADyRjaX-=mfY_djevPSaV-Zw@mail.gmail.com>
--===============5674051037829113310==
Content-Type: multipart/alternative; boundary="001a11377074ceafef056185515c"

--001a11377074ceafef056185515c
Content-Type: text/plain; charset="UTF-8"

Hi,

I'm wondering that if a client issues a DELETE against the mailbox that is
currently SELECTed then what should be the correct way to handle this. In
most cases it seems that servers respond with untagged BYE. Would it be
correct to send the BYE before tagged response for DELETE or not?

I have a race condition in WildDuck IMAP server where sometimes the
notification about deleted folder gets processed before tagged response is
sent to the client, so while in most cases this happens:

C: A SELECT FOLDER
S: (mailbox info)
S: A OK [READ-WRITE] SELECT completed
C: A DELETE FOLDER
C: A OK DELETE completed
C: * BYE Selected mailbox was deleted, have to disconnect
(connection is closed by server)

Then sometimes it is like this (no response for DELETE):

C: A SELECT FOLDER
S: (mailbox info)
S: A OK [READ-WRITE] SELECT completed
C: A DELETE FOLDER
C: * BYE Selected mailbox was deleted, have to disconnect
(connection is closed by server)

Is the latter a violation of IMAP RFCs? I mean that once the client
reconnects the folder is not there anymore anyway?

Regards,
Andris Reinman
https://github.com/nodemailer/wildduck#wild-duck-mail-server

--001a11377074ceafef056185515c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>I&#39;m wondering that if a client =
issues a DELETE against the mailbox that is currently SELECTed then what sh=
ould be the correct way to handle this. In most cases it seems that servers=
 respond with untagged BYE. Would it be correct to send the BYE before tagg=
ed response for DELETE or not?</div><div><br></div><div>I have a race condi=
tion in WildDuck IMAP server where sometimes the notification about deleted=
 folder gets processed before tagged response is sent to the client, so whi=
le in most cases this happens:</div><div><br></div><div><div>C: A SELECT FO=
LDER</div><div>S: (mailbox info)</div><div>S: A OK [READ-WRITE] SELECT comp=
leted</div><div>C: A DELETE FOLDER</div><div>C: A OK DELETE completed</div>=
<div>C: * BYE Selected mailbox was deleted, have to disconnect</div></div><=
div>(connection is closed by server)<br></div><div><br></div><div>Then some=
times it is like this (no response for DELETE):</div><div><br></div><div><d=
iv>C: A SELECT FOLDER</div><div>S: (mailbox info)</div><div>S: A OK [READ-W=
RITE] SELECT completed</div><div>C: A DELETE FOLDER</div><div>C: * BYE Sele=
cted mailbox was deleted, have to disconnect</div></div><div>(connection is=
 closed by server)</div><div><br></div><div>Is the latter a violation of IM=
AP RFCs? I mean that once the client reconnects the folder is not there any=
more anyway?</div><div><br></div><div>Regards,</div><div>Andris Reinman</di=
v><div><a href=3D"https://github.com/nodemailer/wildduck#wild-duck-mail-ser=
ver">https://github.com/nodemailer/wildduck#wild-duck-mail-server</a><br></=
div></div>

--001a11377074ceafef056185515c--

--===============5674051037829113310==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Imap-protocol mailing list
[email protected]
http://mailman13.u.washington.edu/mailman/listinfo/imap-protocol
--===============5674051037829113310==--