Catching "All" %EFROM data.

114 views
Skip to first unread message

Racing Turtle

unread,
Aug 18, 2013, 11:50:20 AM8/18/13
to tas...@googlegroups.com
Greetings,

I am using Kaiten/K-9 Mail to share incoming email data with Tasker. If there is a hit on the "sender" a task takes a couple of pics, gets location and emails pics and location back to the sender. All works just fine IF there is only one email message to retrieve. Things get dicey if there are multiple messages to retrieve from the Inbox. That is to say an %EFROM might be combined with the %ESUBJ of a different message and vice-versa. In an attempt to maintain the integrity of the incoming data I created a profile/task that simply generates a log file with %EFROM and %ESUBJ data thinking I could then proceed with the pic/location/emailing in a separate task. The simple log file also can be corrupted.

I have tried pushing vs. polling an account and that seems to help but it's not a 100%. I am presently playing with MailDroid hoping that I might be able to utilize some of its rules functionality to deal with the incoming email identification and organization.

Any other suggestions as to what I might tweak in Tasker or other approaches to help maintain data integrity would be apprepiciated. I would prefer solutions which would not require me to root the phone. Running this on a Verizon Samsung Galaxy S III (Android 4.1.2).

Thanks


Pent

unread,
Aug 19, 2013, 2:07:29 AM8/19/13
to tas...@googlegroups.com
Yes, this is a problem with some global variables: by the time the relevant task is executed, another
email has arrived and thus the variable contents have changed.

The answer (on the Tasker side) is to make things like %EMAIL local variables, so that each time
an email comes in there's a new task with it's own copy of the variable. I'm aware of that and hope
to find time one day.

Pent

Matt R

unread,
Aug 19, 2013, 2:56:31 AM8/19/13
to tas...@googlegroups.com
You could try to do a Variable Set context and then use the %evtprm variables. Not sure if this works as I don't use k9.

Matt

Pent

unread,
Aug 19, 2013, 9:43:41 AM8/19/13
to tas...@googlegroups.com
>You could try to do a Variable Set context and then use the %evtprm variables. Not sure if this works as I don't use k9.


Good idea (the Variable Set event not the state BTW)

Pent

Racing Turtle

unread,
Aug 20, 2013, 8:32:17 AM8/20/13
to tas...@googlegroups.com
Retrieving variables from %evtprm does appear to maintain the integrity of the data when multiple email messages are processed. It took me awhile to figure out how and what variables I could retrieve using this method as I am new to Tasker; especially arrays. I was expecting that all the variables available (%EFROM, %ESUBJ, %EDATE, %ETIME, %ECC) would be retrieved on execution of %evtprm(). It appears however after practice and reading that only the single variable defined in "set event" is returned and used to populate the 5 resulting data fields. Given I am a newbie not sure if this behavior is to be expected, how K-9 interacts with Tasker or a procedural error on my part. Thanks for the suggestion as it did widen my scope of vision as to what's possible using Tasker.

Pent

unread,
Aug 20, 2013, 10:17:38 AM8/20/13
to tas...@googlegroups.com
Actually, thinking further, you should just be able to use the %evtprm array with a task launched by email received event.

You don't need the Variable Set event.

Pent

Racing Turtle

unread,
Aug 20, 2013, 4:15:08 PM8/20/13
to tas...@googlegroups.com

Thanks Pent and Matt R.

Created a Profile that responds to any K-9 email received.
Which performs a task which includes an
Array Push with a variable %EMAILMSG and a Value of %evtprm(:)

K-9 Mail returns the variables: Email From,Email Subject, and the Kaiten/K-9 Mail Account Name for which the message is intended for each message received.

%EMAILMSG1
%EMAILMSG2
%EMAILMSG3
And so on..

I "stuffed" :-) my Inbox with approx 15 messages and the data integrity remained intact using this approach to grab data.

Thanks again.

Reply all
Reply to author
Forward
0 new messages