We see that you are viewing the US version of our website from another country. If you would like to view a local version of our website, please click the link below...

Sales: 1-800-961-2888
Support: 1-800-961-4454
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
Share this on:

Postfix - Installation

Article Id: 90 | Cloud Servers | Article


The base package for all the mail articles will be postfix. There are, of course, alternatives to postfix, each with advantages and disadvantages and, without going into the differences, I have chosen Postfix due its relative ease of configuration.

With all that out of the way, let's go ahead and install Postfix! Remember, we assume that you're using Ubuntu Hardy, set it up using our instructions, and have gone through the basic setup instructions here and here.

Installation

Installation is very easy. We'll be using aptitude to install the software itself.

sudo aptitude install postfix telnet mailutils

Note that we also install telnet and mailx as they contain several tools we'll use to test and configure postfix.

During the installation you will be asked the general type of mail configuration:

postfix1.jpg

Choose the 'Internet Site' option.

You will then need to enter your main domain name (this should match the hostname we set in the previous article).

postfixinstall.jpg

At this stage, you can send emails from your application.

The preparation we did in the previous article and the settings shown above during the postfix installation mean that the very basics are already done.

Quick Test

Although we will look in more detail at sending mail in the next article, let's conduct a quick test to see if postfix is actually sending mail.

You will need to send an email to a working email address using the 'mail' command:

mail address@example.com

Replace the email address with one of your choosing (remember this must be a working email address).

The output asks for the subject of the email. Once done, press enter/return.

Next enter the subject of the email. Once done, press enter/return and then a single period (.) - the period lets mail know the body is finished.

Finally press enter/return again to send the email (you may need to do this twice so you skip the 'CC:' entry.

The output on my machine looks something like this:

mail address@example.com
Subject: test email from democloud.com
test body of the email.
.
Cc:

No confirmation is given that the email has been sent (the logs will show the details) but check the receiving email address and voila! a nice, fresh email with the subject 'test email from democloud.com'.

For many people, that is all you need to send mail from your application - especially if the only emails are notifications to the site administrator.

However, the next article will look in more detail at the settings in Postfix's main.cf file and what they mean. This can help in reducing the chances of your email being classed as spam or your Cloud Server IP being blacklisted.

Summary

Installation of postfix is very simple using the aptitude package manager.

Once installed, email can be sent straight away.

Next Article
Table of Contents

© 2011-2012 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER

Comments

Comment: 

I landed here by following the link under Centos 5.4 and this article expectes me to have Ubuntu Hardy!

Nevertheless I have Ubuntu Natty and ran the commands successfully. But when I execute mail myname@mycompany.in I get the following error

-bash: mail: command not found

Rackspace Comment: 

Sorry about the confusion, Sridhar. For Natty, you'll want to run "aptitude install bsd-mailx" to get the command-line mail tool. For CentOS, I don't think we have a CentOS-specific article on installing postfix right now, but if you want to set it up on CentOS you can replace the install instruction in this article with: "sudo yum install mailx telnet postfix".

Add new comment

©2012 Rackspace, US Inc. About Rackspace | Fanatical Support® | Hosting Solutions | Investors | Careers | Privacy Statement | Website Terms | Sitemap