Self-hosted disposable email addresses with AHEM

Screenshot of webpage showing AHEM email service

I've run my own mailserver for years now, with a catch-all on some domains.

This means that, whenever a shop or service asks for my email address, I can give them a unique address, specific to them, without needing to configure anything.

This has a number of uses, but the main ones for me are:

  • if their system is compromised, my email address is of no use for credential stuffing attacks (since it is used only for that one site/service)
  • if I get spam from which I cannot unsubscribe, I can kill that email address without disrupting anything else
  • if they leak or sell my email address, and someone else uses it, I can tell

One thing this setup does not do well, though, is deal with the situation in which I want a disposable email address: an email address which exists long enough to receive one email.

That's because, once I've given someone their unique address, they can continue sending to it, and it will continue to funnel their email into my mailbox, until I take action to stop them.

Sometimes, I want — well, am forced — to give over an email address just to access something. (For example, I wanted to download a cycle map from Sustrans the other day, and they insisted on having an email address, which is nonsensical as they just emailed me a link to a PDF on their website. Why not just hyperlink the PDFs from the website, and skip the hassle?! (Spoiler: probably some kind of tracking.).)

In that kind of situation, I want a system for disposable email addresses, which exist only for a very short period of time, and which do not clog up my mailbox.

Just use a third party service?

There are loads of services which offer this, some free and some paid, and, to date, I've just used one of those. Since I've not used them for anything private, it didn't matter too much to me that someone else can see the content of the email.

Indeed, if you are looking for privacy from "hiding in a crowd", using a third party service is probably preferable to hosting your own service.

However, that trade-off was acceptable to me, and since I prefer to host my own tools, having my own setup seemed like a useful thing to have, if it was relatively easy to do.

And it was.

Relatively.

AHEM: the Ad-Hoc-Email-Server

It took me about 30 minutes to get a disposable email server running using AHEM.

The instructions on github sort of worked, and I can't tell if the bits which did not work out of the box are because of my lack of familiarity with node.js, or incomplete / no longer accurate instructions. Let's assume it's my ignorance!

I had a bit of a fight with angular, to make the project build, and I solved the error message by forcibly installing a particular version of it. Not ideal, but it worked.

After that, it built with some warnings but no more errors.

A and MX records

Since it's an email service, you need to set an MX record for the domain you want to use, pointing to a record pointing to the IP address on which you're running AHEM.

I chose a sub-domain of my normal domain. I'm using it for both the email addresses, and also for accessing the web server (via nginx).

AHEM can support multiple email domains, so if I wanted to do the same for one of Sandra's domains, it would be a simple case of adding the domain to AHEM's .env file.

Making it more privacy-friendly

I can understand why people do it, but it bugs me all the same: why use static files hosted by a third party CDN, rather than just hosting them yourself?

Out of the box, AHEM uses some JavaScript resources hosted on Cloudflare. I used wget to download the scripts, and then replaced the references in index.html with localhost references instead.

Bingo.

Proxying via nginx

By default, it runs on localhost:3000. Fine for testing, but not what I wanted permanently.

Since I had nginx on the server already, reverse-proxying to give a web interface over port 80, using the same sub-domain as for the email address itself (although anything else would work too; they are not connected) was easy.

It also meant that it was trivial (using certbot) to pop a TLS certifcate on the proxy, giving me TLS over 443. Even though the web interface will be firewalled off and accessible only without our private network, I'd prefer to have TLS in place anyway.

I'm not sure why, but the basic config was 404'ing traffic to /socket.io/, so I added a specific Location section for that:

location /socket.io/ {
    proxy_pass http://localhost:3000;       
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
}

Making it persistent

I'm not that familiar with node.js, so there might be a better way of doing this, but I was struggling to keep it running when I closed my ssh connection.

I could just run it as a background process (by appending & to the command), but I installed pm2:

npm install pm2 -g

and then ran it using:

pm2 start ahem.js

The outcome

Now, I have a simple to use, self-hosted, web page, which lets me generate random email addresses to paste into webforms when I want a disposable address.

I need to refresh the page to check if an email has arrived, but that's fine. I should check if there's something I've not configured correctly, as I'd have thought it would refresh periodically, if nothing fancier existed to show an email when it arrives.

Email are deleted automatically when they are 24 hours old; again, this is something configurable via .env, but that seems fine as a default.

AHEM's licensing status

A couple of weeks ago, AHEM changed its licence from an in-house job to Apache 2.0.

This is a good decision, IMHO, but still needs to be reflected in the AHEM interface, since this says that it's only "available for personal and internal use".

The EZ Clamp Spring: keep your clamps in position

This post combines three things I like: 3D printing, cycling, and Creative Commons licences.

