Any business on a tight budget in need of a mail server should go with Postfix. It's one of the most reliable mail servers available, and it's incredibly simple to set up and manage. And yet, there is still a need for a graphical tool for server management. After all, most administrators don't have time to use a command line tool to manage their email servers (especially when there are hundreds of users).
One new tool that might help make your job easier is VBoxAdm, which is very much in Alpha release, so it's not guaranteed to work or install. VBoxAdm has been heavily influenced by already established tools (such as Postfix.Admin), and even in its early stages the GUI has a number of solid features, which include:
- Comprehensive Mailserver solution
- Written in modern Perl
- Written with security and maintainability in mind
- No unencrypted passwords
- HTML5, jQuery, jQuery UI, Datatables
- Roundcube Integration
- Custom Content-Filter (SMTP-Proxy)
- Command Line Interface
When you add these features to the ability to manage nearly all aspects of Postfix and Dovecot, you have a real winner on your hands.
Now I'll describe the process of installing this new Postfix GUI on a Debian-based machine. It took me a number of attempts, but I finally got it up and running. Despite the fact that the functionality was iffy, it's clear this tool has a very bright future.Note: The machine to house VBoxAdm will already have a running installation of Postfix, Dovecot, and cgi working on Apache. This installation will require the use of the aptitude package manager, as well as a working MySQL installation. I do not explain the installation and configuration processes of Apache, Dovecot, or MySQL.
The initial installation is quite simple. Follow these steps:
- Open a terminal window.
- Add the necessary repository with the command: sudo echo "deb http://packages.gauner.org/ squeeze main contrib non-free" >> /etc/apt/sources.list.
- Download the necessary key for the repository with the command: gpg —keyserver x-hkp://gpg-keyserver.de —recv-key D31FA054C85AEFAC.
- Add the gpg key with the command: sudo gpg —export D31FA054C85AEFAC | apt-key add -.
- Update Aptitude with the command: sudo aptitude update.
- Install VBoxAdm with the command: sudo aptitude install vboxadm.
It is also necessary to install the Silk icon pack. Follow these steps:
- Download the Silk icon pack from the Famfamfam website.
- Create the directory /usr/share/icons/famfamfam/silk.
- Unzip the Silk icons zip file. This will create a new directory called icons.
- Move all of the files from the newly created icons directory into /user/share/icons/famfamfam/silk/.
The next step is required for the use of the vacation reminder and the SMTP-Proxy scripts. Both of these features require the vboxadm user, which must be created with the command:
sudo adduser —system —home /var/lib/vboxadm —no-create-home —group —disabled-password —disabled-login vboxadm.
Follow these steps to create a user whose sole purpose is to hold incoming mail:
- Open a terminal window.
- Issue the command: sudo mkdir -p /var/www/vmail/.
- Add the user with the command: sudo adduser —system —home /var/www/vmail —no-create-home —group —disabled-password —disabled-login vmail.
- Change the ownership of the newly created directory with the command: sudo chown -R vmail:vmail /var/www/vmail/.
Now you need to create a couple of databases. I prefer to use MySQL Workbench to create all of my databases, but if you prefer the command line, follow these steps:
- Open a terminal window.
- Gain access to the MySQL command prompt with the command: mysql -u root -p <MYSQL_ROOT_PW> (where MYSQL_ROOT_PW is the password of the MySQL admin user).
- Create the vboxadm database with the command: CREATE DATABASE vboxadm;.
- Create the Roundcube database with the command: CREATE DATABASE roundcube;.
- Exit out of the MySQL prompt with the command: quit.
- Initialize the database with the command: mysql -uroot -p<PASSWORD> vboxadm < /usr/share/doc/vboxadm-common/examples/mysql/schema.sql (where PASSWORD is the actual password).
Next, you need to create the database accounts with the following commands:
- Access the MySQL prompt with the command: mysql -u root -p <MYSQL_ROOT_PW> (where MYSQL_ROOT_PW is the actual password of the MySQL admin user).
- Issue the command: GRANT ALL ON vboxadm.* TO 'vboxadm'@'localhost' IDENTIFIED BY '<PASSWORD>';.
- Issue the command: mysql> GRANT SELECT ON vboxadm.* TO 'postfix'@'localhost' IDENTIFIED BY '<PASSWORD>';.
- Issue the command: mysql> GRANT SELECT ON vboxadm.mailboxes TO 'dovecot'@'localhost' IDENTIFIED BY '<PASSWORD>';.
- Issue the command: mysql> GRANT SELECT ON vboxadm.domains TO 'dovecot'@'localhost' IDENTIFIED BY '<PASSWORD>';.
- Issue the command: mysql> GRANT ALL ON roundcube.* TO 'roundcube'@'localhost' IDENTIFIED BY '<PASSWORD>';.
- Issue the command: mysql> GRANT SELECT,UPDATE ON vboxadm.mailboxes TO 'vboxadm_user'@'localhost' IDENTIFIED BY '<PASSWORD>';.
- Issue the command: GRANT SELECT ON vboxadm.domains TO 'vboxadm_user'@'localhost' IDENTIFIED BY '<PASSWORD>';.
- Issue the command: FLUSH PRIVILEGES;.
In the above commands where <PASSWORD> is used, it will be necessary to use the passwords used when creating those users. In the Debian installation, both the Dovecot and Postfix users will be created upon install of those softwares.
- Copy all files and subdirectories from /usr/share/doc/vboxadm-common/examples/postfix to /etc/postfix.
- Go to /etc/postfix/maps/ and edit each of the virtual_*.cf files, changing the password for the MySQL postfix user.
- Change to the /etc/postfix directory and build the database maps with the command: sudo make maps.
- Install postgrey and policyd-weight with the command: sudo aptitude install postgrey policyd-weight.
- Change the port in /etc/default/postgrey/ to 60000 and restart with the command: sudo /etc/init.d/postgrey restart.
- Open the file /etc/postfix/main.cf and change the virtual_minimum_uid, virtual_uid_maps, and virtual_gid_maps variables to the uid and gid of the user vmail.
- Copy all files and subdirectories from /usr/share/doc/vboxadm-common/examples/dovecot to /etc/dovecot.
- Open the file /etc/dovecot/dovecot-sql.conf and change the admin password to the one set for MySQL.
- Open the file /etc/dovecot/dovecot.conf and change the variables first_valid_uid and first_valid_gid to reflect the uid and gid of the user vmail.
- Open the /etc/vboxadm/vboxadm.conf file and insert the following below the [Default] section:
In this same file, there will be a section for the web-based front-end that looks like:
The Base url should give you an indication as to where your login will occur.
Creating the site admin user
In order to create the site wide administrator, issue the command: sudo bin/vboxadm.pl mailbox add email@example.com —bootstrap -a 1 -siteadmin=1 (where firstname.lastname@example.org is the email address of the administrative user).
You are ready to give VBoxAdm a go. Remember, this software is very much in the Alpha stages, and therefore might not work for you. The developer is hard at work at solidifying the code/features, as well as creating better documentation for the installation and usage of the tool.
When VBoxAdm is finally production ready, I believe it will be just the ticket for Postfix administrators. Until then, however, you might want to work with this tool on a non-production level machine.
Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.