Virtual accounts with exim and dovecot

A few people commented on my last post asking for details about how I configured exim and dovecot to have the fake scott+canonical account and separate Maildir tree.

exim4 router configuration

The first key part of the configuration is to configure exim4 to split the local part into a user name and a suffix. This allows a local part such as “scott+canonical” to be split into the user name “scott” and the suffix “+canonical”.

This is configured by adding the following two options to the appropriate routers in your exim4.conf:

local_part_suffix = +*
local_part_suffix_optional

The first option defines the suffix; normal practice appears to be to use both “+” and “-”, but since I’d previously used “-” with qmail I opted to use “+” only so that I didn’t confuse myself during the transition.

The second option allows the suffix to be optional, so that mail to “scott” is still delivered normally.

Now mail to “scott+canonical” will be delivered to the “scott” user.

Forwarding configuration

The next task is to ensure that mail is actually forwarded to this address; for me this was a configuration performed by the Canonical sysadmins to ensure that my work e-mail is actually delivered to scott+canonical on my own mail server.

Filtering configuration

Since both personal and work e-mail are now both being delivered to the same user account on my home mail server, I need to filter the mail into separate folders.

This can be done by checking the $localpartsuffix variable in Exim filter .forward files, e.g.:

# Exim filter

if $local_part_suffix is "+canonical"
then
    save Maildir/Canonical/
endif

Now incoming work e-mail is filtered into a different mail folder, while personal mail is delivered into the primary one.

I’ve used similar filter instructions for mailing lists, mailman messages, Launchpad mails, etc. to filter into appropriate folders.

Where the mail is personal, it is filtered into (e.g.) Maildir/.Lists/upstart-devel/

Where the mail is for work, I add /Canonical/ to the path, (e.g.) Maildir/Canonical/.Lists/linux-hotplug-devel/

This means that the Maildir/ directory is my personal INBOX, with sub-folders immediately under that and beginning with a period; and the Maildir/Canonical/ directory is my work INBOX, with sub-folders immediately under that and beginning with a period.

This defines two trees in a manner compatible with dovecot. There’s no particular reason that Maildir/Canonical/ has to be under Maildir/, it could have been Maildir-Canonical/ and this would still work. I simply wanted them in one place to ease backups.

Dovecot configuration

Now we need to configure dovecot to permit login by a fake (”virtual”) user, with a different Maildir tree, so that I can configure them as two separate accounts.

The first set of changes is to dovecot.conf to add an additional authentication source. Modify the “auth default” block to add a new “passwd-file” passdb in addition to the “pam” passdb (or whatever your system is using).

passdb passwd-file {
  args = /etc/dovecot/passwd
}

This lets us authenticate virtual users, but we also want to set their attributes, so we can use the same file as a userdb in the same “auth” block.

userdb passwd-file {
  args = /etc/dovecot/passwd
}

Dovecot will now check both PAM and this file for user information.

We now simply need to add a line to this file to specify the virtual user and set up the alternate Maildir tree.

scott+canonical:PASSWORD:1000:1000::/home/scott::userdb_mail=maildir:/home/scott/Maildir/Canonical

The format is that of an ordinary passwd file; the first two parts give the passdb authentication credentials and the rest give the userdb information.

I’ve set this user to have the same uid, gid and home directory as my real “scott” user.

The final part changes the mail environment for this virtual user, instead rooting it at Maildir/Canonical/

Client configuration

The mail client will need two accounts adding; one for “scott” and the other for “scott+canonical”. It will see two separate folder trees for each account.

An unexpected bonus is that the reply account is now automatically set for me, since I’m replying from the specific account rather than from a single general one.

Trial Flight

I’d spent the entire month since making the booking preparing myself for the disappointment of it being cancelled due to weather, and having to rebook and wait another few weeks.

The weather report the day before wasn’t too bad, and the weather outside looked pretty nice. A fair amount of high fluffy cloud, but good visibility and nothing too low to worry about.

