ImapSearchMails

Currently I have this

BLOCK:ImapLogin
email = “[email]”
password = “[pass]”
ENDBLOCK
#HERE
BLOCK:ImapSearchMails
field1 = To
text1 = $“@[email]”
field2 = Subject
text2 = “Account Verification”
deliveredAfter = 60
SAFE
=> VAR @imapSearchMailsOutput
ENDBLOCK
IF STRINGKEY @imapSearchMailsOutput EqualTo “0 mails matched the search”
JUMP #HERE
END

which doesn’t return an error but doesn’t work it doesn’t say it matched the string or anything and just keeps going which causes it to end with STATUS: ERROR

I don’t understand which block doesn’t give output and which block gives an error, can you specify better please?

Well I tried detecting the “0 mails matched the search” but it doesn’t detect it and just keeps going not sure why shouldn’t it be a data.ERROR if it doesn’t find any emails matching the search ?

EDIT: IGNORE THE OTHER EDIT that did not work lmao and just always matches key 0 EqualTo 0 no matter if there is a mail id found

Well it still creates a list as output with the IDs of the searched mails. So you can make a keycheck on the length of the list (where list is the name of the list variable that the imap search block uses as output). Use an int key not a string key in this case, it’s better!

immagine

yeah I fixed it now using

BLOCK:ImapSearchMails
  field1 = To
  text1 = $"<Email>"
  field2 = Subject
  text2 = "Account Verification"
  deliveredAfter = 30
  => VAR @imapSearchMailsOutput
ENDBLOCK

BLOCK:JoinList
  list = @imapSearchMailsOutput
  => VAR @joinListOutput
ENDBLOCK
IF STRINGKEY @joinListOutput EqualTo ""
BLOCK:Delay
  milliseconds = 5000
ENDBLOCK

BLOCK:ImapDisconnect
ENDBLOCK
JUMP #HERE
END
1 Like

Yeah well that’s another way to solve it ^^

Hey also when will multi-part be fixed for native? kinda annoying having to use web version to make http blocks for multi part

Please open an issue on github to make sure I don’t forget :sweat_smile: