webpro 31 Posted March 30, 2013 Report Share Posted March 30, 2013 connect to mail server("IMAP With SSL", #username, #password, "imap.gmail.com", 993) { delete email(0) } You need to run the hole thing to delete emails. Which is connect to the mail server each time cause DELETE EMAIL will not work. Even if it's under the CONNECT MAIL SERVER and it's already connected. Is there a way to arrange this ? Quote Link to post Share on other sites
VaultBoss 310 Posted March 30, 2013 Report Share Posted March 30, 2013 The connect to email server is a container node, much like an IF, a LOOP, a DEFINE etc.. so you need to have all the related code you wanna run regarding the emails, inside the container. If you do, it will do everything with one connect... Quote Link to post Share on other sites
merkaba 36 Posted March 31, 2013 Report Share Posted March 31, 2013 ^ This above ^ Same deal with connecting with a mysql database. I made the mistake a few weeks ago ago of not looking within the connect node and got locked out of my database for a good 12-16 hours Quote Link to post Share on other sites
webpro 31 Posted March 31, 2013 Author Report Share Posted March 31, 2013 The connect to email server is a container node, much like an IF, a LOOP, a DEFINE etc.. so you need to have all the related code you wanna run regarding the emails, inside the container. If you do, it will do everything with one connect... I see, then i don't understand why this isn't working ? connect to mail server("IMAP With SSL", #username, #password, "imap.gmail.com", 993) { loop($list total(%emails to delete)) { delete email($next list item(%emails to delete)) } } Any ideas ?%emails to delete listcontains all the emails i want to be deletedDebugger:(0): 18(1): 22(2): 43So it does contain the emails i want to deleted only. EDITED:Is it because i receive new emails in my email account before i actually start the DELETE process ? So rows aren't the same anymore ?I just checked and by the time is has gone thru everything, i received 5 emails ? If this is the case, then i need to find a way to delete the email i just worked on right away. Quote Link to post Share on other sites
Security 17 Posted April 7, 2013 Report Share Posted April 7, 2013 I have the same problem. My solution is to connect then delete. Here is an example of that process: loop while(1 = 1) { set(#position, 0, "Global") connect to mail server("POP3", "#user name", "password", "#domain", 110) { clear table(&seedmails) create table from emails(&seedmails) if($comparison($email total messages, ">", 0)) { then { loop($email total messages) { if($either($contains($email body text(#position), "#msg"), $either($contains($email body text(#position), "#trig"), $contains($email body text(#position), "#trig")))) { then { add list to list(%bouncebacks, $list from text($change text casing($replace regular expression($find regular expression($email body text(#position), "\\w\{1,\}@\\w\{1,\}.\{1,9\}?\\.(com|net|us|org|tv)"), "(\\w\{1,\}@elitepublicationshouse\\.com\\n|\\n.*)", $nothing), "Lower Case"), $nothing), "Delete", "Global") increment(#bounceback) save to file(#savefile, %bouncebacks) } else if($either($contains($email body text(#position), "Exceeded"), $contains($email body text(#position), "exceeded"))) { add list to list(%bouncebacks, $list from text($change text casing($replace regular expression($find regular expression($email body text(#position), "\\w\{1,\}@\\w\{1,\}.\{1,9\}?\\.(com|net|us|org|tv)"), "(\\w\{1,\}@elitepublicationshouse\\.com\\n|\\n.*)", $nothing), "Lower Case"), $nothing), "Delete", "Global") save to file(#savefile, %bouncebacks) increment(#bounceback) } else { } } increment(#position) } stop script loop($email total messages) { delete email(0) } } else { } } } wait(#pause) } This is for a bounce back collector that stores the emails of specific bounce backs i may receive. 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.