How do you delete mail in IMAP? kOW3imapActionExecute
Miguel Garcia
miguel.garcia at roig.com
Tue Feb 14 19:01:43 UTC 2023
Hi Mike,
We are using imap_ow3.lbs sample library provided by Omnis Studio 10.22
31918. Effectively the imap object is a subclass of the imap worker
object. I will ask support for the new build 31986 or for the OW3.xComp.
If it not work with the new built i will ask you for the configuration
in O365.
Thanks.
Best regards.
El 14/2/23 a las 19:11, Mike Matthews - Omnis via omnisdev-en escribió:
> Hello Miguel,
>
> Yes, we are using O365 with oAuth2 and the OW3 worker. But it was not easy to start with, we had a lot of help from UK support to figure out what was happening. The example library is fine however.
>
> Are you subclassing your IMAP worker object? If so, then after you get the $token successfully, you can’t use it with a subclassed IMAP worker object. That fault was raised and fixed with a release of new OW3 xcomp. You need to be using Omnis Studio v10.22 build 31986 or ask for the OW3.xComp
>
> There is no problem using O365 with oAuth2 and the IMAPWorker now. Let me know if you need any more help.
>
> Mike Matthews
>
> Lineal Software Solutions
> Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>
>
> omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>
>
> www.lineal.co.uk<http://www.lineal.co.uk/>
>
> www.sqlworks.co.uk<http://www.sqlworks.co/>
>
>
>
> On 14 Feb 2023, at 18:01, Miguel Garcia <miguel.garcia at roig.com<mailto:miguel.garcia at roig.com>> wrote:
>
> Caution: This is a message which has originated from outside the organisation. Ensure the sender is trusted and the content is safe before opening links or attachments.
>
>
>
> Hi Mike,
>
> Are you using IMAP WORKER with OAuth2?. It works fine? What email do you
> use?
>
> We are testing IMAP WORKER OAuth2 with office365 mail. At the moment it
> doesn't work. The authorization using oAuth worker works fine, but we
> can't not autenticate with the token received in the authorization proccess.
>
> I think there is something that is not well defined in Office365.
>
> Best Regards.
>
>
> El 14/2/23 a las 18:31, Mike Matthews - Omnis via omnisdev-en escribió:
> Hello Miguel,
>
> Interesting use of the Append function.
>
> I use the kOW3imapActionSetMessageFlags function to flag the email to be deleted.
>
> Then I use the kOW3imapActionExecute function to send the command ‘CLOSE’ or ‘EXPUNGE’ which then does the final removal from the mailbox.
>
> I was trying to move the flagged email to the ‘Deleted Items’ folder if the user wanted to keep it until they clear the old emails. I now know how to copy/move emails using the OW3 workers.
>
> The original IMAP commands were fine, until the need for oAuth2 came along.
>
> Thanks
>
> Mike
>
>
> On 14 Feb 2023, at 07:53, Miguel Garcia <miguel.garcia at roig.com<mailto:miguel.garcia at roig.com><mailto:miguel.garcia at roig.com>> wrote:
>
> Caution: This is a message which has originated from outside the organisation. Ensure the sender is trusted and the content is safe before opening links or attachments.
>
>
>
> Hi Mike,
>
> We copy messages through the following steps :
>
> 1. Read the message that you want copy with kOW3imapActionFetchMessage.
>
> 2 Remove the messageid, oIMAP.$removemessageid.$assign(kTrue)
>
> 3 Append the message with kOW3imapActionAppendMessage.
>
> Best Reards.
>
> El 11/2/23 a las 15:41, Mike Matthews - Omnis via omnisdev-en escribió:
> In some RFC pages, I found a list of commands:
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.rfc-editor.org%2frfc%2frfc3501%23page-23&c=E,1,WQ4DQVEiaX0C4YSaxEwRZRIjwwGTRJJ3t-GYgtEF6PWQbisPqEO3In24AgyRPuLueo0pHi9BrPZJbduTeUCIIXCAjVRxUwmsSIzHLyIqpTuJ1rA,&typo=1
>
> Section 6 has them.
>
> I’m trying to use the kOW3imapActionExecute COPY command where I want to move an email to another mailbox. I just can’t get the OW3 worker to do this.
>
> I can get the same kOW3imapActionExecute to make new MailBoxes, etc. But copying an email just fails! Arghh..
>
> Anybody have this working and can share some examples please?
>
> Thanks
>
> Mike Matthews
>
> Lineal Software Solutions
> Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>
>
> omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>
>
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.lineal.co.uk&c=E,1,HsVUWSPvap2JAbAymFHtDrGmtV7cXKyhpbzx3Xq2UUx74UMC0AxwloODPVdZloibtuhGNdw06xW9MyRof6RY8kIcjN9SwHhk1JREG2fCKCr_ZM8,&typo=1<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.lineal.co.uk%2f&c=E,1,O6P-UW3gCTBpBIdrMkyNORkC3FMpm90XqMr8eRSrYggFH1mEGilTa5jJjlfG7DZv2IU5JjWg3E2ARBgKyfyNKO4jiK6i8QXVvvQrLswbJl6ahyg,&typo=1>
>
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.sqlworks.co.uk&c=E,1,RKBjZ19QlVg2_KAy4pIIXHTmFNmI9Re5Ge2p_ynErpmDirLPEhPSRIU1BBd9mOD4GPbKcOaXjjk4IOudc9CwqWtVuD0w2vBPPZtSb1H1Z6tivkzdMY01hzFK4Kc,&typo=1<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.sqlworks.co%2f&c=E,1,cL1rCbktqLuhY9zIUY5J9R3ZmKfiDpT2RbTH19NqX9JcdrNI6tUzuQqwrPcI08OavW4wlGlMjEXSYphtmlY2PTLVG9OqFiH9MNBZg9PZGxrmVhuDQHMFKkxW5ZO_&typo=1>
>
>
>
> On 11 Feb 2023, at 09:40, Mike Matthews - Omnis via omnisdev-en <omnisdev-en at lists.omnis-dev.com<mailto:omnisdev-en at lists.omnis-dev.com>> wrote:
>
> Caution: This is a message which has originated from outside the organisation. Ensure the sender is trusted and the content is safe before opening links or attachments.
>
>
>
> Hello All,
>
> I’m following up on this thread from earlier. How do you find all of the possible commands available when you use ‘kOW3imapActionExecute’?
>
> Kindly, EXPUNGE is shown here by Miguel. So I’m guessing there must be a reference doc somewhere? Hoping that might include adding new mailboxes, etc.
>
> Thanks
>
> Mike Matthews
>
> Lineal Software Solutions
> Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>
>
> omnis at lineal.co.uk<mailto:omnis at lineal.co.uk><mailto:mike.matthews at lineal.co.uk>
>
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.lineal.co.uk&c=E,1,5iFDCKSIcTnckOx3FX9802oaKTWkMLM3wV1hMkZzyr7zx1Zmd_fFUAvQvXfKRJuLfwjmSrkEfjtpO1DyoBENsxuDexH28fVz4wlaYqM9iEefIw4,&typo=1<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.lineal.co.uk&c=E,1,Lb0Ct6PAOA1bMj0UeJN3R9C7sLPxPt4hMLydv_TSZiFSnv4pFdPYoTbfpfHcWeDliqpkWNjwoBwsGDbg2G-BeNrxp0jTYpGUGnZIBjbsGDWO6sz3XnfB&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.lineal.co.uk%2f&c=E,1,Tr32z6d3MLPOX9DkcWFYeWdA8AKHyuWCBV8fIKJ8UFA8zXF7Ki2YhTkOwCQqj18JE9FsAxmz4AlgttVgRqLkiOZw834mYJNl2k_J0w1p8w-F807EBDU,&typo=1>
>
> https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fwww.sqlworks.co.uk&c=E,1,PG1lcShmmmVYfdqC1w4KxfOZ1g7m2hhTc0urptcborovmnQWymvEVavs-ZTCxfLNX6PQwrTmuvkJdF7E1EALateUauaQofwUOWHvkYuERm9H9lTDeanPYi8piBY,&typo=1<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.sqlworks.co.uk&c=E,1,r28D9QUXOexnfjQgZWGnm-0jupF033poioIj_u3SVexobXrrXGCg9OIQhjWNU_K5uPMe_lsKi8Rn50DtzrxJILfWyekApp8iKmvktcrSEEo,&typo=1><https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.sqlworks.co%2f&c=E,1,sZSguuM2IBR2WxVR6xYbfsXZdESKVVK2dv1tPIXKrLfnfi-nDc4goG-e551_y2C3lRQvCw6Uz0838r4n523aX8ew_mwgWOgN3rUvUUaWtg,,&typo=1>
>
>
>
> On 12 Apr 2022, at 07:50, Miguel Garcia <miguel.garcia at roig.com<mailto:miguel.garcia at roig.com><mailto:miguel.garcia at roig.com>> wrote:
>
> Hi Das,
>
> First set the "deleted" flag to kTrue using kOW3imapActionSetMessageFlags.
>
> Example :
>
> Do RowFlags.$addcols('answered',kInteger,k32bitint,)
> Do RowFlags.$addcols('deleted',kInteger,k32bitint,)
> Do RowFlags.$addcols('draft',kInteger,k32bitint,)
> Do RowFlags.$addcols('flagged',kInteger,k32bitint,)
> Do RowFlags.$addcols('seen',kInteger,k32bitint,)
> Do RowFlags.$assigncols(kUnknown,kTrue,kUnknown,kUnknown,kUnknown)
> Do $cinst.$start(kOW3imapActionSetMessageFlags,pMailboxName,pUID,RowFlags) Returns lOk
>
> Then to delete completely de message execute the EXPUGNE imap command.
>
> Example :
>
> Calculate lCmd as $cinst.$chartoutf7(nfd(trim('EXPUNGE')))
>
> Do $cinst.$start(kOW3imapActionExecute,pMailboxName,lCmd) Returns lOk
>
> $cinst is an IMAPClientWorker object and pMailboxName is the folder of the message.
>
> Best regards.
>
>
> El 11/4/22 a las 20:52, Das Goravani escribió:
> Talking 10.2 here
>
> In IMAP I have noticed actions for things like listing mailboxes, listing messages and so on…
>
> But there’s no action for deleting a message completely
>
> How do you delete a message completely in the IMAP world within Omnis
>
> The one mention of "get’s rid of message" was in reference to appending the same message again to a list.. it said messages with duplicate ID’s disappear by the IMAP engine, so I was thinking one way to get rid of a message is to append itself to the same list and then both copies will go away?
>
> Then there’s the Action for commands and there is some type of DELETE command within IMAP since I was able to find it’s error codes
>
> I guess I have to make a custom command binary and execute that having the delete command within it
>
> Anyone have that or know the way to delete?
> _____________________________________________________________
> Manage your list subscriptions athttps://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,3ze8tf6ZqESwdscwTNECTaPbR89OzPd_VnZo5WKfJVtFrh4YBqWmD9K55Cuotr9wzbcFmESkGqqNE-dhufuNbVcsgZqGPPsK5Bob0i10WpS1cKPWO2VK&typo=1
> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com
> --
> *Miguel Garcia Segui
> DPTO Informatica
> 971 65 71 73 Ext. 2044*
>
>
> _____________________________________________________________
> Manage your list subscriptions athttps://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,6snWB8ymdDIaxDdiuvUxuxCurcJgjahuha-WsoQV7IZ3jbLOR7dP0szdUw8fM1pThjslAQufhseXAYrWHUDMwQ_4bEngD37gmzlOPHe2ZdgzpqY-GGPa8wavTw,,&typo=1
> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions athttps://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,nCeGDxJB5Vi-2KXdAD8s_MeJ2ADEAPbpi3fhK7jI0ti8ECI9EXcd-2TrP7uhsJgBW4VkJ1BBHE6fDMALRgHjUkD5EK3Fz-xoWGQrpM33zrxUopGX&typo=1
> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions athttps://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,-lPXV2_xix8LE306UM8SzT-2Mu3UIp8sA6sW6rup--vKwzRs7aTK0mRo-HqO0lENjf950u2uHA9Pp8I4u40V38WA3Eezhl1xT-6Kp1lmLkF9YHty&typo=1
> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com
> --
> *Miguel Garcia Segui
> DPTO Informatica
> 971 65 71 73 Ext. 2044*
>
>
> _____________________________________________________________
> Manage your list subscriptions athttps://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,rsUqaeAunQagT8oQly-BLtOLlU62VZUA_N0iChEZQ5uKGF2gbkcJUk6CjhzIQh__OV1RPgNHzzJnE9PIRVJYl5MwWyuhfl-kE5xzqlmPiVkmAZYzPSQ3Iw,,&typo=1
> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions athttps://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,qHX4SVzXb7E-3yngIFOqF1wfdx0mmB4YXNEx-V7dbPkiz0_M-vgg-6qsl5Tu8sZm-zftH7lHArdGJC0EY4URXl5m7Y-MdKB9sxugsYEQzyU,&typo=1
> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com
> --
> *Miguel Garcia Segui
> DPTO Informatica
> 971 65 71 73 Ext. 2044*
>
>
> _____________________________________________________________
> Manage your list subscriptions athttps://linkprotect.cudasvc.com/url?a=https%3a%2f%2flists.omnis-dev.com&c=E,1,OKRG5SN7RzThaBLtCkQfS6s-9jpyWfaPPsFWrHksNkuw2pcQ2UASX_mh6jAT9lGExAvpMQ7ddjqKY0MiUl1o6fgKquYEhBsBOyJ4Ij9S9tZUKP8,&typo=1
> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions athttps://lists.omnis-dev.com
> Start a new message ->mailto:omnisdev-en at lists.omnis-dev.com
--
*Miguel Garcia Segui
DPTO Informatica
971 65 71 73 Ext. 2044*
More information about the omnisdev-en
mailing list