php - Detect successful deletion by imap_delete() and imap_expunge() -
i behind unstable network. network disconnection happens.
is there way find whether imap_delete used along imap_expunge deleted mail service because imap_delete returns true no matter what.
i tried setting custom error handler found out neither exception nor warning or error beingness issued imap_delete() or imap_expunge()
one can never sure: imap_delete set \deleted flag.
there's couple different scenarios: case 1:
1) `store` command received server 2) received `ok`.
if receive ok server, can sure server accepted command (although, message may not exist, , setting flags on non existent message not error)
case 2:
1) `stor`e command received server 2) did not receive `ok` due network failure
in case, cannot sure whether message marked deleted or not, since didn't receive ok. in case, should reissue delete when reconnect.
case 3:
1) `store` command not received server. 2) did not receive `ok` due network failure
this indistinguishable previous case. should reissue delete. storing flag 1 time again may redundant, won't wound anything.
i expect latter 2 cases cause sort of error, in case it's safe reissue commands. uses php library can chime in on that.
php imap
No comments:
Post a Comment