I have created a simple web tool (although the installation is not trivial - sorry for that) for administering domains, users and aliases called ISPwebAdmin. Further interesting projects like this are:
Just a few impressions how the ISPwebAdmin's interface looks like:



Scroll down to the attachments section for the download link.
In addition to the SQL tables as described in the ISPmail tutorial you will need to create an additional table to store usernames and passwords for the administrators that are allowed to manage email accounts. So please run this SQL query to create the table:
CREATE TABLE IF NOT EXISTS `admins` ( `id` int(11) NOT NULL auto_increment, `username` varchar(40) NOT NULL, `pwhash` varchar(32) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Create an admin user here who can login to the web interface. The pwhash field stores an MD5 hash of the password to avoid storing it as plain text.
Example SQL:
INSERT INTO mailserver.admins (username,pwhash) VALUES ('john', MD5('doe'));
Note that you will need to create a MySQL user who has write access to the 'mailserver' database.
As user root:
Become the user vmail:
Prepare the application:
As a quick-and-dirty solution this can be used to run the web application. But to keep the service running in the background and start up automatically when the system boots the daemontools mechanism is recommended:
As user root:
Create a file "/etc/sv/ispwebadmin/run" there containing:
#!/bin/sh exec 2>&1 echo 'ISPwebAdmin starting.' cd /var/vmail/ispwebadmin sudo -u vmail PYTHON_EGG_CACHE=/var/vmail/ispwebadmin/.python-eggs bin/paster serve run.ini
Make this script executable:
Create a symlink to tell runit you want to use this service:
The service should start up automatically. To see if it works:
$> sv status /etc/service/ispwebadmin run: ispwebadmin: (pid 3335) 0s; run: log: (pid 3326) 4s
To stop it:
$> sv stop /etc/service/ispwebadmin ok: down: ispwebadmin: 1s, normally up
To start it:
$> sv start /etc/service/ispwebadmin ok: run: ispwebadmin: (pid 3956) 1s
If you want to get a logfile for this web service you can create a "/etc/sv/ispwebadmin/log/run" file containing:
#!/bin/sh -e LOG=/var/log/runit-ispwebadmin test -d "$LOG" || mkdir -p -m2750 "$LOG" exec svlogd -tt "$LOG"
Then you should get output in the "/var/log/runit-ispwebadmin" file.
The ini file that you created with "paster make-config something.ini" contains settings that are specific to your mail server installation. Before you run the web interface please check these settings:
The IP address the web server listens on. "0.0.0.0" can be used for all interfaces
The TCP port the web server listens on.
The path to your directory where the users' virtual mailboxes are stored. If you followed the Lenny ISPmail tutorial then this will be "/var/vmail".
The email address that is used as an abuse@ and postmaster@ address for newly created domains. You are required to have those accounts for each domain.
This setting is optional.
The access string that defines how to access your database. Example:
mysql://root:seoroct3@mailserver.example.com/mailserver?charset=utf8
| Attachment | Size |
|---|---|
| ispwebadmin-1.0.tar.gz | 21.34 KB |
| ispwebadmin-1.0.1.tar.gz | 21.38 KB |
| ispwebadmin-1.0.2.tar.gz | 21.38 KB |