Archive for the ‘Howto’ Category

Adding Remember The Milk (RTM) tasks with Launchy

Friday, March 11th, 2011

Lifehacker featured a post about how to add RTM to the Windows Quicksilver-like launcher Launchy. The script worked pretty well but required you to enter the parameters (priority, due date etc) in correct order without any hints.

Since I’m used to the RTM Smart Add syntax I figured it would be easier to implement this using a single parameter to RTM.

Here’s how to do it:

  • Install the VBS script from the Lifehacker post above.
  • Modify the VBS file replacing the entire “If wscript.arguments.item(1)”-block (including the final “End If” with this line:
    subject = wscript.arguments.item(0)
  • Also change
    .TextBody = body

    into

    .TextBody = ""
  • Add the script to Launchy using the parameter:
    "$$" "$$" "$$" "$$" "$$" "$$" "$$"

Now you can add tasks to RTM but opening Launchy, entering rtm <TAB> <smart add syntax>, for example “rtm <tab> pickup milk ^tomorrow #store”.

Re-injecting emails collected on a different host (like a MX backup) into Postfix

Saturday, January 23rd, 2010

Due to recent hosting troubles I had to quickly deploy a backup MX for my primary mail server. This was quickly achieved using a VPS hosted by the Swedish webhost GleSys.

But since my customers needed to be able to read and reply to emails while the primary site was down, I couldn’t just let the backup system keep the incoming email in the queue and deliver them once the primary sit was up. I decided to deliver the emails locally but also keep a copy of all emails that passed through the system.

These archived emails were to be re-delivered once the primary site was up again, and here’s how I did it, step by step.

  • Set up a VPS for the backup MX host.
  • Set up the system using the same guide I used for the primary site, which was the great ISPmail tutorial by Christoph Haas.
  • Added the option always_bcc to the Postfix config, pointing it to a new local mailbox.
  • Once the primary server was up again, I set up getmail like this:
    • [retriever]
      type = SimplePOP3Retriever
      server = hostname_of_backup_mx
      username = username_of_backup_account
      password = secret
      [destination]
      type = MDA_external
      arguments = ("-i", "-bm", "-t")
      [options]
      verbose = 2

Running getmailrc quickly restored all the emails on the primary host. Remember not to run it multiple times since the default is to re-download already processed messages.

The downsides of this setup:

  • Deleted emails (like spam) are seen again by the users. POP users will receive duplicates of already retrieved messages. IMAP users will however have a mailbox which includes both old messages and the ones delivered to the backup server.
  • The spam filter wasn’t used in delivery process. I realize this could be achieved with fetchmail (which includes the SMTP delivery option that getmail lacks) but I decided to use getmail anyway.

I realize there might be prettier solutions to the original problem (BOTH delivering emails locally and keeping them in a queue for a primary MX), but I couldn’t find out how and this proved to be a pretty solid solution. Feel free to suggest better ways to solve the problem!