One of the joys of a Brompton folding bike is the folding bit. And the clamp system is both clever and robust.

But the clamps have a nasty habit of spinning on the bolt, which makes them that bit more difficult than is ideal when it comes to unfolding the bike.

The EZ Clamp Spring

I was pondering what I could do about it, and looking around to see what others have done, and a chap called Steve Wood (Gyrobot) has solved it with a very simple 3D printable widget: the EZ Clamp Spring.

It exerts pressure on the clamp, keeping it in the right orientation.

It's a perfect solution to the problem.

Print or buy: it's up to you

You can either print it yourself, or buy a pre-printed version ready to install.

Normally, I'd print a model myself, but the creator suggests a particular type of filament, which is more flexible than the filament I have to hand (and I'm not sure my printer would cope with it anyway), so I bought a couple.

Shipping times are obviously not under their control (especially at the moment), but mine arrived very quickly.

If you want to print it yourself, you can download the files from Thingiverse.

Installation could not be easier

Dead easy — about a minute per clamp.

You simply remove the clamp and bolt, thread the EZ Clamp Spring onto the bolt, and then screw it back in place. That’s it.

Once you've installed it, you can see the benefit of it immediately: when up undo the clamp, it stays in exactly the right place, ready to be tightened.

A surprising choice of licence?

The 3D printing files are licensed under a Creative Commons licence (great!), but not the one I would have expected.

The inclusion of the "NC" — non-commercial — restriction is not unexpected, but the "ND" — a prohibition on tweaking the file — surprised me.

I'd have thought that improvements would have been welcome, but I'm not the copyright owner, so it's not my choice!

Nice rack!

I spent an enjoyable hour-and-a-bit today, fitting a rear rack to my Brompton. I haven't bothered with a photo: it looks like a standard Brompton with a standard Brompton rack attached to it.

In hindsight, I'm not sure why I didn't buy one with a rack already fitted, but oh well. Aside from it being a way of thinking about Something Other Than Work for a bit, the process of installing it taught me some quite a lot about the bike, which is undoubtedly going to be useful from a maintenance perspective.

What I did

I worked out how to do it by following a number of videos on YouTube, and referring to the supplied instructions.

As far as I can tell, there's nothing detailing the end to end process, so it was a bit of guesswork, and trial-and-error.

Edit: someone has suggested it would help if I said what bike it is. It's a 3-speed.

