User Tools

Site Tools


wiki:software:linux:sendmail

Linode and sendmail

This article was originally published on August 26, 2008.

I would not have figured out all this if it hadn’t been for someone on the #linode channel with the patience to walk me through the steps.

At any rate, when I moved abettergeek from Dreamhost to Linode, mail quit working in the forums. PHP has a built in mail() function, but it requires some server config to work – apparently, Dreamhost took care of that, while Linode’s default Linux install doesn’t have sendmail installed by default.

This makes sense – Linode basically allows you to select from a number of Linux distros, and they drop a very barebones image onto your VPS. It’s up to you to install the things you need. This is better than, say, installing everything by default and leaving a bunch of ports and vulnerabilities open from the start.

sendmail, however, is a bit pickier than Apache when it comes to making it work properly. These steps are using Ubuntu 8.04 LTS, but they’ll be similar for any Linux distro.

First, you’ll want to actually install sendmail:

apt-get install sendmail

That part was easy…however, the default Ubuntu config did not have my hostname information configured properly. You’ll need to update your hosts file and your hostname file:

sudo nano /etc/hosts

If you have a line that looks like 127.0.0.1 ubuntu, remove it. The top two lines of the file should look like this:

127.0.0.1      localhost
72.14.177.31   abettergeek.com

Then, you need to update your hostname file:

sudo nano /etc/hostname

This needs just one line for your domain:

abettergeek.com

Restart your server for the changes to take effect, and you should be able to now send mail using the mail() function in PHP.

Articles in this section

  • Linode and sendmailplugin-autotooltip__default plugin-autotooltip_bigLinode and sendmail

    I would not have figured out all this if it hadn’t been for someone on the #linode channel with the patience to walk me through the steps.

    At any rate, when I moved abettergeek from Dreamhost to Linode, mail quit working in the forums. PHP has a built in linux index
  • Linux: Installing SSH2 for PHP5plugin-autotooltip__default plugin-autotooltip_bigLinux: Installing SSH2 for PHP5

    apt-get install libssh2-php apache2ctl -k graceful

    I just installed WordPress 2.7 today. Boy, is it exciting! The entire interface is different, and things can be accomplished much more quickly.

    One of the neat features is the ability to add and remove plugins from the web interface. Unfortunately, WordPress only works with FTP and FTPS (FTP over SSL) by default. I don’t have an FTP server installed on my Linode, so I decided to see if I could use SSH ins…