User Tools

Site Tools


Table of Contents


This guide is more or less a copy of “Mail Server - Suse 9.3” but running on Ubuntu Hardy Heron Server. Luckily Ubuntu has a huge repository contain gazillion pieces of software and almost all I need. Apt is your friend 8-)

The reduce the power consumption of my server I've replace it with a low-power Soekris Net5501 with a 2,5“ harddisk. This move actually took the power consumption from 60W to sweet low 9W - me like :-D

This is what it looks like and what you're hitting right now with your browser:

Starting Out

Start out by flashing the Soekris Net5501 with the latest firmware. Can also be downloaded here.

On how to flash it look here or a local copy here.

The console speed is default 19200/8/1/no flowcontrol. This is somewhat slow so I configured it up to 57600: Boot up the box and enter the BIOS by pressing CTRL-P. Inside the BIOS run:

set ConSpeed=57600
set ConLock=enabled

This put the console speed up to 57600 and locks it from change by applications.

As the Soekris has limited input options I used PXE boot to start the installation of Hardy Heron. Of course this requires an other machine to service a tftp server and a dhcp server. You can find inspiration on how to do that here. For unknown reasons the console display is unusable if you use the pxelinux.0 file that comes with Ubuntu. Therefore use this one instead.

As the console speed is now 57.6Kbps, this needs to be changed in the PXE boot config file. Edit the file /var/lib/tftpboot/ubuntu-installer/i386/pxelinux.cfg.serial-9600/default and change all occurrences of 9600 to 57600 then save in its own directory of /var/lib/tftpboot/ubuntu-installer/i386/pxelinux.cfg.serial-57600/ and remember to change the symlink pxelinux.cfg in /var/lib/tftpboot to point to the new 57600 directory.

And change the symlink:

cd /var/lib/tftpboot
sudo rm pxelinux.cfg
sudo ln -s ubuntu-installer/i386/pxelinux.cfg.serial-57600 pxelinux.cfg

Go through the install like an ordinary Ubuntu server installation except when you get to the partitioning. The boot partition has to be within the first 1023 cylinders otherwise Grub doesn't handle it so well (you'll get an GRUB ERROR 18). I believe it has to do with Grub not being able to reading the boot files. I made the /boot partition around 100MB of size and I was home free.

A small note, when getting to keyboard layout, autodetect doesn't work, just select it manually.

Pick you partition layout. Make /boot within the first 1023 blocks (make it 100MB ex.), hit install and wait as the packages are downloaded from the Internet and installed.

If you want to you can always boot via PXE again by entering the bios and run:

boot f0

When you get to the “Software selection” menu I select “LAMP server” and “OpenSSH server”. You may do otherwise but this gets the needed software in quick.

Now we need to install some additional software and update the current installed ones:

sudo apt-get update
sudo apt-get dist-upgrade 
sudo apt-get install postfix postfix-mysql postfix-pcre  libmysqlclient15-dev libssl-dev build-essential libapache2-mod-perl2 libgd-text-perl libgd-graph-perl libgd-graph3d-perl dovecot-common dovecot-imapd gallery2 phpmyadmin pure-ftpd pure-ftpd-common pure-ftpd-mysql


Next one up is postfix. You need to get correct uid and guid for the user postfix:

# id postfix
uid=200(postfix) gid=200(postfix) groups=200(postfix)

With this info at hand you can copy this file and replace the corresponding postfix uid/guid with your values.

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination =,, localhost
myhostname =
mynetworks = [::ffff:]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = 
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = 
        check_client_access hash:/etc/postfix/okay_senders
	check_client_access hash:/etc/postfix/blocked_senders

smtpd_data_restrictions = 
smtpd_helo_required = yes
smtpd_recipient_restrictions = 
        check_recipient_access hash:/etc/postfix/protect_ham_spam_accounts
        check_recipient_access hash:/etc/postfix/roleaccount_exceptions
smtpd_restriction_classes = 
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = proxy:mysql:/etc/postfix/
virtual_gid_maps = static:200
virtual_mailbox_base = /usr/local/virtual
virtual_mailbox_domains = proxy:mysql:/etc/postfix/
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = proxy:mysql:/etc/postfix/
virtual_minimum_uid = 200
virtual_transport = virtual
virtual_uid_maps = static:200


For this install I chose to use dovecot instead of couirer-imapd. And it turned out to be a good choice with easy integration for Postfix SASL.

More to come….

indexes/mailserverhardy.txt · Last modified: d/m/Y H:i by domingo