How do you delete mail in IMAP?

Das Goravani goravanis at gmail.com
Tue Apr 12 16:55:00 UTC 2022


Dear Miguel,

Do you have other things worked out for IMAP?

Such as Entering New Folders, Deleting Folders?

You do $cinst.$start()  Is there also $cinst.$run() in case one wants run instead of start. 

I’m making a complete IMAP Client. Or trying to. I’m getting my inspiration just from the Mac’s Mail program, that layout and approach. 

I’m bummed that the token entry field is available only for desktop windows in Omnis. That is surely a slick way of handling addressing. 

The IMAP Demo has the basic actions, like fetching message list, fetching one message, setting flags, but you have provided that in a nice way too. 

I’m doing this to get it ready for use by clients who may need this type of functionality in the future. Naturally, would probably be adding custom adjustments to emails based on the clients particular needs. Otherwise just use regular email clients that come with computers. Only custom adjustments makes having your own IMAP client necessary. Otherwise the regular client apps are good. 

I haven’t gotten this far yet, so I’m curious… if you append one email to a different mailbox, like move an email from INBOX to Drafts or Trash, is it automatically removed from the original mailbox? I realize you have to do a new fetch of the original mailbox to refresh your view of it, but then it should be gong from there.. is that how it works?

I find IMAP to be really cool. It’s attractive to work on it. Email is attractive. Plus it’s not that hard. I’m new to worker objects but I find them understandable so far.. they are like glorified functions, just with more parameters and results.. 

At what point does $run() become too long to wait for? At how many emails?  I find in Mac Mail that no reasonable amount of emails slows it down. I empty the SPAM folder with thousands of emails in it and it still only takes a second, same with emptying the trash with thousands in it. I imagine things will be slower in Omnis comparing it to Mac Mail which is written undoubtedly in a lower level language. (Of course). Like a repeat loop that sets flags on multiple emails being deleted at the same time, I imagine such a repeat loop, would take a little time if there was enough emails. I guess I’ll find out about this at the right time, like when I’m ready to put my gmail account into it which has a lot of real data in it that I can work with. 

Thanks for your help thus far with the delete command.

Best regards,

Das Goravani





> On Apr 12, 2022, at 2:50 AM, Miguel Garcia <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://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*
> 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list