Manage your email accounts

ISPwebAdmin (web interface)

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:

Screenshots

Just a few impressions how the ISPwebAdmin's interface looks like:

Download

Scroll down to the attachments section for the download link.

Installation instructions

User authentication

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.

Installation on the destination (mail) server

As user root:

  • aptitude install python-virtualenv
  • apt-get build-dep python-mysqldb

Become the user vmail:

  • su -s /bin/bash vmail

Prepare the application:

  • cd /var/vmail
  • mkdir ispwebadmin
  • cd ispwebadmin
  • virtualenv .
  • . bin/activate
  • easy_install ispwebadmin*.tar.gz
  • paster make-config ispwebadmin run.ini (this creates a 'run.ini' file that contains setting that are specific to your installation - see below for settings you need to customize)
  • vi run.ini
  • paster serve run.ini

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:

Starting automatically using runit (Debian Lenny)

As user root:

  • aptitude install runit
  • mkdir /etc/sv/ispwebadmin
  • cd /etc/sv/ispwebadmin

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:

  • chmod u+x /etc/sv/ispwebadmin/run

Create a symlink to tell runit you want to use this service:

  • ln -s /etc/sv/ispwebadmin /etc/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.

INI file settings

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:

[server:main] -> host

The IP address the web server listens on. "0.0.0.0" can be used for all interfaces

[server:main] -> port

The TCP port the web server listens on.

[app:main] -> ispwebadmin.maildir_location

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".

[app:main] -> ispwebadmin.postmaster

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.

[app:main] -> sqlalchemy.url

The access string that defines how to access your database. Example:

mysql://root:seoroct3@mailserver.example.com/mailserver?charset=utf8

49 Comments

beas.sh

I wrote a bash script too. . .

http://manurevah.com/blah/en/scripts/bash-email-admin-script.php

 

manu

PostfixAdmin

http://sourceforge.net/projects/postfixadmin/ works with a very similiar mysql/pgsql database schema to the one described in this howto. But be careful, I would consider PostfixAdmin beta software even if the actual version is 2.3rc7.

Postfixadmin isn't very customizable

Thanks for the link. However PostfixAdmin doesn't appear to help really. They dictate a certain database layout which doesn't match mine. (Yes, if I had considered PostfixAdmin earlier in the process, then I had considered using theirs.) In previous versions they allowed you to customize all the SQL queries which made it very usable. The current version however has all the SQL queries hardcoded and distributed throughout the PHP pages.

  Christoph

Some db conversion magic?

After having taken a short look at postfixadmin, I'd say it's the way to go. You surely don't want to develop and maintain your own management frontend. Postfixadmin is under active development, and seems to do pretty good for that purpose. Of course the db scheme has to match the frontend, and there surely is an easy way to convert yours. I don't really care about the db layout, and since I am just setting up my mailserver, I intend to simply follow your tutorial, but use the db as setup by postfixadmin.

Just gave up on postfixadmin

Ok, I have to admit, that at first sight postfixadmin looked really good, but having played around a bit, I came to the conclusion not to use it. The actual version 2.3rc7 is at beta stage at best, nobody seems to know, how to use the fetchmail feature (since it is not documented & user-contributed), the autoresponder-feature seems to be outdated (they use a perl-script and overly complicated transport setup, whereas nowadays this seems to be a lot easier with some sieve-magic), and the overall setup does not quite match Christoph's plain & simple tutorial (especially the database setup seems clumsy).

So for now Emmanuel Revah's bash script will have to do, and I am really curious, what Christoph will come up with.

Yes, likely

I was held back by two major problems in an open-source project I run. But as I need a web interface myself I intend to get one done until the weekend. Unless something else goes terribly wrong again and shuffles my todo list around. :)

Basically it shouldn't be hard to do something quickly and dirtily in PHP. I'll prepare a Python app though.

 Christoph

ISPwebAdmin

Hi,
I am sorry but as mutch as I like your tutorial - and I am with you for quiet some time - I really think your web admin tool is a messy hack. I don't mean the coding but I think for your 'keep it simple' style you have to go to too much trouble to install it.
The second problem is that you assume - as many other mail-web-admin gui programmers too - everyone wants to have a web server on the mail mashine. But for security reasons you never should mix these two fragile services.