So I was even more nervous when I phoned up to find out whether the flight would be going ahead. “A bit of a cross-wind, but a couple of guys have been up already with no problem” was the report. It was still on!

Had I been lucky enough to pick, four weeks ago, one of the only good days for flying so far?

We set off for the airfield, and I couldn’t help but keep an eye on the weather all the way there. At one point, a pretty nasty cloud appeared ahead and my heart sank, but then we turned away from it and there was blue sky ahead with the wind coming towards us.

As we got nearer, we started to see aircraft flying around. It turns out that all that worrying was for nothing, the weather for miles around the airfield was beautiful with nothing more than a bit of wind.

We’d intended to stop off for a pub lunch on the way, but had left a little later than we intended. Therefore we arrived early, but without enough time to stop off for something to eat.

Popped into the club to let them know we were there, and paid for the flight. Since this was my first flight, my partner was paying for it as my birthday present; and it would be in a 4-seater Piper Warrior so he could come along too and ride in the back.

The instructor was out with another student, so we opted to have something to eat at the airfield’s busy “Touchdown Cafe”; and sat on the decking outside the club afterwards watching the planes and waiting for the instructor to return.

The plane I was to fly in was G-GYTO, a seven year old PA28 Piper Warrior. Someone had taken it out that morning, so it was briefly checked for fuel before the briefing.

I was very happy to discover that my instructor would be the same man who had shown us round the aircraft on my first visit to the airfield. His relaxed and patient style had left me with a really good impression of the club, and I was delighted that he would also be taking me up in the air for the first time.

The briefing covered the aircraft’s controls with a cute little meccano model, headsets were picked up and then it was time to walk out to “Tango Oscar”.

David got settled in the back while I climbed into the left seat, through the Piper’s single left door. Headsets were plugged in and the volume checked, engine was checked and started, and then we were taxying out to the hold for the runway.

Along the way I got a chance to swerve the plane left and right a bit with the pedals, until we reached the holding point where we turned into the wind and performed the final pre-flight checks.

We were held as a couple of other aircraft landed, and then it was our turn; “Tango Oscar, Wellesbourne Information, take off at your discretion” … “Take off, Tango Oscar”.

The power went up, and so did my nerves, as we accelerated down the runway. John (the instructor) talked through each of the movements he did along the way, and then we were up in the air and flying through the crosswind and turbulence.

Noticed very quickly that the smaller aircraft was much more at the mercy of the elements than the commercial jets, and needed more input; or maybe it’s just that I was now sitting in the front and could actually see everything.

Once we were up to 1,500ft; we levelled off and I had control.

The first task was understanding the effect of the controls. The pedals yawed the aircraft, and finished up with a bit of roll. The control column rolled and pitched the aircraft.

My next task was to keep the aircraft straight and level while we flew towards Long Marston airfield. All of my concentration was taken up just trying to keep the plane going in one direction.

The nose wanted to turn in all sorts of directions, and it needed continual input to try and keep it going where I wanted.

We then tried some turns, and I was amazed by how hesitant I was to seriously bank the aircraft. It felt uncomfortable to do anything too tight; and it wasn’t until I was on the ground that I remembered that rudder correction can solve that.

Throughout the flight, John was pointing out various landmarks along the way; and David was happily taking photos in the back, but I was entirely occupied for keeping us in something like a straight line.

He only took control once when David spotted a glider, to get out of its way, and returned control to me afterwards.

Somewhere along the way John introduced the trim wheel, since I was obviously pulling on the column to keep it level. I found this quite hard to sort out at first, turning the wheel didn’t seem to make much difference, but eventually I think I got it somewhat in trim.

After Long Marston, we turned towards Birmingham, and tracked towards that keeping it on the horizon. We then turned right towards Stratford-upon-avon, “and ok, we’ll descend a little as well” John cheerfully added as I failed to hold the nose up during the turn.

