07 July 2008 ~ Comments

Remember The Milk: Posting Directly from Your Desktop

In a recent post, we talked about 6 Ways to Add A Task to Remember The Milk. While the methods discussed were varied and useful, I was not satisfied with any of them. This post will show you another quick method to handle this.

I have very simple criteria for being able to add tasks to my ToDo list:

  • It must be quick
  • It must not disturb my current work flow
  • It must be reliable

I had almost satisfied all of these using the solution involving Launchy, Curl, and Twitter. Launchy is probably the fastest desktop launcher available for Windows. So the procedure went like this:

  • Launchy pops up instantly when I hit ALT+Space
  • I type in “rtm<TAB>Task Description<ENTER>” (rtm is just a batch file in my path)
  • The task is added to my Remember The Milk Inbox list via Twitter

If we review the last item on my list of criteria, we see that our posting method needs to be reliable. Well, Twitter shouldn’t even be in the same sentence. I have actually been burned before using this setup, as you can read about in my post How Twitter Keeps Me from Getting Things Done.

So, how do we make it better? I had to find a way to get Twitter out of the picture. If you recall, You can add tasks to Remember The Milk via email. All I needed was a way to shoot off an email to RTM from within Launchy. Problem solved, right? Well…not really. GMail apparently makes this slightly more complicated.

This is about to get pretty technical, but I will try to break it down as simple as I can. If I don’t do a good job, please leave a comment and I will be happy to help :)

Download, Install, and Configure “Stunnel”

We need Stunnel so that we can communicate with the Gmail server securely. From the website:

Stunnel is a program that allows you to encrypt arbitrary TCP connections inside SSL (Secure Sockets Layer) available on both Unix and Windows.

So, here is what we need to do:

  • Download Stunnel from the Binaries Page. The version I used is 4.25 (direct download link)
  • Run the installer and hit “Close” once complete
  • Now, edit C:\Program Files\stunnel\stunnel.conf
  • Replace the “Service Options” section with the following:

[SMTP Gmail]
accept = 127.0.0.1:1099
connect = smtp.gmail.com:465

[POP3 Gmail]
accept = 127.0.0.1:1109
connect = pop.gmail.com:995

  • From the same directory, run the command “stunnel -install”
  • Then run the command “net start stunnel”

Download, Install, and Configure “Blat”

We need Blat so that we can send email right from the command line.

Blat is a Win32 command line utility that sends eMail using SMTP or post to usenet using NNTP.

  • Get Blat from here: http://www.blat.net/
  • Open the archive and stick “blat.exe” into C:\Windows\System32\ or somewhere else in your path
  • Run the command: blat -install smtp.gmail.com yourusername@gmail.com

Configure Launchy

You already have Launchy, right? If not, you are probably not working very efficiently, you are on a MAC, or both. Go ahead and fire it up now.

  • Open Launchy’s Options dialog (click the gear), go to Plugins and click Runner.
  • Hit the “+” button to add a new command
  • Enter something nifty for the Name (“rtm”, maybe?)
  • In the Program field, Enter the path to the Blat executable: C:\Windows\System32\blat.exe
  • In the Arguments field, Enter the following:

- -body ” ” -subject “$$” -to [Your unique RTM Email Address] -u [Gmail Username] -pw [Gmail Password] -f [Your Gmail Address] -server 127.0.0.1:1099

  • Hit “Ok,” we’re done here

Make sure you include the preceding “-” and the space between the quotes for the body argument. To find your unique Remember The Milk email address, login to RTM and go to Settings->Info. You want the Inbox Email Address.

Conclusion

Now, you can hit ALT+Space (or whatever key you have it set to), type “rtm<TAB>task<ENTER>” and you have just added a task to Remember The Milk without even breaking stride.

Being able to quickly dump tasks/ideas out of your head and into your organization system of choice is pretty important. Without doing this, you will never get anything done because you won’t ever know what to do.

More often than not, you are going to be in the middle of something when an idea strikes you for something else that you need to capture. As we all know, if you get interrupted, it takes about 10 minutes or so to find your place and get back into the groove.

