Automatically move incoming/mailed tasks to particular lists using rules
The 'trick' below is based on this idea:
"Automatically move emailed in tasks to particular lists using rules"
(http://www.rememberthemilk.com/forums/ideas/12946/).
I have tried to create my own filtering system, since RMilk doesn't provide it (yet).
The only thing that needs to be done is sending an email to the RMilk "Inbox e-mailadres".
The subject of that email has to be enriched so that Smart-Add can pick it up and process it.
So what I need is a system/script which takes an email, adds the Smart-Add information and send it to the Inbox.
Easy peasy right?
Ingredients:
1. an account at mailgun.net or cloudmailin.com. It will transform your email to an HTTP-post request. I use Mailgun in the example below.
2. a hosted PHP/MySQL account.
3. an email account. I will use GMail below.
Action plan:
1. turn on the Smart-Add function in your RMilk-account
2. in order to being able to forward in GMail, you need to validate the Mailgun email address (GMail settings -> forwarding -> add a forwarding address)
3. create a filter in GMail which forwards mail of your choosing to Mailgun.
4. create a table in your MySQL database that contains a few in- and out-parameters. this will be your rule base.
I've pasted the create statement here: http://pastebin.com/ffPMnj0q
5. create a PHP-script that evaluates all rules against the incoming HTTP-POST variables and send the "Smartened" mail to RMilk
I've pasted that one here: http://pastebin.com/bv1yZmHH
6. create route in your Mailgun-account, basically a catch_all, with an action that points to your hosted PHP-file.
Explanation of the script:
the script will take some POST-variables and will cross-reference them with the IN-attributes from the filter table.
if the script is satisfied, it will create a new email subject, or expand on the existing and then send the email.
the filters work sort of like Gmail:
IN: from, subject, has_words, doenst_have_words.
OUT: description (as in task description), priority, lists/tags, due date, time estimate, location
If a parameter is left blank it's not considered by the script.
If multiple filters apply, multiple emails are sent, multiple tasks are created.
Other than that, I think it's pretty self-explanatory.
Disclaimer:
I did some PHP back in the days, but my skills are rusty now. I didn't do any input sanitizing, which probably makes the script relatively unsafe.
Also I couldn't get attachments working, resulting in bounced HTTP-POST request. Mailgun support attachments in a free account, Cloudmailin didn't. Anyway, the script doesn't support it.
If you're an experienced PHP hacker, you will probably notice some "ineffiencies": feedback is welcome ;-)
"Automatically move emailed in tasks to particular lists using rules"
(http://www.rememberthemilk.com/forums/ideas/12946/).
I have tried to create my own filtering system, since RMilk doesn't provide it (yet).
The only thing that needs to be done is sending an email to the RMilk "Inbox e-mailadres".
The subject of that email has to be enriched so that Smart-Add can pick it up and process it.
So what I need is a system/script which takes an email, adds the Smart-Add information and send it to the Inbox.
Easy peasy right?
Ingredients:
1. an account at mailgun.net or cloudmailin.com. It will transform your email to an HTTP-post request. I use Mailgun in the example below.
2. a hosted PHP/MySQL account.
3. an email account. I will use GMail below.
Action plan:
1. turn on the Smart-Add function in your RMilk-account
2. in order to being able to forward in GMail, you need to validate the Mailgun email address (GMail settings -> forwarding -> add a forwarding address)
3. create a filter in GMail which forwards mail of your choosing to Mailgun.
4. create a table in your MySQL database that contains a few in- and out-parameters. this will be your rule base.
I've pasted the create statement here: http://pastebin.com/ffPMnj0q
5. create a PHP-script that evaluates all rules against the incoming HTTP-POST variables and send the "Smartened" mail to RMilk
I've pasted that one here: http://pastebin.com/bv1yZmHH
6. create route in your Mailgun-account, basically a catch_all, with an action that points to your hosted PHP-file.
Explanation of the script:
the script will take some POST-variables and will cross-reference them with the IN-attributes from the filter table.
if the script is satisfied, it will create a new email subject, or expand on the existing and then send the email.
the filters work sort of like Gmail:
IN: from, subject, has_words, doenst_have_words.
OUT: description (as in task description), priority, lists/tags, due date, time estimate, location
If a parameter is left blank it's not considered by the script.
If multiple filters apply, multiple emails are sent, multiple tasks are created.
Other than that, I think it's pretty self-explanatory.
Disclaimer:
I did some PHP back in the days, but my skills are rusty now. I didn't do any input sanitizing, which probably makes the script relatively unsafe.
Also I couldn't get attachments working, resulting in bounced HTTP-POST request. Mailgun support attachments in a free account, Cloudmailin didn't. Anyway, the script doesn't support it.
If you're an experienced PHP hacker, you will probably notice some "ineffiencies": feedback is welcome ;-)
I created the script not to use it as a permanent solution, but as a teaser for you, fellow RMilk user.
If you like what you read, please upvote this idea:
http://www.rememberthemilk.com/forums/ideas/12946/.
If you like what you read, please upvote this idea:
http://www.rememberthemilk.com/forums/ideas/12946/.
Log in
to post a reply.