All too quickly I was heading over Stratford and had Wellesbourne in sight ahead; John called them on the Radio, and took control for the join, approach and landing. And then we were on the ground and taxying back to the school.

For the rest of the day, I was grinning like a child and making “neyowm” noises to myself.

After a light snack, we visited a little nursery we’d seen on the way in to look at some plants. Every time a plane flew overhead, I looked up; and for one of them, my heart leaped even more when I saw that it was Tango Oscar.

P/UT Hours Today 0:30, Total 0:30

Weather Permitting

EGBB 131607Z 140024 19014KT 9999 BKN025
TEMPO 0002 7000 -RA BKN010
BECMG 0811 26015KT
PROB30 TEMPO 0919 26015G25KT 7000 -SHRA

A thirty percent probability of light showers tomorrow, with cloud base at 2,500ft.

As my nan used to say, it’s got two chances…

Mail Strike

Like most geeks, I run my own mail server. The burden of administering it is much less than the increased flexibility in filtering incoming mail, let alone dealing with SPAM.

My mail server configuration has remained pretty static the entire time, and controversially, I’ve always used qmail.

The reason for this dates back to my first sysadmin job in the mid-to-late nineties, and the decision in those days did tend to be sendmail or qmail; with the security conscious choosing the latter.

qmail’s delivery system is a little odd, everything on the left hand side up to the first “-” is considered a user, and everything after can be used for filtering.

The default local delivery component takes this into account, so e-mail to scott-foo can be filtered by the /home/scott/.qmail-foo file.

This gives a pretty natural way to deal with mailing lists; you subscribe with a unique address for that list, and all the mail goes into the right folder automatically.

This has served me reasonably well over the years, with heavy patching across the daemon to add features such as LDAP integration, and SPAM filtering that I wanted.

Unfortunately it’s been getting to burdensome to maintain. Since it’s not true open source software, and is effectively abandoned upstream, it’s not as up to date as I’d like.

SPAM filtering tends to take place in the local delivery loop, rather than at SMTP time; and due to the strange delivery system, it’s unreasonably hard to perform any kind of sender verification or greylisting.

Since every special address is filtered differently, it’s quite hard to add common filtering unless it’s pre-planned and you use addresses with a common prefix.

The clincher has been dealing with super-sites like Launchpad which send huge amounts of different e-mails to a single address, and no facility to separate that from your published contact address.

I needed a better mail server.

So I’ve now moved to exim.

I was surprised by how quickly I was able to pick it up, I did the migration in two day outages. The first to simply migrate delivery and stash the mail in one big folder, and the second to customise the delivery and filtering to my liking.

I’ve also re-subscribed to mailing lists with single addresses again, so now I have a single filter rule which happily can filter Launchpad mails around as well.

Happily I’ve been able to make a change I’ve wanted to for a while, home and work e-mail is separated into different Maildir/ trees; and mailing list subscriptions made with the most appropriate address.

The magic of dovecot lets me create a fake scott+canonical user that uses the alternate Maildir tree, while still retaining my user permissions, etc.

Overall I’m pleased with the new setup, and how the migration went. SpamAssassin needs some tuning as a little SPAM is still getting through, but otherwise it seems to be working well.

Reading in the Rain

Look what happens; the whole world goes “carbon neutral” mad, planting trees and burning Jeremy Clarkson instead of Fossil Fuels and what do we get? A summer so wet that you can pick up the “dropped sausage” as it floats past the barbecue. I want the global warming back, at least then it was nice out!

A combination of the glorious English summer, and a busy social and work calendar has meant that I’ve had no chance to get airborne.

I’ve made a booking with Wellesbourne Aviation for Saturday July 14th, one of the few days in July that I have free, so hopefully the weather can be persuaded to behave by then.

Wimbledon will be over and the British Grand Prix a memory, so I’m hopeful that the rain gods will bugger off for a while and give us some clear skys for a couple of weeks (since we’ve got yet another re-booking of a balloon flight that I bought for my partner last September scheduled for the week after!).