So, what about rethinking your frontend. I am really sorry for saying this with such harsh words. I was really looking forward for your gui so I wouldn't need to use postfixadmin, which in fact is quiet ok if you are not using all the extra fancy stuff like fetchmail (I don't talk about the codeing style).
I rather like to use a more simple and clean program.



 

Well...

I understand that deploying a Pylons/Python application is more work than just copying PHP files somewhere on a server. But I need the tool for myself mainly with certain additions (accounting, etc.) so this is the "light" version of it. So it may appear like overkill but it's not uncommon to deploy web applications like this (Rails, Tomcat, Pylons, whatever).

Btw, you are not forced to run the web interface on the actual mail server. It can run anywhere that you have database access. But you won't be able to change a user's email address later because that requires renaming the mail directory on disk. I could make this part optional if it's a problem.

Postfixadmin isn't really an alternative for me. The SQL statements are hardcoded into the code so it can't be properly customized. Earlier version handled that way better.

If you have different needs then it's probably not too hard to create something in PHP or Perl CGIs or whatever your favorite programming language is. Please understand that I usually don't create software that I don't need and use myself - unless someone pays me to do it. Sorry that you are disappointed. Perhaps someone else comes up with a PHP version that's easier to deploy.

simple web interface

I have been developing a simple web interface that can work with both the etch and lenny version of the tutorial, however this does require some changes to the database setup (actually you'd need to backup/drop/insert_new_db/restore), but it's not that hard. However I'm still in beta stage, but I'm nearly there. If someone would like to beta test this contact me via the mailing list or my website http://manurevah.com manu

mailboy

Hallo, Mailboy has been successfully tested on a few different servers, apparently the default style is a bit dark but a second cleaner style is delivered with the package. A few changes are required for this to work because of database structure changes (looks more like the Etch version) and some added Amavis per user stuff. It has the whole "domain admin" concept, actually a user can be admin for 1 or more domains and not necessarily the domain to which the user is attached.. Anyway, if you wish to stick with the exact Workaround setup please prefer the GRSsoft interface, I have used it in the past and it works swell, and I'm sure upgrading to squeeze tutorial might be easier. However if you want the extra options and you feel brave (void warranty :] ): http://manurevah.com/blah/pages/mailboy/ manu

great howto

Thank you for that great tutorial all works perfectly! But how can i reach the ispwebmail? I tried http://IP_ADRESS/mailserver?charset=utf8 but i get a 404 Error.

Depends

Depends on what you configured in your INI file (e.g. "run.ini"). By default it will listen on port 5000.

The ?charset=utf8 is the URL to reach the MySQL database. That's something different. :)

hmm

seems doesn't work...

Error - <class 'sqlalchemy.exc.OperationalError'>: (OperationalError) (2003, "Can't connect to MySQL server on '192.168.2.222' (111)") None None

the user and the password i configured in run.ini is correct..

--

right,

Trying 192.168.2.222...
telnet: Unable to connect to remote host: Connection refused

you have an idea why i can't reach the mysql server? i wonder because postfix/dovecot works, it can reach the server..

Changing table names

Hi,

I had changed the table names (which was no problem while configuring postfix and dovecot) and now the ispwebadmin tool doesn't work. I had already changed the file model/__init__.py but it doesn't work. What must I do to change the table names in the ispwebadmin tool?

Greets

Christoph

The same as if I had not

The same as if I had not changed the table names

ProgrammingError: (ProgrammingError) (1146, "Table 'system.admins' doesn't exist") u'SELECT admins.id AS admins_id, admins.username AS admins_username, admins.pwhash AS admins_pwhash \nFROM admins \nWHERE admins.username = %s \n LIMIT 0, 1' ['friedrich@dragon-net.de']

Do I have to compile the py script? If yes - how can I compile it?

Is there a tabe

Is there a tabe system.admins?

No, there is no need to compile anything. But if you want to change the source I suggest you run "python setup.py sdist" and "easy_install" the new tarball from the dist/ directory.

Please mail me directly or use the workaround-chitchat mailing list so I/we can have a look at your model/__init__.py if you like.

error

Hi, great Howto!

when i start ispwebadmin i get this:
sv start /etc/service/ispwebadmin
timeout: down: /etc/service/ispwebadmin: 1s, normally up, want up

/var/log/runit-ispwebadmin/current:

2009-11-18_09:20:59.84276 sh: PYTHON_EGG_CACHE=/var/vmail/ispwebadmin/.python-eggs: Datei oder Verzeichnis nicht gefunden (=File or Directory not found)
2009-11-18_09:21:00.86811 ISPwebAdmin starting.

some ideas? thank you!!
 

Please check that

Please check that /var/vmail/ispwebadmin/ exists and belongs to the vmail user.

If you accidentally started the application as root then the directory was created with the wrong owner and the "vmail" process running ISPWebAdmin doesn't have permissions to store its "eggs" there.

I strongly recommend to use this mailmanager

With due respect to the author of this howto, which is excellent in many respects, his ISPwebAdmin is a bit of a dog which installs far too many bits and pieces to be elegant. In addition, the user-interface is not intuitive for the un-initiated. And the whole thing seems to be a bit of an afterthought.

 

I strongly STRONGLY recommend using the GrSoft MailManager instead

Agreed

The GRSoft mail manager is excellent.  It allows you to have a domain admainistrator for each domain who can only edit mail accounts on that domain.

I've used it for several years and I'm glad to see an updated version!

Oops

I'm so sorry. That's what you get for running around as site admin all the time. :)

