How can I setup a reminder email tool via procmail?

0

I would like to be able to setup a reminder 'service' for myself so that I can schedule emails or text messages to be sent to my handheld when I can't get to an ssh client.

Here's my scenario:

It's now noon. I need to give myself a reminder in four hours to pickup milk on the way home from work.

I would like to be able to email a special account I have setup that will dump all messages that are not from "me", and that will take the subject line as a command, and the body as the message.

For example, the following email could be sent:

Subject: at 16:00 txtmobile
Body: pickup milk

I'd like to grab that mail, pull the subject apart and hand it to a script that will set an at job for 16:00 that will call my txtmobile script with the body contents as the SMS message.

That way I can send myself reminders from work or whereever if I can't get to the calendar function on my phone.

Two questions. First, is it possible? Second, is there a better way to do it?

warren

Posted 2009-08-18T08:30:57.660

Reputation: 8 599

Answers

2

Something like this in .procmailrc:

* ^From: me@example.com
* ^To: mycalendarservice@example.com
| somescript.pl

somescript.pl will get the mail on standard input, so you could parse it apart like this:

while (<>) {
        /^Subject: (.*)/ and $cmd = $1;
        /^./ and $body .= $_;
}
chmod $cmd;
open(OUT, "| $cmd") or die;
print OUT $body;
close OUT;

Be sure to make this safe from abuse.

Peter Eisentraut

Posted 2009-08-18T08:30:57.660

Reputation: 6 330

1

(I'll answer the second question.) You should consider one of the many web services that will do this for you.

Remember the Milk, for example, will do what you describe and a lot more.

Richard Hoskins

Posted 2009-08-18T08:30:57.660

Reputation: 10 260

maybe I missed it in the tour, but I don't see where I could access it via an email or txt message to send me a reminder later – warren – 2009-08-19T22:52:24.887

See the paragraph with the title "Add tasks wherever you are." – Richard Hoskins – 2009-08-20T01:19:26.387

yep, there it is - right in front of me and I didn't see it still wondering how I'd do it myself, though :) – warren – 2009-08-20T11:55:25.847