I’ve put the time to good use however, and purchased the complete set of “Trevor Thom” books. The flying school slightly favours the Jeremy Pratt, but I found after reading through both that the style of the Thom books far better suits me.

The usual comments against them are that they’re overly technical or precise, which makes them to me read more like the computer manuals and science articles that I’m used to; and a far better fit. I found the casual tone of the Pratt series more difficult to learn from.

thom1.jpgthom2.jpgthom3.jpgthom4.jpgthom5.jpgthom6.jpgthom7.jpg

I don’t think there’s any particular disadvantage to starting the exam study this early, without the practical experience to back it up. Both reinforce the other; and I do think that the longer run-up you have on the written side, the more likely you are to learn it rather than just cram the answers into your head before sitting the exam.

For me, I think it’s even more useful. I’ve found that I’m sometimes not able to fully grasp a subject without the necessary technical background. I don’t know whether my physics teacher remembers my difficulty in understanding how a capacitor worked; I couldn’t understand why the simplistic description of them didn’t cause the same effects with an ordinary switch. It wasn’t until later on when I learned the underlying principles that I fully grasped how they could be used.

I can already think of an example where this is true in flying.

Some people may be content to know that the altimeter can be set to one of four settings; and happy to just learn by rote which of QFE, Aerodrome QNH, Regional QNH or 1013.2mb they need at which point in their journey. They can probably remember learning why for their exams, but not worrying about it anymore.

For me, knowing what the difference between them is, and how to calculate one from the other, has given me a far greater understanding. I could’ve probably learned them by rote, but it would have never been entirely clear to me. Instead, I now understand them, so the appropriate choice at each point in the journey is obvious to me; not to mention the effects of moving from one pressure region to another.

Another useful thing from starting the reading so early is that I’m able to read the aviation weather forecasts.

EGBB 021644Z 030024 21009KT 9999 SCT020 TEMPO 0009 8000 SHRA PROB30 0007 BKN008 TEMPO 0921 6000 SHRA BKN020CB PROB40 TEMPO 0920 3000 +SHRA TSGR BKN014 BECMG 1013 27014KT

Unfortunately, this is still depressing reading …

Finding a Flying School

Having made the decision to learn to fly, the next task in hand was to find somewhere that would teach me!

Being a computer programmer for a living, the first place I turned to for advice was the good old Interwobble. The first instinct is just to type “flying schools” into Google and see what we get in return.

Eventually I found the Flying Schools lists at Flyingzone and PPL Mania which gave me a good idea of what was in the area.

The first immediately obvious thing is the difference in website quality, ranging from quite professional through to 404s. Clearly you can’t directly gauge a school on their website; this surprised me at first, I figured that they would be trying to attract the relatively cash-rich Internet generation.

The second obvious thing was the wind range of hourly prices and aeroplanes flown by each school, without much information to differentiate them.

Plan B then, which was pretty much a follow-on from Plan A anyway; get in the car and actually visit the schools.

A dull Saturday while my partner was away gave me the perfect excuse; not that I really needed one. I was itching for any reason to go and get my first look at the schools.

Tatenhill

My first stop was Tatenhill Aviation at the airfield of the same name.

They’d ended up on my list because their website was one of the nicest to look at, and their prices were one of the cheapest!

The drive there was quite pleasant, and I found the airfield without any trouble.

The weather had made sure it was a quiet day, so there was an instructor round who I was able to chat to and ask various questions about the training.

And I got to sit in a plane for the first time! Ok, it never left the ground, and never even moved, but it was an experience nonetheless!

Popped into the little cafe afterwards, and had a coffee and a chat with Margaret; who I’d read about from other people’s PPL Diaries.

Overall impression was that it was a nice, friendly, place; albeit a little on the small and quiet side, but that wasn’t necessarily a bad thing.