I have now fixed the permissions so that everybody can see the file. Sorry for doubting.

Nevermind

That's okay. That's happening to me, too, every now and then. I know well what you can break as an admin. By the way, I tried to send you an email but something went wrong.

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of
its recipients. The following addresses failed:

  <email@christoph-haas.de>

domain name system error:
host mx.christoph-haas.de:

mail exchanger has no ip addresses

Error after running the service

Hello,

After running the service, when I try to access the web page I get a Server Error 500 (An internal server error occured)

And the followring python exception (in the command line):

Starting server in PID 7532.
serving on http://192.168.1.11:5000
Error - <type 'exceptions.TypeError'>: Sorry, your collection type is not supported by the paginate module. You can either provide a list, a tuple, an SQLAlchemy 0.4 select object or an SQLAlchemy 0.4 ORM-query object.
URL: http://192.168.1.11:5000/
[...]
File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/WebHelpers-0.6.4-py2.5.egg/webhelpers/paginate.py', line 163 in get_wrapper
  raise TypeError("Sorry, your collection type is not supported by the paginate module. "
TypeError: Sorry, your collection type is not supported by the paginate module. You can either provide a list, a tuple, an SQLAlchemy 0.4 select object or an SQLAlchemy 0.4 ORM-query object.


CGI Variables
-------------
  CONTENT_LENGTH: '0'
  HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
  HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
  HTTP_ACCEPT_ENCODING: 'gzip,deflate'
  HTTP_ACCEPT_LANGUAGE: 'en-us,en;q=0.5'
  HTTP_CACHE_CONTROL: 'max-age=0'
  HTTP_CONNECTION: 'keep-alive'
  HTTP_COOKIE: 'ispwebadmin=ab463a09619af59bd86b3a9e4172b84f887e81684c375f7cfd15470c75527bb11b68e9c8'
  HTTP_HOST: '192.168.1.11:5000'
  HTTP_KEEP_ALIVE: '115'
  HTTP_USER_AGENT: 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6'
  PATH_INFO: '/'
  REMOTE_ADDR: '192.168.1.2'
  REQUEST_METHOD: 'GET'
  SERVER_NAME: '192.168.1.11'
  SERVER_PORT: '5000'
  SERVER_PROTOCOL: 'HTTP/1.1'


WSGI Variables
--------------
  application: <beaker.middleware.CacheMiddleware object at 0x9e1e08c>
  beaker.cache: <beaker.cache.CacheManager object at 0x9e1e0ac>
  beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x9e1e06c>>
  beaker.session: {'admin': u'diavol', '_accessed_time': 1265508439.5068059, '_creation_time': 1265507240.1708109}
  paste.httpserver.thread_pool: <paste.httpserver.ThreadPool object at 0x946b76c>
  paste.registry: <paste.registry.Registry object at 0x9e1edac>
  paste.throw_errors: True
  pylons.action_method: <bound method DomainsController.index of <ispwebadmin.controllers.domains.DomainsController object at 0x9e265ac>>
  pylons.controller: <ispwebadmin.controllers.domains.DomainsController object at 0x9e265ac>
  pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
  pylons.pylons: <pylons.util.PylonsContext object at 0x9e2388c>
  pylons.routes_dict: {'action': u'index', 'controller': u'domains'}
  routes.route: <routes.route.Route object at 0x9d6050c>
  routes.url: <routes.util.URLGenerator object at 0x9e238ec>
  webob._parsed_query_vars: (MultiDict([]), '')
  webob.adhoc_attrs: {'language': 'en-us'}
  wsgi process: 'Multithreaded'
  wsgiorg.routing_args: (<routes.util.URLGenerator object at 0x9e238ec>, {'action': u'index', 'controller': u'domains'})
------------------------------------------------------------

            <p>Additionally an error occurred while sending the &lt;weberror.reporter.EmailReporter object at 0x9e393ec&gt; report:

            <pre>Traceback (most recent call last):
  File "/var/vmail/ispwebadmin/lib/python2.5/site-packages/WebError-0.10.1-py2.5.egg/weberror/errormiddleware.py", line 450, in send_report
    rep.report(exc_data)
  File "/var/vmail/ispwebadmin/lib/python2.5/site-packages/WebError-0.10.1-py2.5.egg/weberror/reporter.py", line 54, in report
    self.to_addresses, msg.as_string())
  File "/usr/lib/python2.5/smtplib.py", line 703, in sendmail
    raise SMTPRecipientsRefused(senderrs)
