exo

blurb

Sat, 02 Jan 2010

Setting up SMTP AUTH with exim on debian

This information is mostly explained in /usr/share/share/exim/README.Debian.gz but to save me the trouble next time I need to do this I’m putting it here.

Firstly you need to generate a certificate: sh /usr/share/doc/exim4-base/examples/exim-gencert. This will create an exim.key and exim.crt file in /etc/exim.

Next you need to get exim to use this. Firstly either create or edit /etc/exim/exim4.conf.localmacros and add the following lines:

MAIN_TLS_ENABLE = true
tls_on_connect_ports = 465

You then need to edit /etc/defaults/exim4 and change SMTPLISTENEROPTIONS to -oX 465:25 -oP /var/run/exim4/exim.pid. This sets up exim to listen on the right port and to advertise that it will do SMTP AUTH.

Now you have to configure exim to support asking for passwords. This is done by editing /etc/exim4/exim4.conf.template and uncommenting the following lines:

login_server:
  driver = plaintext
  public_name = LOGIN
  server_prompts = "Username:: : Password::"
  server_condition = "${if crypteq{$auth2}{${extract{1}{:}{${lookup{$auth1}lsear
ch{CONFDIR/passwd}{$value}{*:*}}}}}{1}{0}}"
  server_set_id = $auth1
  .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
  server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
  .endif

The final thing to do is to set up some passwords. This is done by creating an /etc/exim4/passwd file in the following format:

:$Username:$password:

This file should have permissions set to 640 and have ownership of root:Debian-exim. You can generate passwords using this command: mkpasswd -H md5.

You can then put all this in place by running update-exim4.conf and restarting exim.

This skips over quite a few details and assumes that you have an already working exim install. The debian exim conf files are well commented and the aforementioned README has more detail on all this so if any of this confuses you then have a look at those.

posted at: 17:43 #

Mon, 31 Aug 2009

bad test data

use Test::More tests => 1;

my $discount = 50;
my $cost = 10;

my $discounted_cost = $cost * ( $discount / 100 );

is( $discounted_cost, 5, "discount correctly applied" );

posted at: 21:57 #

Wed, 15 Jul 2009

dear car drivers

if, when overtaking a cyclist, you think they might be able to touch your car then you are too close. If you are forced to be this close when passing a cyclist due to oncoming traffic then you may wish to consider waiting until you have more room to pass.

Thank you for you attention in this matter.

posted at: 22:18 #

Sun, 14 Jun 2009

a holiday: in bullet points

  • location: Mull
  • weeks: one
  • weather: good
  • eagles: golden
  • goats: feral
  • munro: steep
  • roads: narrow
  • ferries: four

posted at: 22:28 #

Mon, 06 Apr 2009

a small request

Dear bicycle manufacturers of the world,
it’d be lovely if you could see fit to provide bikes with wee patches to protect the frame from rubbing cables. I always forget to do so until too late.

posted at: 22:27 #

Fri, 03 Apr 2009

Ask not what it is…

Surely the question should be “What do we want it to be to be British?”

All the debate you hear about in the media and from politicians about defining Britishness, and lets ignore the inherent narrow mindedness of this question, talks about what it is to be British. This seems to be a fundamentally flawed approach being as it is all about, at best, the present. I am much more interested in what we want to be; in looking forward to how a society should be and working out how to move towards that. Change as the nice man across the pond is wont to say.

posted at: 22:41 #

Mon, 02 Mar 2009

back your damn computer up

You’ll be wanting to follow this advice. Especially the bit about every night.

Although you may wish to cargo cult this incantation:

#!/bin/bash

# change $yourusername and name of drive accordingly
sudo rsync -axSE --delete \
--exclude-from /Users/$yourusername/backup_excludes.txt \
/ /Volumes/backup/

# required for the bootability apparently
# as it turns out this isn't at all required for booting. 
# the partition type in the jwz thing above are though.
# sudo bless -folder /Volumes/backup/System/Library/CoreServices

Where /Users/$yourusername/backup_excludes.txt looks a little something like this:

/tmp/*
/Network/*
/cores/*
*/.Trash
/afs/*
/automount/*
/private/tmp/*
/private/var/run/*
/private/var/spool/postfix/*
/private/var/vm/*
/Previous Systems.localized
.Spotlight-*/

One other tip is to exclude your backup drive from spotlight indexing otherwise you’ll find when you want to eject it you can’t as spotlight has its grubby little hands all over the damn thing. You can do this in System Preferences -> Spotlight -> Privacy.

