Saturday, 1 October 2011

Debian Server To Send Email Automatically

I run a debian server with Rimu Hosting (highly recommended). Every week I've been going on to do a bit of house keeping. I realised that I could automate those tasks and get the server to send me an email to tell me what it had done. I decided the first problem to solve was to get the server to send me an email from the command line. After a little googling I tried this:

echo "This is a test" | mail dave@goopot.co.uk -s "Just testing from the server"

That didn't quite work as expected. The problem was that I run my email from Google Apps on my domain. I wanted @goopot.co.uk addresses to be picked up by Google's email servers. However, the debain server knew that it was goopot.co.uk so decided to handle the email itself. It very efficiently delivered the email to the linux user account on the server, and not my Google mail box.

I needed a way to tell the server that email to goopot.co.uk should be handed off to Google and not processed locally. A bit more googling led me to the Debian Wiki page about Gmail and Exim4. I followed those instructions to the letter and tried again:

echo "This is a test" | mail -v dave@goopot.co.uk -s "Just testing from the server"

Nothing seemed to happen at all. No email arrived either locally on the server or to Google. Hmmm.

Back to the drawing board. I next tried to send an email to my wife's account to see if I could figure out what was working.

echo "This is a test" | mail -v wife@myfamily.com -s "Just testing from the server"

That worked like a dream. So the Exim config is working fine, but the mail program doesn't know to go to the SMTP server rather than delivering locally.

Digging into the docs I figured out that I needed to make sure that the "local_domains" parameter was set correctly. I edited /etc/exim4/conf.d/main/01_exim4-config_listmacrosdefs and changed the local_domains parameter to be empty. I re-ran:

sudo update-exim4.conf

...and tried again. It worked. Yeah!

Wednesday, 28 September 2011

Getting Ready For John Hegley

Went to the Manchester Museum today with the boys. We were taking a look at the Living Worlds exhibit in preparation for them going to see John Hegley next week. I wish I could go along.

Friday, 23 September 2011

Manchester Jelly

Today I spent the day working from Manchester Jelly. It was quite an interesting day. I definitely felt the outsider working for "the man". I wasn't quite sure how much we were suppose to be chatting about things. The conversation came and went. Sometimes there were conversations about WordPress, VAT returns, charge out rates. Sometimes there were Trappist like silences. I think that if there becomes a core of people who turn up reasonably regularly then some common shared background will emerge and conversation is likely to flow more smoothly. Oh, and I did manage to have a reasonably productive day!

Wednesday, 21 September 2011

Make Vibrobot

#2 son and I have just finshing making the Make Magazine Vibrobot. We used a metal shoe polish tin as we couldn't find a metal sweets tin. The shoe polish tin was circular so the cable ties wouldn't hold the motor in place. #2 son solved the problem "use duct tape". I have taught him well!

Tuesday, 20 September 2011

foursquare

I've been playing with foursquare recently. It is quite good fun, but I have no friends. If you are on foursquare and you know me, you can add me as a friend.

Monday, 19 September 2011

Tooth Fairy Arrives

Son #2's first two teeth both fell out on the same day yesterday. The tooth fairy came over night. Given #1 son's common reading of Wikipedia as the Source of Truth I hope he stays off the topic.

Sunday, 18 September 2011

Minecraft Mod Manager

Son #1 has got hugely into Minecraft recently. As a result son #2 is now interested in it also, but that's a different story. I've been roped in as the tech support to install all the "mods". Installing mods involves unpacking and repacking the contents of the minecraft.jar file and moving resources about in your minecraft folder. This is too tricky for a nine-year-old to do reliably at the moment. I've started writing a python script to automate the process. I had a quick goolge to see if I could find someone solving this problem already but didn't find anything.