SMTPRecipientsRefused: {'you@yourdomain.com': (554, '5.7.1 <you@yourdomain.com>: Relay access denied')}
</pre>
            </p>
 

Any ideas how to fix it?

Thanks,

CP.

Outdated Webhelpers?

I can only imagine that you are using an older version of "Webhelpers". By coincidence I'm also the author of the "paginate" module within the Webhelpers module and in older versions only SQLAlchemy 0.4 was supported while 0.5 is the current version. Please try "easy_install -U webhelpes" in your virtualenv directory and try again.

  root@xxx:/var/vmail/ispwe

 

root@xxx:/var/vmail/ispwebadmin# easy_install -U webhelpes
Searching for webhelpes
Reading http://pypi.python.org/simple/webhelpes/
Couldn't find index page for 'webhelpes' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for webhelpes
error: Could not find suitable distribution for Requirement.parse('webhelpes')
root@xxx:/var/vmail/ispwebadmin#
 
And now?

Thanks it works.   But

Thanks it works.

 

But the error

2010-02-15 17:22:11,647 INFO  [ispwebadmin.controllers.admin] Admin user roger logged in.

Error - <type 'exceptions.TypeError'>: Sorry, your collection type is not supported by the paginate module. You can eith

 

er provide a list, a tuple, an SQLAlchemy 0.4 select object or an SQLAlchemy 0.4 ORM-query object.
 
are not fixed. :-(

Strange

Does that happen on a fresh database? Could you send me the complete error message? Or perhaps a copy of the database?

The database are from Etch

The database are from Etch tutorial and the server yet is a Ubuntu 9.10

That was the complete error message.

Sorry i can't send your the database because i use they now productive.

Webhelpers 1.0b4?

Yesterday I could finally reproduce your problem. And I got it fixed by updating my WebHelpers package installation. Could you try "easy_install -U webhelpers" again and tell me what the output is that you get? The most recent version is 1.0b4 and this version works here.

ispadmin.py the command line tool

For previous versions you a tool called ispadmin.py which could administer the mail account from the command line. is there any chance we will see this tool again? it was really useful. It basically let configure accounts straight from the shell...

Actually not

The ispadmin.py shell script was pretty buggy and back then readers were requesting a web-based application to administer email accounts. If there is interest then I can consider updating it. Currently my todo list is piled rather high though. So I can't realistically promise anything soon. The tool isn't that hard to understand and change though. Any volunteers with a basic knowledge of Python? Step forward. :)

