Configure Postfix SMTP on a co-location server

I have just recently placed a server in a co-location data centre. The server is running Ubuntu Server 6.06 LTS. In addition, I have installed VMware server and created a few virtual machines. That side of things is working nicely (many thanks to WizRd-Linux).

On the VMs I have installed an application (a J2EE web application) which needs to be able to send emails to users. As part of the application config I need to specify the SMTP server which will be used for relaying emails. This is normally not an issue because the application is most often installed on customer sites (behind the firewall) and we just specify their SMTP server, and Bob's your uncle.

But in the co-location facility I need to setup my own SMTP server (the co-lo people said they don't normally give access to an SMTP server for co-lo customers).

Are you just trying to configure an outgoing-only email server. or do you want to receive incoming emails as well? If you just want the application to be able to send outgoing then most linux distros come with a lightweight smtp server configuration that works out of the box. You really only need to go to the trouble to configure postfix or qmail or anything big if you want to receive incoming mail as well. To use your local machine you just set the smtp server in your application to use "localhost".

The paul.hobbs is where the email is going TO, so you don't need to do anything - on the remote end there isn't a user called paul.hobbs.

Yep - that is exactly right - I just want to send emails. I don't want to receive any email and I am not setting up any mail boxes.

So, how does the application which is running in the VM use the lightweight SMTP server on the host? The VM is Windows Server 2003 and the Host is Ubuntu Server 6.06 (Dapper Drake).

Ideally I would like to use Postfix because it seems to be one of the more widely used mail servers. At the moment I don't need to receive emails, but it is quite possible that will change at some point in the future.

The host server has several interfaces, including a custom VMware interface (vmnet2):

From my reading of the Postfix doco, by making the mynetworks_style parameter = subnet, Postfix should forward mail from clients in authorized network blocks to any destination. But there is every chance I am not interpreting the doco correctly.

My end goal here is the have the SMTP server send emails to any email address (eg: fred.bloggs@gmail.com, jimmy1234@somedomain.com, etc), but only act as a relay for the applications running on the VMs (all of which have private IP addresses).

I have noticed that if I send an email to <recipient1>@ozsaba.com, the mail is delivered OK, but if I send an email to <recipient2>@ozsaba.com, it bounces. The difference between <recipient1> and <recipient2> is that <recipient1> is also a user on the Linux server, whereas <recipient2> is not. This makes me think that Postfix is only delivering locally, and that is not actually sending emails "out" to the Internet.

From the web application that is running on the VM, I triggered two emails. One was sent to the address:

<recipient1>@ozsaba.com

The second email was sent to

<recipient2>@ozsaba.com

I have masked the real recipients because I don't want to share the login name of one of the users on my server. But as an example, let's say that <recipient1> is john.brown, and <recipent2> is jbrown. The two emails were sent to:

john.brown@ozsaba.com and
jbrown@ozsaba.com

The mail boxes for ozsaba.com are not hosted on this server - they are hosted elsewhere. But, the email to john.brown did not bounce, while the email to jbrown did bounce. The only difference was that john.brown has an account on the Linux server, while jbrown doesn't. Interestingly, there are mail boxes on this server (I assume this is normal behaviour for Postfix), and the email to john.brown ended up in one of those mail boxes. However, what seemed to be happening is that Postfix was trying to deliver the emails only locally. After I did a force-reload, after I changed the main.cf file, I noticed that the log file now showed it was delivering emails to the Internet.

I hope that all makes sense.

Note: john.brown and jbrown are not real login names or email addresses - I just used them to illustrate the scenario.

Last month Marc Laliberte, WatchGuard’s Senior Threat Analyst, contributed reviewed the three major email authentication anti-phishing technology standards: SPF, DKIM, and DMARC. Learn more in part 2 of the series originally posted in Cyber Defense …

Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…