Halfpenny Green

I hadn’t spent as long getting to Tatenhill as I expected, and had plenty of time left in the morning, so I decided that rather than heading home I would head to the second airfield on my list; Halfpenny Green (Now known as Wolverhampton Airport).

I knew from my research that there was a handful of flight schools based here, though the only website was for The Flight Centre who seem to mainly deal with commercial ratings. Their prices certainly reflected that!

It was the other two schools I was interested in. The airfield impression was markedly different from Tatenhill; where that gave the air of a casual airfield, this had the feel of a small run-down airport.

RJP Aviation was the first, and I spent a pleasant hour or so having a cup of tea with Tony there and met one of the instructors. He answered most of my remaining questions, and I left there with a good feeling for the place.

On the way out, I popped into “The Flying School”. A friend had done his training with the instructors who’d gone on to form this school, so I had to at least take a look. Unfortunately it seems like they’re still just getting going, and didn’t have any prices other than for a trial lesson. The solitary plane was a bit of an issue too, as I figured that would make booking harder (not to mention no possibility of hiring it after I passed!)

The day was getting on, so I headed home. And this is where I found out the main problem with this airfield; from where I live in Birmingham, it’s practically impossible to get to! The journey into Birmingham city centre took over an hour, ruling it out completely.

Wellesbourne-Mountford

The third airfield on my list was Wellesbourne-Mountford. I’d discounted it at first, because it seemed like it was quite a way out, and it wasn’t until I told my partner about it that we realised we passed it on the way to his parents and that it was only just off the M40 by Warwick!

Well within travelling distance, and in fact, almost exactly the same time to get there as Tatenhill.

Made the trip down there together on the Sunday following my previous excursions.

First impressions were as different from Tatenhill and Halfpenny Green as they had been from each other. This was clearly an airfield, but rather than the solitary school in the corner, was much busier with several schools and lots of people around.

Ok, the people probably had something to do with the improved weather, but the difference was there.

Visited each of the schools there in turn, and popped our heads into the cafe to see what it was like.

Nobody was in at Take Flight so we left with a very glossy brochure, and no real lasting impression other than it seemed like a bit too much of a business and not a nice club.

Wellesbourne Aviation was next on the list. This turned out to be a very friendly and busy club, with a good sized club house and selection of modern aircraft.

I got to sit in my second and third plane, being shown the differences between their two types (Robin HR200 and Piper Warrior) while referring back to the Cessna 152 I’d sat in at Tatenhill.

While their prices were a little higher than others, we left with a very good impression of them!

Pilot Flight Training was next door; not much to say about them, we popped in and were given a leaflet, and that’s about it.

Lastly there was the South Warwickshire Flying School, which we’d passed on the way in as it was a little more out of the way than the others.

This was a place that really highlighted the difference amongst the clubs. They flew Cessna 152s, and since David had not seen in one (but had sat in the Robin and Piper with me earlier) I thought I’d ask whether we could see the plane they used. We were pointed towards the plane on the grass and warned “don’t touch anything”.

Not the best approach to get someone to spend several thousand pounds learning to fly with you, that!

Dreaming of Flight

As my mother reminded me when I announced my intention to learn to fly, when I was a child I firmly wanted to be a pilot!

Comes from growing up under the Gatwick flight-path I guess, when playing out in the garden would be regularly interrupted by an over-flying jet.

Unfortunately this was a dream I had always assumed would never happen. I was born with Glaucoma, an eye disorder that means the fluid in my eyes does not drain correctly resulting in an increased pressure that can, if untreated, cause irreparable damage to the optic nerve and eventually blindness.

I was lucky enough to have it diagnosed while still a toddler, and operated on at an early age. I was prescribed eye drops for most of my childhood, and had a second round of operations in my mid-teens.

Since then I’ve had no problems, and haven’t needed to take eyedrops to regulate the pressures. And thanks to the early intervention, my visual fields are completely normal and I’ve experienced no loss of vision.

