Quick and Dirty: Set up a Zimbra Email Server

This guide focuses on setting up an email server ideal for home or small business use. Setup is extremely quick and very low cost.

What I mean by "Quick and Dirty" is that in most cases the default settings will be used. Completing each step in this guide should get you a fully function server in a few hours (depending on hardware and download speeds. Sometimes defaults maybe not optimal or most secure, but the system will be running in the end.

Zimbra offers a full featured email solution that does not require a super-powered server. (if a low amount of users are accessing it) I have been successfully using the latest version on my home server (only 2 users) configured on a VM with 768MB RAM and 1 AMD Athlon64 3000+ processor. Although it takes a while for all the services to start at boot, I  haven't had any performance issues while using the system. I chose the Zimbra system because of its ease of setup and powerful features.

Here are the materials I used for this setup:
  • 768MB RAM (1GB or higher recommended)
  • Athlon64 3000+ (32 bit can be used, but is being phased out)
  • Comcast internet connection with DHCP IP address
  • Postini Anti-Spam service used as smarthost and general spam protection, This is necessary for a server with a non-static WAN IP address.
  • CentOS 5.5 x64
** This guide will not be covering configuring Postini or MX records.**
    Install and Configure CentOS 5.5
    CentOS 5.5 can be downloaded at www.centos.org. Burn the ISO or point your virtual machine to it. Only CD 1 will be needed.
    Follow the installer directions. When the Network devices screen appears, make sure to change the network device to static IP.


    - Disable IPv6 if not being used on your network.

    - Set "Hostname" to manually and configure the FQDN that your server will be using. (e.g. mail.somename.com) The hostname is checked when setting up Zimbra, and it's easiest to configure it at this screen, so make sure it's correct if possible.

    - Configure the Gateway and DNS as apporpriate for your network.

    Click next, and assign the timezone and root password as needed on the next screens.

    When the software selection screen is reached, make sure that all desktop options are unchecked, and the "Customize now" button is selected.

    Remove Gnome and choose customize so that only Disc 1 is needed.

    At the next screen, go through all the categories on the left, and uncheck everything EXCEPT "Base" in the "Base System" category.

    The only box that should be checked is "Base"

    Once configured, click "Next" and proceed with installing the system.
    All additional needed software will be installed via yum and wget once the installation completes.

    When the install finishes and the server finishes booting the first time, the setup wizard will appear. Since this server will be behind a physical firewall on a trusted network, I will be disabling the software firewall and SELinux options. 

    Disable firewall and SELinux

    Use the above settings while installing. SELinux is not advised. Firewall settings can be tested and configured after the installation if desired.
    Once configured, select OK.

    "Sendmail" should be disabled, as Zimbra uses it's own integrated MTA.
    - Select "System Services"
    - Scroll down the list until "sendmail" is displayed and uncheck it with the spacebar.

    Disable sendmail

    After configuring, press "OK" and then "QUIT", and then reboot the computer. 
    # reboot
    After rebooting, make sure the date and time is correct.
    # date
    If not correct, use:
    # date MMDDhhmmYYYY
    Example: "date 102015302010" will change the date and time to Oct. 20th, 3:30pm, 2010. It is recommended to sync time with an NTP server, covered elsewhere.

    When the date is correct, update the system:
    # yum update -y
    This will install all security updates and update the kernel, which will require a reboot when finished.
    After the reboot, Zimbra its prerequisites can be downloaded and installed.

    Installing Zimbra
     Zimbra requires a few packages (sysstat and gmp) that aren't included with the basic CentOS install.
    # yum install sysstat gmp -y
    Now the hosts file needs to be changed because we are using a static IP with a smart host.
    Edit /etc/hosts and change the IP address on the last line to the LAN IP of the server. It should look something like this:

    Reconfigure /etc/hosts

    The IP address above was initially the public WAN IP of the router.

    The Zimbra software package can be downloaded here: http://www.zimbra.com/downloads/os-downloads.html 
    Locate the latest release for Red Hat Enterprise Linux 5. Right click the link for the appropriate architecture and copy the link location.
    The easiest way is usually to SSH to the server and then use wget to download the package. Example:
    wget http://files2.zimbra.com/downloads/6.0.10_GA/zcs-6.0.10_GA_2692.RHEL5_64.20101215170845.tgz
    When the download is complete, unpack it:
    # tar xvzf zcs-* (tab)
    Change to the newly created directory and run the install script:
    # ./install.sh --platform-override
    The first portion of the install is self explanatory. Accept the license agreement and install all the default components.
    Be sure to read the output, some of the defaults will exit the installer if not changed. (License agreement, Platform override, and modifying the system)

    At one point during the install the following error will appear:
    DNS ERROR resolving MX for mail.somename.com
    It is suggested that the domain name have an MX record configured in DNS
    Change domain name? [Yes]
    If you are using a smarthost with a dynamic IP, than type "No".

    The following configuration screen will appear when the files are finished copying:

    Zimbra installer config screen

    For this guide, everything will be left at default, however the admin password needs to be changed.
    - Press "3" and then enter
    - Press "4" and then enter
    - Enter the desired admin password and press enter
    - Press "r" and then enter
    - Press "a" and then enter
    Accept the default entries and then type "y" when asked to modify the system.
    After the applying the settings and starting services, the installer will exit and the system should be ready for login.

    Configuring Zimbra

    Log into the admin page at https://YourIPAddress:7071
    The username will be "admin" and the password will be what was specified earlier. 
    First, create a new account.
    - In the categories on the left panel, click "Accounts," directly under "Addresses."
    - Click "New" and then enter the desired info. 

    Smarthost and open relay now needs to be configured.
    - Click the "Servers" category on the left panel.
    - Select your server under the "host name" category in the middle and then click the "edit" button towards the top.
    - Click the "MTA" tab

    Zimbra web config screen

    - Verify the host name is correct in the first field
    - Enter your smarthost address in the second port. This will be something like outbounds#.obsmtp.com for Postini spam filtering.
    - Enter the trusted smarthost network in the "MTA Trusted Networks" field. For Postini, this will be: 74.125.148.0/22
    - Save changes and exit the admin console
    - Uncheck the "DNS Lookups" box

    That should be it. The system should now be able to send and receive mail to the smarthost/spam filter, providing the MX records and smarthost are configured correctly.

      No comments:

      Post a Comment