search email address in a lookup file

Post your questions and help other users.

Moderator: Martin

Post Reply
1tamad
Posts: 11
Joined: 20 Apr 2016 03:04

search email address in a lookup file

Post by 1tamad » 01 Aug 2017 04:46

Hi,

I am trying to create a whitelist file containing email address. I am trying to put condition to check if the email exist. Somehow it is not working. I suspect that this is because of the special character "@". With normal characters (letters and numbers) it is working. I used the following

indexOf("/storage/emulated/0/email_whitelist.txt",{k9_from})<=0

also will this work as well?

matches)("/storage/emulated/0/email_whitelist.txt",{k9_from})

Thanks

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: search email address in a lookup file

Post by Desmanto » 01 Aug 2017 06:09

First, you have to use action Init Variable Text file, from the /storage/emulated/0/email_whitelist.txt, save it to a variable {file_text}.

Then you can use indexOf() to search the email
indexOf(file_text, {k9_from})<=0

Matches() will use regex, need to add the regex syntax, which is not needed in this case.

For saving the supporting files, i would prefer keep it in the same folder with automagic. Beside not cluttering the root folder of the /sdcard/, it also make it easier to backup or move it all to another phone. I keep mine at /sdcard/Automagic/Resources/. Have been doing the same since using tasker before.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

1tamad
Posts: 11
Joined: 20 Apr 2016 03:04

Re: search email address in a lookup file

Post by 1tamad » 04 Aug 2017 01:16

Thanks dude

Post Reply