ISPwebAdmin: Internal Server Error

Hi.  

 

Followed the instruction to install on Lenny (new server).

Started ISPwebAdmin and when I try to connect to port 5000 with a webbrowser I ger:

Internal Server Error

Log shows the following:

 

Starting server in PID 24295.

serving on 0.0.0.0:5000 view at http://127.0.0.1:5000

Error - <type 'exceptions.ImportError'>: cannot import name redirect_to

URL: http://lists.xxxxxxxxx.net.nz:5000/

and further down:
 
File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/WebError-0.10.2-py2.5.egg/weberror/errormiddleware.py', line 162 in __call__
  app_iter = self.application(environ, sr_checker)
File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Beaker-1.5.3-py2.5.egg/beaker/middleware.py', line 73 in __call__
  return self.app(environ, start_response)
File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Beaker-1.5.3-py2.5.egg/beaker/middleware.py', line 152 in __call__
  return self.wrap_app(environ, session_start_response)
File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Routes-1.12-py2.5.egg/routes/middleware.py', line 131 in __call__
  response = self.app(environ, start_response)
File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Pylons-1.0rc1-py2.5.egg/pylons/wsgiapp.py', line 106 in __call__
  controller = self.resolve(environ, start_response)
File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Pylons-1.0rc1-py2.5.egg/pylons/wsgiapp.py', line 239 in resolve
  return self.find_controller(controller)
File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Pylons-1.0rc1-py2.5.egg/pylons/wsgiapp.py', line 267 in find_controller
  __import__(full_module_name)
File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/ispwebadmin-1.0-py2.5.egg/ispwebadmin/controllers/domains.py', line 4 in <module>
  from pylons.controllers.util import abort, redirect_to
ImportError: cannot import name redirect_to
 
Any idea what I should be looking for.
 
Regards
John

Dependy problem - please try 1.0.1

Hi, John...


thanks for the problem report. Apparently Pylons 1.0 was installed automatically but I have built the application for 0.9.7 and not updated it yet. Could you please try the 1.0.1 version I have just uploaded to this page? It should remedy your problem. Please let me know if it helps.

 Christoph

1.0.1

I removed the old stuff and installed 1.0.1.

Now I get a login window fine.  However I cannot login with the admin user I created although I can login fine with this user frrom the comand line with:

mysql -u john -p mailserver

I get the following error:

 

Starting server in PID 1582.

serving on 0.0.0.0:5000 view at http://127.0.0.1:5000

Error - <class 'sqlalchemy.exc.OperationalError'>: (OperationalError) (2003, "Can't connect to MySQL server on 'lists.internetnz.net.nz' (111)") None None