Despite this, I still believed that flying was out of my reach, since my medical history would exempt me.

Fast-forward a few years, I’m now in my mid-twenties and working as a computer programmer for a startup software company.

One of the unusual perks is that regular travel to conferences, “summits” and “sprints” is required as part of the job. And if you’re lucky, you’ll be invited to fly there on the CEO’s own private jet, affectionately nicknamed “Canonical One”.

I had my first trip on it a couple of years ago, flying to Australia.

For someone used to commercial aviation, having access to the cockpit was an amazing experience; I’d only ever had the chance before as a nine year old.

I’d wandered up a few times and chatted to the both of the captains and second-seats we had on each leg of the journey. As we flew in towards Canberra at night, I began to really appreciate the the pilots have some of the best views in the world.

The most recent time on board was during a tour of various US technology companies; for visa reasons, we flew in and out on ordinary commercial flights but the flights around the states were done aboard the jet.

By far the highlight of the trip was kneeling in the cockpit while we flew over San Francisco, with the moon shining off the bay, and descended into San Jose airport.

The bug I had picked up as a child came back full-force.

The captain was staying in the same hotel as us in the week after, and I took full opportunity to find out some information about how he trained to be a pilot, etc. I learned that the second-seat for the return leg used to be an instructor, so quizzed her for all sorts of information.

And most importantly, I learned that while the medical is comprehensive, and while vision requirements are set, having been born with Glaucoma but otherwise having excellent eyesight should not be a problem.

Once home, I started to find out more, and eventually spoke to the CAA Medical Advisor who confirmed that provided my vision was within the acceptable limits, that I should pass that aspect of the medical.

A visit to the optometrist provided the necessary confirmation. My visual fields are normal, and while I’m slightly long sighted in one eye, it is not enough of a difference for glasses; let alone a large enough difference to fail the medical.

Obviously I still need to undergo the actual medical examination, but a childhood dream has been reawakened.

The next step would be to find a local flying school, and take a trial lesson!

Something for everybody

According to the current issue (#93) of Linux Format, Ubuntu 7.04 (”Feisty Fawn”) is “…a dull release for Ubuntu, leaving Fedora to storm ahead…” (p. 23) whilst “shaping up to be one of the most innovative Linux distro releases of the year.” (p. 38)

Especially amusing for myself is that, with Upstart, they “seldom notice any difference in boot speed” (p. 42), yet “Ubuntu 7.04 boots up in record time, leaving other Linux distros in the dust.” (p. 22)

(As anyone who’s ever read anything about Upstart will know, Ubuntu still uses the SysV-rc scripts so there should be no difference in speed at this point. Funnily enough, they identified the reason Ubuntu boots fast in the same issue; “Changing the /bin/sh symlink to point to Dash instead of Bash can significantly shorten boot times” (p. 33) — unfortunately they simultaneously claim that Dash is only “almost POSIX compliant”, without explaining why they think it isn’t.)

In this modern world, the lack of any editorial direction or basic research into what’s being printed is quite refreshing.

Keyboards

I was really starting to worry that I wouldn’t be able to find another Cherry G80-3000 keyboard; even Cherry’s website didn’t list it anymore, instead only showing the vastly less clicky G81 range.

Happily I’ve found a stockist.

http://www.cherrykeyboardsrus.co.uk/

Think about things

One of my pet dislikes are those people that pay lip-service to a particular problem, such as Accessibility, Internationalisation or Usability, without actually thinking about them.

My favourite example can be found at the Trafford Centre in Manchester, England.

Somebody there has clearly realised that accessibility is a problem, and ensured that every single sign has Braille added to it so that partially-sighted or blind people are able to read what they say.

They’ve only been paying lip-service to the problem though, and not thinking about it.

The evidence? The following sign, mounted directly on a door, with Braille on it:

Do not stand directly in front of this door.