I’m using the Chilkat lib to access mail via IMAP. One customer tries to delete his mail without success. He sees the mail being deleted in Mail and then coming back. Unfortunately, I can’t reproduce the problem. I’ve no clue if the problem comes from the Chilkat lib, my code or even Mail.
Deleting mails isn’t complicated. The mailbox needs to be selected and then the deleted flag is added for the mail:
[code]Function deleteMail(currentMessage as Integer) As Boolean
if counter > NoOfMails then Return False
if MessageSet = nil then Return False
dim messageID as Integer = MessageSet.getID(counter - 1)
declare Function SetDeleteFlag lib ImapLibLocation selector “SetFlag:bUid:flagName:value:” (obj as Ptr, n as Ptr, fetchUuids as Boolean, _
flag as CFStringRef, value as Ptr) as Boolean
dim n as Cocoa.NSNumber = NSNumber.CreateWithInteger(messageID)
dim value as Cocoa.NSNumber = NSNumber.CreateWithInteger(1)
dim theResult as Boolean = SetDeleteFlag(self, n, True, “\Deleted”, value)
After adding verbose logging I can see that the delete is executed:
aaaf OK Fetch completed (0.000 secs).
aaag UID STORE 1 +FLAGS.SILENT (\Deleted)
aaag OK Store completed (0.000 secs).
Any idea what could cause this?
Mac OS 10.11, Xojo 2015r4.