Because I'll forget if I don't write it down.
RSS icon Email icon Home icon
  • Sending EMail from the Command Line with Ubuntu Server

    Posted on August 25th, 2009 Dave No comments

    In a previous post I wrote about the problems I had encountered while trying to configure my Ubuntu Server to send emails from the command line (actually from a script but it amounts to the same thing). I overcame the problem in the short term by using curl to send messages via Twitter but I really wanted to work out how to end emails instead. Well after a bit more research and some testing I have cracked it :-)

    What I didn’t understand was that I needed two components to be able to send an email in this way, a Mail Transfer Agent (MTA) and an email client. For my solution I have used Nullmailer as my MTA and Mutt as my Client.

    Nullmailer is not a full blown MTA like Postfix but then I didn’t really need something that heavyweight for my purposes. Nullmailer is a ‘minimal mail relay’ – it doesn’t handle local mail delivery or download message from other servers, it just passes email from the local machine to a mail server for delivery.

    Mutt is a small but powerful, text-based email client which can send email from the command line but also has a GUI (of sorts). I was only interested in the command line interface for this little project. Read the rest of this entry »

  • Tweeting my External IP Address from Ubuntu Server

    Posted on June 17th, 2009 Dave 3 comments

    In my previous post I described the problems I encountered while trying to configure my Ubuntu Server to be able to send emails via a the command line (in my case it was actually via a script). The reason I wanted to do this was so that I could run the script on a scheduled basis to check my external IP address and notify me when it changed.
    Why? Well my ISP has provided me with a dynamic IP address which changes on a periodic basis – not that I normally notice. Well if I want to be able to administrate my Ubuntu Server from outside my local network, i.e. over the Internet via SSH, then I need to know the outward facing IP address of my router.
    I had already found a script to do this and tweaked it a little to run under a non-admin user but while it could detect the change I needed some mechanism for it to tell me. After a fruitless evening trying to set up email I gave up and decided to use the Twitter API instead.
    Read the rest of this entry »