Skip to navigation

OfflineIMAP settings for King’s College London email account

September 4th, 2009

Same as in the previous post … the information you need is in fact already available here, but if you want to just cut-and-paste this into your ~/.offlineimaprc, see below. (For those who don’t know, offlineimap is an incredibly useful tool that syncs local maildirs with IMAP accounts. You get all the benefits of being able to access mail remotely, from different machines, while getting the speed of local access, and being able to access all old mail while offline, because you in fact point your mail client at your local maildirs.)

For the stuff below, some settings are obviously optional or a matter of taste, man offlineimap. I’ll note just these:

  • localfolders = ~/maildir/kcl: This is you local maildir location, you’ll probably have to change that, and that folder must already exist before you run offlineimap
  • folderfilter = lambda foldername: foldername in ['INBOX']: This now just syncs your Inbox! I have this set because I actually archive mail to a different mail server. If you want to create IMAP folders on the KCL server, you’ll obviously have to omit this or fiddle with it — there seem to be quite a lot of folders there by default that seem to be related to MS exchange.
[Account kcl]
localrepository = kcl_local
remoterepository = kcl_remote
autorefresh = 2
quick = 7

[Repository kcl_local]
type = Maildir
localfolders = ~/maildir/kcl

[Repository kcl_remote]
type = IMAP
ssl = yes
port = 993
remotehost =
remoteuser = kclad\YOURKCLLOGIN
remotepass = YOURPASSWORD
folderfilter = lambda foldername: foldername in ['INBOX']


I had holdconnectionopen = true in the settings for kcl_remote when I posted this. OfflineIMAP crashed a lot, and it seems when I take out this setting this happens a lot less.

msmtprc settings for King’s College London email account

September 4th, 2009

Just to maybe spare someone some time. There’s a pdf on the KCL website with all the information you need, but it’s even easier just to cut and paste.


  • account kcl Can be something else, especially, can be “default” if you want it to be the default.
  • Replace “USERNAME” with your username, but make sure you leave the preceding kclad\ in there.
  • replace PASSWORD
  • tls_trust_file can vary depending on your system. This should work if you use Debian or Ubuntu and have the package ca-certificates installed. If you must, replace with tls_certcheck off
  • logfile setting is optional, but recommended
account kcl
user kclad\USERNAME
password PASSWORD
auth on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
port 587
logfile ~/.msmtp-log

Citeulike: Protect capital letter inside author name

September 3rd, 2009

Some authors have capital letters in the middle of their surname, e.g. “Michael L DeKay”. Citeulike “corrects” this to lowercase (why? why?). To protect what you put in, you have to use a special syntax:




You put this directly into the author field, where you would normally put the author name “as is”. If the article has several authors, you do not need to use special syntax for all of them if you need to protect one. One author with special syntax can happily coexist with other author names being put in “as is” on their respective lines.


Fergus from CiteULike was nice enough to stop by and to fix this issue. So you in fact no longer have to add any special syntax. Putting in the author name directly works just fine, even if it contains a capital letter in the middle. Thanks!

How to change the timeout and default in the boot menu on a Windows/ Linux dual boot

August 5th, 2009

The file you need to edit is /boot/grub/menu.lst and it contains lots of helpful comments. The two lines you’ll most likely need are:

timeout     10

which gives the timeout in seconds, and

default     0

which defines the default boot option, as the order of the item in the menu list, starting at 0. You can of course see the menu list when you boot, but it is also contained further down in the “menu.lst” file. Linux always keeps a few old kernels around to boot into when it updates the kernel, so your Windows entry will usually be the last in the list. If it is, for example, the fifth entry, you need to replace 0 with 4 (because we start counting at 0).

Mutt: limit or search by date

July 23rd, 2009

mutt rocks; I cannot say this often enough. You spend so much time dealing with email. If there is one task where it really pays off to train your brain to remember some shortcuts to never have to touch the mouse, and to benefit from enormous possibilities of customization, email must be it.

Still, here’s one of the things I don’t do often enough to remember properly, so I keep messing this up. You need to pay attention to the spaces. Say you are looking for mail sent less than a week ago. The following will not work:

~d < 1w

Use this instead:

~d <1w

Also, remember mutt uses the "AND" operator by default, so do not add & or && to combine searches using AND. Instead, just string them together. Say you want to see all mail to, from, or cc a specific address group, sent in the last seven days, do l for limit, or / for search, followed by:

%L groupname ~d <1w


It seems you cannot, by the way, combine the relational < or > searches with an absolute date. You can, however, add an error margin to an absolute date, usually achieving what you want to do. The error margin can be before (-), after (+), or both, using *. Like this:

Up to one month before date:

~d 30/10/08-1m

Up to five days after this date of the current year:

~d 04/05+5d

One week before and after date:

~d 27/02/2009*1w

More info here.