I did things in the following order:

  1. Remove the rear wheel
  2. Remove the rear mudguard
  3. Put on the rack and new mudguard
  4. Put the rear wheel back on
  5. Replace the old front rollers with the new, larger, ones which came with the rack
  6. Fold the bike and put on the new seat post bung. (I say "new"; I didn't have an old one to remove.)

All in all, it took me about 1.5 hours. This included a fair amount of time re-watching bits of videos, to make sure I had understood, and intentionally taking it slowly to try to lessen the risk of messing it up — there was no rush. If I were to do it again, I'm pretty sure I would at least halve that.

Removing and replacing the rear wheel: what I wish I'd known

There are a few videos about this, all pretty similar.

There are a couple of things which I wish I had known upfront, which I didn't see covered in any of the videos I had watched:

  • The first step is to remove the indicator chain — the bit which goes into the hub to make your gearing work. It's easy to do, but I would take extra care not to move the nut, or to move it as little as I could. When it came to putting the bike back together, and making sure the gears were working, I spent a lot longer working on this that would have been the case had I left the nut in roughly the right place at this step.
  • How to deal with the brakes. I guessed that, rather than attempting to take them apart, the simplest approach would be to deflate the tyre and squeeze it through. Even then, it was a tight fit, but it work.
  • The "tab washers" — the bits which help keep the wheel attached to the frame have a top and a bottom.
    • Again, after the event, the official instructions do say this. Perhaps my biggest learning is to rely less on YouTube, and more on the official instructions!

I'm glad I've learned these lessons now since, when it comes to fixing the inevitable puncture, I'll be able to do it a lot faster.

Is it worth it?

Time will tell but, as with most things Brompton, this was an expensive bit of metal.

I have immediately noticed how much easier it is to roll the bike around when folded down. I had a real challenge with this at the station, as the small wheel on the old mudguard seized up every few metres, making a horrible noise and rendering the bike immoveable.

Some kind people on Twitter suggested that it is easier to pull a Brompton than to push one, but now it seems — on the basis of some very limited testing in the confines of our kitchen — to be better. A lot better.

While I love the idea of making the most of my new rack by heading off into the distance on a folding bike, tent and provisions strapped to the back, I'm realistic:

  • we're in a lockdown and, while this has got to be about as low risk as it's possible to get, I very much doubt it's consistent with the current rules. Whatever they might be.
  • even if we were not, I can find time to squeeze in the occasional two or three hour ride, but anything more than that is just wishful thinking.

Put it this way: I'm not going to be rushing out to buy luggage to hang off it.

Easy/Eazy wheels?

No.

Well, not yet.

I was tempted, but I'm very aware just how much money I am pouring into a a bike when I am not sure just how much I'll use it.

Next job: front mudguard

I think I'm almost through my (Brompton-related) jobs list.

The only other bit I really want to replace is the front mudguard, as that is cracked; at a guess, from a previous owner not being careful enough when folding it, and smacking the rear wheel into the front wheel. It looks like a pretty simple thing to fix.

My first ride through a Tier 4 Newbury

Tonight, I went for my first cycle ride through a Tier 4 Newbury.

It wasn’t the longest ride – about 30 minutes – and I decided to go through the town centre.

I suppose I don’t really know what Newbury town centre is like early on a Sunday evening anyway but there’s only one word for it tonight: tumbleweed.

I think I went all the way from the clock tower at the top, to the other side of the railway line at the bottom, without seeing more than three people.

From a cycling point of view, it was great (although I do need to adjust my saddle a bit, as it has slipped backwards). But what does it mean for Newbury?

The future?

I do wonder what Newbury, and perhaps other similar small towns, are going to be like, once the pandemic is over.

It used to be a lovely High Street, although in recent years, it has become replete with the usual stores, charity shops, and generic coffee chains. With one or two notable exceptions, you could be in almost any town without realising it.

I suppose that I am part of the problem (if the decline of the traditional High Street is indeed a problem), as the bicycle I was riding, the accessories on it, and every stitch of clothing I was wearing except my shoes, were bought online.

Not a new trend, but the pandemic obviously is not helping either. Debenhams is closing down, and quite a few other shops are now vacant, adding to those which already lay empty.

Places of leisure?

Perhaps High Streets will become places of leisure rather than for shopping?

But then I’m in no rush to head back to a restaurant either.

There are some lovely independent, or at least small chain, places to eat in Newbury, but the many offer delivery, and all offer takeaway. Which suits me just fine.

So we really are down to the situation which I wish to meet someone somewhere other than at home, and that happens very, very rarely.

If not food and drink, then what?

My occasional, usually regretted, trip to the cinema (more hassle, more expensive, more people, and less pleasant than waiting and watching the film at home) isn’t going to prop up that. And I love the Corn Exchange in theory, but I last went perhaps seven years ago? Life gets in the way, and I often can’t be bothered to leave the house, especially if it involves mingling with other people.

So, for now, I guess that just leaves the town centre as a place through which I can pass on my bike on a quiet evening.

Christmas chocolate cheesecake

Chocolate cheesecake in a rectangular tin on a kitchen worktop

(There's nothing which makes this particularly Christmas-y; it's just something we've always made for Christmas Eve. Perhaps eating in then assuages some of the guilt of the sugar, butter, cream, and chocolate...)

Ingredients

Base

  • 3oz / 75g butter
  • 7.5oz / 225g crushed digestive biscuits
  • 3oz / 75g brown sugar (demerara granulated)

Filling

  • 6oz / 175g plain chocolate
  • 8oz / 227g cream cheese (I just use a whole tub of Philadelphia)
  • 3oz / 75g caster sugar
  • 2 eggs, separated
  • 5fl / 142ml double cream, lightly whipped

Method

  1. Make the base: melt the butter, then mix with the remaining ingredients. Line a tray (around 9") with baking paper, and cover with the base mix
  2. Separate the eggs carefully. Put whites in greaseproof bowl, and whip until quite firm
  3. Whip cream until quite firm
  4. Put egg yolks, cream cheese and sugar in bowl, whip together until smooth
  5. Break chocolate and melt gently in microwave
  6. Fold everything together (trying not to break down the texture of the whipped cream and egg whites) and spread on base
  7. Chill it until a couple of hours before you want to eat it (or freeze it, if you are making it in advance)

Fixing a very noisy Brompton

On my cycle back through Hyde Park earlier in the week, I noticed my Brompton was making some odd noises. "Odd" in the sense that it had not been making them before, and I hadn't heard other bikes making them, but potentially perfectly normal for a Brompton since I've only had one for a couple of weeks.

I popped it up on the stand yesterday to take a look, and to do some normal bike maintenance.

There were two noises — a rattling noise from the hub, and a rubbing noise from the front type.

Rattling noise from the hub

I'm not convinced I've fixed this, but oiling the chain, and hub, and cycling through the gears, seems to have made a difference. I only had time for a quick test ride, and it did seem quieter.

Looking online, the general consensus seems to be that, if it is changing gears smoothly then, even if it is making a noise, it's probably fine.

That worries me slightly, but, since I don't plan on taking the hub apart, I'll leave it for now and see what happens.

Rubbing noise

This was the noise I had heard most when cycling, and it was a simple one: the front mudguard had got clogged up with mud and other detritus from the wet road. Clearing that out made an immediate difference.

I finally cycled in London!

Brompton bike in front of The Walkie Talkie building in London

Well, today was a first for me: I cycled in London. And I didn't die.

I've been thinking about it for a while, but I've always been worried about it — roads in London are much busier than the roads I normally cycle in Newbury — and so I haven't done it.

But, since I didn't want to be on the tube today, nor spend the length of time it would take me to walk, today was the day to give it a go.

Perhaps today was just a "good" day, but I wish I had done it sooner.

Cycle superhighway CS3

Screenshot of cycle superhighway CS3

I went from Paddington to Westminster and, other than the very first bit and very last bit of the route, I was in segregated cycle lanes or in parks. It was very much a stressfree journey.

So much so that, when I arrived with some time to spare, I decided to explore a bit more, and ended up cycling along the "superhighway" CS3 up to Bank and back.

Dedicated, segregated cycle lanes make a huge difference. And I mean actually segregated lanes, not just a white line along a road. At no point in the ride did I feel uncomfortable or at risk.

I'd prefer cycle lanes to be segregated from pedestrians too (which is not the case on some of the route in Hyde Park) since that seems like the safer option for everyone.

Bits to fix

I had a bit of hanging around at Paddington due to a train cancellation, and pushing my folded Brompton around was not as easy as I had hoped. The small roller on the rear mudguard jammed every couple of minutes, and it certainly wasn't a smooth roll. So I bit the bullet and ordered a rack, to give me two wheels at the front (when folded).

Some odd noises coming from the front wheel as I was heading back, so that's something for me to investigate.

Overall

Overall, a hugely positive, fun, experience.

I wasn't the fastest cyclist, nor was I aiming to be. But I achieved my goals: I cycled in London without dying, and I got to where I needed to be faster than if I had walked, and without going on the tube.

I also scouted out some places where I could lock my bike, if needs be, as I doubt I'll always be able to take my bike inside with me. I'm not sure I'm a fan of that idea, even with a robust lock and thick cable, but I guess that's part of the reason for having bike insurance...

I (finally) bought a Brompton

After many months of not going to London for work, it looks like I might be going in at least a few times in the near future. And, since I don't fancy getting the tube at the moment, I have a good excuse for getting a Brompton.

After keeping an eye on eBay for a while, I bought a second hand 2017 model, and picked it up last week.

I've seen people making lots of upgrades and changes, but I'm loathe to do too much until I've used it in earnest, and worked out what is most important / worthwhile.

But I have made a few immediate changes:

Lights

I've added the same cheap set of LED lights that I use on my Elephant Bike.

These are in addition to the lights on my helmet, and they're cheap enough that, while I'd still be annoyed if someone took them, I'm not going to be too concerned.

The front light, mounted on the handlebars doesn't affect the folding, but I've not found a good place for the rear light yet.

At the moment, I've got it immediately under the saddle, but it stops the seat post from sliding fully into place. Not enough to stop the bike from locking, but enough to make the saddle a bit higher than it would otherwise be. I'll need to see whether it's still folded enough to fit in a train's luggage rack — if not, I'll either need to remove the light each time (which will be a pain), or come up with a better plan.

Phone mount

I know the way to the station well enough, and I think I have a reasonable idea of how to get around London, but I can see it might be helpful to have my phone available, in case I need mapping.

I'm aiming to avoid roads as much as possible, and stick to cycle paths, and I've yet to find anything which shows London's various cycle ways in a user-friendly manner which cycling.

Grips

The previous owner had looked after it well, overall, but one of the bar grips was a bit ragged.

I have replaced the thin foam grips with something a little more contoured and, hopefully, a little more comfortable.

Pedals

I also replaced the pedals, since the ones on the bike were designed to be used with cycling shoes with clips, and that doesn’t suit me at all.

I bought a £35 set of metal folding pedals, which got reasonable reviews. I've only done a few miles on them but, so far, so good.

Seat height

I'm nervous about this, but hesitant about buying a replacement. My initial reaction is that, even pulled out to its fullest, the standard seat post is not quite long enough, as I can't fully extend my leg.

But, instead of buying a telescoping seat post, I've tried adjust ing the saddle. I've flipped the Pentaclip over, to give a bit of additional height, and I've moved the seat. So let's see. It might just be enough.