This is why I have been so anal about this specific facet of my system. I don’t believe there is a faster way, short of direct brain-to-computer communication, to capture your thoughts to your to-do list.

How do you make sure you can capture things at all times? Do you have a better method than me? I’d like to hear about it. Leave me a comment.

  • Share/Bookmark

Also check out:

  • Tracy
    Much better to include the username and password during your blat -install, so that it gets kept in the registry and encrypted there.. rather than supplying it in your batch files in plain text. I found a good article on it here: http://www.jeffkastner.com/2010/01/blat-stunnel...
    ...Though he seems to be using it for a different purpose.. same basic setup.
    Love it though! Works great!
  • LBSurfer
    This is a great tutorial. It took a little bit of tinkering (thanks to mwg3c for the pointer to the Yahoo! group), but I got it working perfectly. It really is the end-all, be-all for mind-dumps as far as I'm concerned. Let's me immediately mind-dump w/o losing pace in what I'm doing.
  • Thanks. Glad you got it working. I still find this to be the best method for
    not forgetting anything :)
  • Excellent. I agree with you in this regard. There are lot of tasks that i want to do daily but could not manage my time. I will try this.
  • Downloaded and works for me great thanks for your useful post Rahsheen.
  • Victor
    hey rasheen!
    thanks for the great tutorial, but I'm a bit of a noob and I cant get it to work.
    I'm pretty sure i've done everything correctly except for the "net start stunnel" which tells me everytime I run it that the stunnel server is down. This is the error log i get:

    2008.11.29 11:26:09 LOG3[1760:3928]: -net: No such file or directory (2)

    Syntax:
    stunnel [ [-install | -uninstall] [-quiet] [<filename>] ] | -help | -version | -sockets
    <filename> - use specified config file instead of stunnel.conf
    -install - install NT service
    -uninstall - uninstall NT service
    -quiet - don't display a message box on success
    -help - get config file help
    -version - display version and defaults
    -sockets - display default socket options

    2008.11.29 11:26:09 LOG3[1760:3928]: Server is down
    Is there anything I could do?
    Thanks in advance!
  • Looks like you just have a typo somewhere in your configuration. Check your syntax and make sure everything is correct.
  • Blat is a command-line application. You need to run it in a terminal window so that you can see what it's saying.
  • Vjcamarena
    thanks for this great idea! However, i am new to all this and havent been able to get this to work.

    I think that the problem is in the Blat part, when I execute the command on system 32 it pops a black window that vanishes instantly, but it doesn't seem to work.

    Is there anything I could do?
  • arek
    Rahsheen thanks for this tutorial :)
    Too bad there is no way to add tasks with multiple properties like Due and Priority like you wrote in http://sheenonline.biz/2008/07/remember-the-milk-posting-directly-from-your-desktop-tweak/.
  • Oudrigee
    Thanks for sharing this setup!

    Now I just wonder if I can make “Stunnel” portable so that I can use this from my USB stick...

    I use Executor instead of Launchy, but thats just cosmetic ;-)
  • That is actually quite possible. Something I'll have to look into myself.
    Let me know if you get it working :)
  • Oudrigee
    I've got it working nicely from my USB stick!

    The link mw3gc posted to, "Stunnel pre-configured for gmail" (http://tech.groups.yahoo.com/group/blat/message...), actually also contains a link to a portable Stunnel_portable.zip.

    My Executor keyword 'rtm' is currently looking like this:
    Command: Stunnel_portable\blat.exe
    Parameters: -server 127.0.0.1 -f someuser@gmail.com -u someuser@gmail.com -pw password -to rtmuser@rmilk.com -subject "$P1$" -body "$P2$"

    and I use it like:
    rtm "task name" "Some note if I would like to add that"
  • Wulf, "telnet 127.0.0.1 1099" should give you the output above. If not, stunnel isn't running properly or is running on the wrong port. Or, there is some software that is blocking the port.

    <abbr>Rahsheens last blog post..Don’t Call Me, I’ll Call You…Maybe</abbr>
  • Wulf
    Oh, and I didn't mention that I started out by disabling the firewall.
  • Wulf
    Oh, that's interesting... I tried telnet several times in several ways, but didn't post the results because I wasn't seeing anything at all come back : (

    I've checked and doublechecked the settings on stunnel... I've dropped my config on the web in case you'd like to check it out: http://michaelwulf.com/blog/2008/09/07/trying-r...

    I've also posted logs, and other details there for fun.

    Thanks!
  • Hey, Wulf.

    First thing is to check and double check your stunnel config file. That is probably the only part that gave me issues initially.

    Second thing you wanna try is "telnet localhost 1099" and see if you get a connection to GMail.

    You should get a response like "220-mx.google.com ESMTP..." and then a prompt. That means stunnel is working just fine.

    If you don't get that connection, disable all security/firewall stuff and try it again.

    I know some of this is basic, but it's necessary so that we're on the same page :)

    Also, we may get a more useful error message from "telnet" than we're getting from stunnel.
  • Wulf
    I spent several hours trying to set this up, but I just can't seem to get stunnel to play with gmail. Externally, it just sort of hangs up for a while.

    Running blat direclty produces this:
    [code]Blat v2.6.2 w/GSS encryption (build : Feb 25 2007 12:06:19)

    Error: Wait a bit (possible timeout).
    SMTP server error
    Error: Not a socket.
    Error: Not a socket.[/code]

    A deeper look into stunnel, using the log suggests these errors:
    [code]2008.09.06 22:11:08 LOG5[1216:3484]: SMTP Gmail accepted connection from 127.0.0.1:2457
    2008.09.06 22:11:08 LOG7[1216:3484]: SSL state (accept): before/accept initialization
    2008.09.06 22:11:39 LOG3[1216:3484]: SSL_accept: Peer suddenly disconnected
    2008.09.06 22:11:39 LOG5[1216:3484]: Connection reset: 0 bytes sent to SSL, 0 bytes sent to socket
    2008.09.06 22:11:39 LOG7[1216:3484]: SMTP Gmail finished (0 left)[/code]

    Which, best I can figure after a couple hours of sniffing tcp packets and fiddling and googling, is caused because stunnel sends an RST command, which google hangs up on.

    What I can't understand is what sort of vodoo magic you used to get this running : ) Did you encounter any issues like this?
  • d
    This is a fabulous method. Changing my life. The additional tip about tagging with the body and second Launchy argument makes all the difference, too.
  • mwg3c
    I found that changing the /K to /C closes the window upon completion.

    Also, I noticed two things that have to occur for this to work: (1) I have to be signed into Gmail, and (2) the "Stunnel_P.exe" program has to be running. I usually don't load many programs on "start-up" but was thinking an automatic load of "Stunnel_P.exe" upon starts/restarts would be good. Do you know how to add programs such as that to the "start-up" list so one doesn't have to worry about double-clicking it everytime they start their computer? Also, have you noticed that you have to be signed into Gmail?

    Thanks again.
  • If you follow the directions in the tutorial, you should end up with
    "stunnel" running as a service on your machine. In XP, this means it
    automatically runs on startup. For example, on my system I can do "net stop
    stunnel" to stop it and "net start stunnel" to start it up again. From
    within the "stunnel" directory:

    - Run the command "stunnel -install"
    - Then run the command "net start stunnel"
  • mwg3c
    Thanks for the quick response, Rahsheen.

    My problem was, indeed, because of blat not actually sending the e-mail. After some more research, I found a great yahoo group that provides a download of Stunnel pre-configured for Gmail. Read this post (http://tech.groups.yahoo.com/group/blat/message...) and you'll see what I'm talking about. You may have to join that particular yahoo group in order to see the post.

    I did manage to get the e-mail working thru blat, however I had to use a workaround to make it work best with Launchy. My "RTM" Runner was not working, so I ended up just editing the Launchy's "cmd" Runner to perform the blat commands on it's own. I don't use the "cmd" Runner for anything else so I just changed the name to "RTM," kept the Program field as "C:\Windows\System32\cmd.exe" and added the following to the Argument field:


    /K blat -to xxxxx+xxxxxx@rmilk.com -subject "$$" -body " "


    Everything works great (an e-mail is sent from my gmail account & a task is added to my RTM inbox), except the command prompt window stays open after blat performs the action.

    Would you know how to add something (i.e. "exit") to the Argument field above to allow the command prompt window to close automatically after the action has been performed?

    Thanks again for all your help. Your blog is great.

    Edit:
    Hmmm, I'm just finding out that I have to actually be signed into Gmail for this to work. Otherwise I get a SMTP server error (once I sign into Gmail it works fine though). Not sure how to get around this....
  • arek
    Hey mwg3c.

    I had the same problem - everything was working fine when I was sending tasks directly from the command line but when I tried to send one through launchy it didn't show up in my inbox. After few hours of checking and searching I discovered that in my Launchy/Utilities folder there were some *.bat files that I downloaded from Lifehacker site and one of those files was rtm.bat (and it was batch file for using RTM with Twitter). Of course I have chosen the same name (rtm) for my Runner command in Launchy. After deleting that file (I didn't use it anyway) sending tasks from Launchy directly to RTM worked! :)
  • I believe the simple fix is to remove the "/K" option. This should cause the
    "cmd" window to exit once "blat" has done it's thing.

    I'm glad you finally got it working. I'm sure others will benefit from your
    research. I'll be sure to update the post a little later to reflect your
    findings.

    Thanks :)
  • Here is what I have in my Runny plugin:

    - -body " " -subject "$$" -to xxxxxxx+xxxxx@rmilk.com -u <username> -pw <password>-f <username> -server 127.0.0.1:1099

    Looks like the only difference is that you are specifying the full email address for "-f".

    You should have removed the existing contents of the Service configuration and replaced with the Gmail info, as you say you have tried.

    What I would advise is opening a command prompt and trying to send out a test email via "blat". See if you receive any useful error messages. Let me know what you find. Others are probably having the same issue.
  • mwg3c
    Rahsheen,

    I have checked and re-checked everything as well, but cannot seem to get any tasks to show up in my RTM inbox.

    I entered the following into the argument field of my Launchy "Runner" plug-in, where the "xxxxxxxx" parts are the first part of my RTM unique e-mail, my gmail username, my gmail password, and my gmail username again, respectively. Is this correct?


    - -body " " -subject "$$" -to xxxxxxxxxxx@rmilk.com -u xxxxxxxxxxxxxx -pw xxxxxxxxxxxxxx -f xxxxxxxxxxxxxxx@gmail.com -server 127.0.0.1:1099


    I tried keeping the [ ] brackets in, I tried taking them out, and I tried replacing them with quotes, to no avail.

    Also, when you're saying to replace the "Service Options" portion of the stunnel.conf file, which portion do you mean exactly? The last portion of the stunnel.conf file reads as follows:

    -----------------------------------------------------------
    ; Use it for client mode
    ;client = yes

    ; Service-level configuration

    [pop3s]
    accept = 995
    connect = 110

    [imaps]
    accept = 993
    connect = 143

    [ssmtp]
    accept = 465
    connect = 25

    ;[https]
    ;accept = 443
    ;connect = 80
    ;TIMEOUTclose = 0

    ; vim:ft=dosini
    --------------------------------------------------------

    I tried adding the service options you mentioned to the list as well as just deleting everything shown above and replacing it with just the portion you mentioned (as follows):


    ------------------------------------------------
    ; Use it for client mode
    ;client = yes

    ; Service-level configuration

    [SMTP Gmail]
    accept = 127.0.0.1:1099
    connect = smtp.gmail.com:465

    [POP3 Gmail]
    accept = 127.0.0.1:1109
    connect = pop.gmail.com:995

    ; vim:ft=dosini
    --------------------------------------------------

    I guess I am just unclear on the exact way to modify the stunnel.conf file correctly.

    Any information you could provide would be much appreciated.

    Thanks again for all your help!
  • robinsonjm
    I've followed the instructions and have re-checked everything.

    I'm not getting any tasks created and seeing a command line error of 'not a socket'

    Any ideas?
  • Sorry you're having problems. It sounds like it may be an issue with stunnel. Try doing a "net stop stunnel" and then "net start stunnel" and see if you get any errors.
blog comments powered by Disqus
-->