1

Topic: missing data

==== Required information ====
- iRedMail version: iRedAdmin-Pro-MySQL 1.5.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Debian 6
- Related log if you're reporting an issue:
====

I tried out the standard admin and it seemed ok so I upgraded to pro. When I click on things like white lists it throws an internal error. I have attached the relevant log file from apache. The problem is that first the postfix-policyd user didn't exist and now that the database doesn't. I created the user manually with the details in the settings file but I do not know the database structure to create that nore if there is any settings I need to edit in postfix to ensure it uses the table. Any help would be great as I have followed the setup instructions and found nothing on this.

2

Re: missing data

It says you don't have correct SQL username and password in iRedAdmin-Pro config file /usr/share/apache2/iRedAdmin-Pro-MySQL-1.5.1/settings.ini, under section "[policyd]".

[policyd]
# Enable policyd integration: True, False.
enabled = True

# SQL Database used to store policyd data, eg. whitelist, blacklist.
# You can find related information in policyd config files:
#   - On Debian/Ubuntu: /etc/postfix-policyd.conf
# Related parameters:
#   host    -> MYSQLHOST
#   port    -> 3306 (Default)
#   db      -> MYSQLDBASE
#   user    -> MYSQLUSER
#   passwd  -> MYSQLPASS
host = 127.0.0.1
port = 3306
db = policyd
user = policyd
passwd = passwd

Please update settings.ini with correct SQL username and password, then restart Apache web service to reload it and try again.

3

Re: missing data

Hi,

I know what it says but it's not entirely accurate. The reason it's getting denied is because the database doesn't exist. There is no policyd or postfix-policyd database on my server. The only reason the user exists is because I manually created it using the details in that file. I have amavisd, vmail and ireradmin tables but if there is another table that is supposedly called policyd I need the sql to create it.

4

Re: missing data

I hadn't noticed the log got cut off.


[Tue Mar 05 08:07:15 2013] [error] [client 77.247.156.227]   File "/usr/lib/pymodules/python2.6/web/db.py", line 493, in _load_context
[Tue Mar 05 08:07:15 2013] [error] [client 77.247.156.227]     ctx.db = self._connect(self.keywords)
[Tue Mar 05 08:07:15 2013] [error] [client 77.247.156.227]   File "/usr/lib/pymodules/python2.6/web/db.py", line 521, in _connect
[Tue Mar 05 08:07:15 2013] [error] [client 77.247.156.227]     return self.db_module.connect(**keywords)
[Tue Mar 05 08:07:15 2013] [error] [client 77.247.156.227]   File "/usr/lib/pymodules/python2.6/MySQLdb/__init__.py", line 81, in Connect
[Tue Mar 05 08:07:15 2013] [error] [client 77.247.156.227]     return Connection(*args, **kwargs)
[Tue Mar 05 08:07:15 2013] [error] [client 77.247.156.227]   File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 170, in __init__
[Tue Mar 05 08:07:15 2013] [error] [client 77.247.156.227]     super(Connection, self).__init__(*args, **kwargs2)
[Tue Mar 05 08:07:15 2013] [error] [client 77.247.156.227] OperationalError: (1044, "Access denied for user 'postfix-policyd'@'localhost' to database 'postfixpolicyd'")

Anyway all I really want to do is get that table recreated so I can give the user I created permission to it and then check that postfix is using it.

5

Re: missing data

Debian 6 has Policyd available in official apt repository, looks like your iRedMail installation didn't install it for you.
Could you please check whether you have Policyd installed on your server? Or do you have package "cluebringer" installed?

6

Re: missing data

Arh so they're separate packages. That explains why I didn't see anything about them on the wiki. I do apparently have postfix-policyd installed but duebringer does not seem to be in the repo at all.

7

Re: missing data

iRedMail installs Policyd-1.82 on Debian 6 by default, not cluebringer. Not sure why it didn't install it for you. sad

8

Re: missing data

Google found a similar problem on your forum and I attempted to reinstall policyd based upon that and got an error I can work with. It seems policyd uses dbconfig to create a database and myisam tables. Since I use mariadb 5.5 which (I am assuming) doesn't have the myisam engine it threw an error and failed to make the tables. Now I just have to find a way around that.

9

Re: missing data

I managed to find the sql file on policyd's website and installed the tables manually and that stopped the errors. Thanks for pointing me on the right track.

10

Re: missing data

We didn't test iRedMail with MariaDB yet, not sure whether it works with it or not.

11

Re: missing data

ZhangHuangbin wrote:

We didn't test iRedMail with MariaDB yet, not sure whether it works with it or not.

So far it seems to work fine which is not surprising given MariaDb's drop in replacement policy. It was just policyd's insistence on using myisam that caused the problem. Still all fixed now