When you smack your laptop down a bit hard and the death rattle starts emanating from your hard disk you will be mighty glad.

And really, every damn night or you will loose something you can’t replace.

posted at: 22:37 #

Wed, 18 Feb 2009

abusing the windows desktop for profit

Or rather the feature of XP, and possibly other versions, that allows you to place a web page on your desktop. Many people, including me, poured scorn on the feature when it first emerged but it turns out be quite handy if you point it at a page with all those little details you need to refer to frequently. And because it’s a normal web page you can use cut and paste.

In my case I use it to list, among other things, IP addresses of various servers, assorted useful vi key combinations that I don’t use often enough to memorise, some magic mysql incantations and various details that are often required when writing ad-hoc database queries.

To ease the process I’ve got a shortcut key to open the web page in an editor so I can add stuff to it quickly.

To set it up you want to use the following sequence:

  • right click on desktop
  • select Properties
  • select Desktop tab
  • click Customise Desktop…
  • select Web tab
  • click New..
  • stick in path to web page
  • click OK a lot

Sadly I have yet to find a way to do the same on a Mac or Linux. I imagine there is a way on the latter though.

posted at: 19:42 #

Sat, 27 Dec 2008

this minister is certified idiot

Burnham, a father of three, insisted his proposals were not intended as an attack on freedom of speech, but were a necessary counterweight to the proliferation of “unacceptable” material on the internet in a similar mould to the 9pm watershed on television. “It worries me — like anybody with children. Leaving your child for two hours unregulated on the internet is not something you can do. The internet has been empowering and democratising in many ways, but we haven’t yet got the stakes in the ground to help people navigate their way safely around what can be a very, very complex and quite dangerous world,”…

Naturally, something must be done! That something appears to be age ratings for websites, which I seem to recall has been tried before with exactly no success 0. However, let us consider for a brief moment that we were attempting to implement such a scheme and consider how we would do it.

Clearly, given the nature of the internet any sort of self regulation involving meta tags in the HTML is not going to work. Partly as who can honestly be bothered but mostly, and more relevantly for Mr Burnham, because it’s rather open to abuse by all those sites hosted outside UK jurisdiction.

This then leads us to the notion that you need some sort of body to classify websites into bad and good. For this to work you have to assume that any unclassified site, or most of them as I prefer to call this category, are automatically bad. Thus you end up with your view of the web reduced to an astonishingly small subset.

Let us, just for the sake of argument, assume we have come up with some method of classifying the web quickly through some sort of crowd sourcing algorithm. You now have the problem of filtering not just websites, but individual pages on these sites. The prime example is wikipedia. There is much there that one would want a child access to; there’s also pictures of 70s album covers that are less suitable. That’s a lot of ratings and a lot of filtering and a substantial burden you are placing on ISPs. At least to do it properly, which is what I assume you’d want to do. It’s certainly not an impossibility though.

And then finally the ISPs will have to offer some sort of, oh, I don’t know Parental Controls package so you can access the web unfettered while your kids only get to see the cbeebies site.

Alternatively you could install one of the various bits of commercial software that promise to censor the intarwebs for you. And then wait the short while it takes your kids to figure out how to disable it…

Or, most usefully, you could do some research, maybe on the web, before you make half arsed statements that result in you looking like an idiot.

0: Of course I can’t find this as all the results on web site ratings are for this nonsense.

posted at: 22:09 #

Sun, 21 Dec 2008

impotent rage

I think that’s the only way to describe the emotion as I listen to and read the steady flow of stories on our less than gentle descent into recession. And also no small measure of bafflement.

As someone who is reasonably cautious about debt I’ve always been amazed at the cavalier approach many people have to it. In the individual this merely invokes bafflement. It’s when it occurs at an organisational level that it begins to make me angry. To be careless with one’s own finances is foolish, and if enough people are it’s bad for everyone; to be, essentially, careless with other people’s finances is far less forgivable.

And it’s this carelessness that results in me shouting at the radio on the way to work. All these people who were so desperate to make more money that they ceased to think about the consequences for others. At least I hope that’s the case. Yet now we all have to care about the consequences of this unchecked avarice for the very organisations and people who led us here thanks to the way a modern free market economy works. It’s astoundingly galling.

posted at: 18:54 #

all the usual copyright stuff... [ copyright struan donald 2002 - 2009 ], plus license