URL: http://lists.internetnz.net.nz:5000/admin/login-submit

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/WebError-0.10.1-py2.5.egg/weberror/errormiddleware.py', line 162 in __call__

  app_iter = self.application(environ, sr_checker)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Beaker-1.4.1-py2.5.egg/beaker/middleware.py', line 73 in __call__

  return self.app(environ, start_response)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Beaker-1.4.1-py2.5.egg/beaker/middleware.py', line 152 in __call__

  return self.wrap_app(environ, session_start_response)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Routes-1.10.3-py2.5.egg/routes/middleware.py', line 130 in __call__

  response = self.app(environ, start_response)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Pylons-0.9.7-py2.5.egg/pylons/wsgiapp.py', line 125 in __call__

  response = self.dispatch(controller, environ, start_response)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Pylons-0.9.7-py2.5.egg/pylons/wsgiapp.py', line 324 in dispatch

  return controller(environ, start_response)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/ispwebadmin-1.0.1-py2.5.egg/ispwebadmin/lib/base.py', line 45 in __call__

  return WSGIController.__call__(self, environ, start_response)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Pylons-0.9.7-py2.5.egg/pylons/controllers/core.py', line 221 in __call__

  response = self._dispatch_call()

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Pylons-0.9.7-py2.5.egg/pylons/controllers/core.py', line 172 in _dispatch_call

  response = self._inspect_call(func)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Pylons-0.9.7-py2.5.egg/pylons/controllers/core.py', line 107 in _inspect_call

  result = self._perform_call(func, args)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/Pylons-0.9.7-py2.5.egg/pylons/controllers/core.py', line 60 in _perform_call

  return func(**args)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/ispwebadmin-1.0.1-py2.5.egg/ispwebadmin/controllers/admin.py', line 34 in login_submit

  admin = db.query(model.Admin).filter_by(username=fields['username']).first()

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/orm/query.py', line 1051 in first

  ret = list(self[0:1])

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/orm/query.py', line 972 in __getitem__

  return list(res)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/orm/query.py', line 1112 in __iter__

  return self._execute_and_instances(context)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/orm/query.py', line 1115 in _execute_and_instances

  result = self.session.execute(querycontext.statement, params=self._params, mapper=self._mapper_zero_or_none())

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/orm/session.py', line 754 in execute

  return self.__connection(engine, close_with_result=True).execute(

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/orm/session.py', line 719 in __connection

  return self.transaction._connection_for_bind(engine)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/orm/session.py', line 329 in _connection_for_bind

  conn = bind.contextual_connect()

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/engine/base.py', line 1229 in contextual_connect

  return self.Connection(self, self.pool.connect(), close_with_result=close_with_result, **kwargs)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/pool.py', line 142 in connect

  return _ConnectionFairy(self).checkout()

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/pool.py', line 304 in __init__

  rec = self._connection_record = pool.get()

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/pool.py', line 161 in get

  return self.do_get()

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/pool.py', line 639 in do_get

  con = self.create_connection()

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/pool.py', line 122 in create_connection

  return _ConnectionRecord(self)

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/pool.py', line 198 in __init__

  self.connection = self.__connect()

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/pool.py', line 261 in __connect

  connection = self.__pool._creator()

File '/var/vmail/ispwebadmin/lib/python2.5/site-packages/SQLAlchemy-0.5.0-py2.5.egg/sqlalchemy/engine/strategies.py', line 80 in connect

  raise exc.DBAPIError.instance(None, None, e)

OperationalError: (OperationalError) (2003, "Can't connect to MySQL server on 'lists.internetnz.net.nz' (111)") None None

 

CGI Variables

-------------

  CONTENT_LENGTH: '-1'

  CONTENT_TYPE: 'application/x-www-form-urlencoded'

  HTTP_ACCEPT: 'application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'

  HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'

  HTTP_ACCEPT_ENCODING: 'gzip,deflate,sdch'

  HTTP_ACCEPT_LANGUAGE: 'en-US,en;q=0.8'

  HTTP_CACHE_CONTROL: 'max-age=0'

  HTTP_CONNECTION: 'keep-alive'

  HTTP_HOST: 'lists.internetnz.net.nz:5000'

  HTTP_ORIGIN: 'http://lists.internetnz.net.nz:5000'

  HTTP_REFERER: 'http://lists.internetnz.net.nz:5000/admin/login'

  HTTP_USER_AGENT: 'Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.344.0 Safari/533.2'

  PATH_INFO: '/admin/login-submit'

  REMOTE_ADDR: '58.28.153.124'

  REQUEST_METHOD: 'POST'

  SERVER_NAME: '0.0.0.0'

  SERVER_PORT: '5000'

  SERVER_PROTOCOL: 'HTTP/1.1'

 

WSGI Variables

--------------

  application: <beaker.middleware.CacheMiddleware object at 0xa75bf4c>

  beaker.cache: <beaker.cache.CacheManager object at 0xa75bf6c>

  beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0xa75bf2c>>

  beaker.session: {'_accessed_time': 1267762119.2896061, '_creation_time': 1267762119.2896061}

  paste.httpserver.thread_pool: <paste.httpserver.ThreadPool object at 0x9dea82c>

  paste.registry: <paste.registry.Registry object at 0xa765a8c>

  paste.throw_errors: True

  pylons.action_method: <bound method AdminController.login_submit of <ispwebadmin.controllers.admin.AdminController object at 0xa76c50c>>

  pylons.controller: <ispwebadmin.controllers.admin.AdminController object at 0xa76c50c>

  pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}

  pylons.pylons: <pylons.util.PylonsContext object at 0xa76882c>

  pylons.routes_dict: {'action': u'login_submit', 'controller': u'admin'}

  routes.route: <routes.route.Route object at 0xa6da30c>

  routes.url: <routes.util.URLGenerator object at 0xa76896c>

  webob._parsed_post_vars: (MultiDict([('username', 'john'), ('password', 'guru-shita'), ('login', 'Login')]), <FakeCGIBody at 0xa7686ec viewing MultiDict([('us...n')])>)

  webob._parsed_query_vars: (MultiDict([]), '')

  webob.adhoc_attrs: {'errors': 'ignore', 'language': 'en-us'}

  wsgi process: 'Multithreaded'

  wsgiorg.routing_args: (<routes.util.URLGenerator object at 0xa76896c>, {'action': u'login_submit', 'controller': u'admin'})

------------------------------------------------------------

 

WSGI Variables

--------------

  application: <beaker.middleware.CacheMiddleware object at 0xa75bf4c>

  beaker.cache: <beaker.cache.CacheManager object at 0xa75bf6c>

  beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0xa75bf2c>>

  beaker.session: {'_accessed_time': 1267762119.2896061, '_creation_time': 1267762119.2896061}

  paste.httpserver.thread_pool: <paste.httpserver.ThreadPool object at 0x9dea82c>

  paste.registry: <paste.registry.Registry object at 0xa765a8c>

  paste.throw_errors: True

  pylons.action_method: <bound method AdminController.login_submit of <ispwebadmin.controllers.admin.AdminController object at 0xa76c50c>>

  pylons.controller: <ispwebadmin.controllers.admin.AdminController object at 0xa76c50c>

  pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}

  pylons.pylons: <pylons.util.PylonsContext object at 0xa76882c>

  pylons.routes_dict: {'action': u'login_submit', 'controller': u'admin'}

  routes.route: <routes.route.Route object at 0xa6da30c>

  routes.url: <routes.util.URLGenerator object at 0xa76896c>

  webob._parsed_post_vars: (MultiDict([('username', 'john'), ('password', 'guru-shita'), ('login', 'Login')]), <FakeCGIBody at 0xa7686ec viewing MultiDict([('us...n')])>)

  webob._parsed_query_vars: (MultiDict([]), '')

  webob.adhoc_attrs: {'errors': 'ignore', 'language': 'en-us'}

  wsgi process: 'Multithreaded'

  wsgiorg.routing_args: (<routes.util.URLGenerator object at 0xa76896c>, {'action': u'login_submit', 'controller': u'admin'})

-------------------------------------------------

Login error

I fixed the login problem by adding the following to my /etc/hosts:

 

127.0.0.1  localhost  localhost.localdomain

127.0.0.0  subdomain.example.com

 

Now login is fine and I can add aliases etc.  Probably not the correct way to do it but it works for now.

Be nice if you had a option where you could see the table of Source Address / Destination address.  ie

john@example.com  -->  john@fubar.com

sue@example.com  --> janey@somewhere .org

etc

Anyway, thanks for the effort and help.

John

Can't connect to MySQL server on 'lists.internetnz.net.nz'

Actually you just didn't tell your MySQL server to listen on the ethernet interface. Likely having to do with the " bind-address" setting. Now you set the hostname for the connection to the MySQL server to 127.0.0.1 which is the address MySQL has been listening on all the time.

I suggest you either fix "bind-address" in your /etc/mysql/my.cnf to make MySQL listen to the non-local address. Or you configure ISPwebAdmin to connect to localhost.