1 (edited by ag 2012-12-10 16:45:33)

Topic: No postfix-policyd in MySQL

==== Required information ====
- iRedMail version: 0.8.3
- 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:
====

Hello,
I have a problem with a postfix-policyd. I get cron errors about problem with postfix-policyd nr 255, i check the MySQL and find out that i don't have postfixpolicyd or postfix-policyd base.

Could you give me the sql file for the structure of the postfix-policyd base and some info what else should be configured?

I've had found a topic about similar problem, but the links for the file with sql structure is no longer available. As far I know at some point there was a problem with creating this base on 0.8.3 and probably i've downloaded installation pack just before you fix it.

Best regards,
AG

2

Re: No postfix-policyd in MySQL

ag wrote:

- Linux/BSD distribution name and version: Debian 8

Sorry, do you really mean "Debian 8"?
iRedMail supports Debian 6 (squeeze) and 7 (wheezy), but not 8.

3

Re: No postfix-policyd in MySQL

I meant "Debian 6", sorry.

4

Re: No postfix-policyd in MySQL

Did you follow our iRedMail installation tutorial STRICTLY?
http://www.iredmail.org/install_iredmail_on_debian.html

5

Re: No postfix-policyd in MySQL

Yes, the iredmail works. Users can send and receive e-mails but i want to fix this error.
Could you please help?

6

Re: No postfix-policyd in MySQL

Debian 6 ships postfix-policyd: http://packages.debian.org/squeeze/postfix-policyd

Could you please show me output of below command:

# postconf smtpd_recipient_restrictions
# dpkg -l |grep -i policyd

iRedMail enables policyd by default, if you can send/receive emails without problem, then it should be working.

7

Re: No postfix-policyd in MySQL

postconf smtpd_recipient_restrictions:

smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unlisted_recipient, check_policy_service inet:127.0.0.1:7777, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_policy_service inet:127.0.0.1:10031

dpkg -l |grep -i policyd:

ii  postfix-policyd                     1.82-2+b1                    anti-spam plugin for Postfix

8

Re: No postfix-policyd in MySQL

Obviously, it's installed. It shows 'ii' flag in output of "dpkg" command.

9

Re: No postfix-policyd in MySQL

Offcourse it's installed. I never said it isn't. I just don't have a database.

Could you please answer my question? How to create database in MySQL for postfix-policyd and what files i have to edit and change to make it work properly.

10

Re: No postfix-policyd in MySQL

You have Policyd enabled in Postfix (smtpd_recipient_restrictions = ..., check_policy_service inet:127.0.0.1:10031), if there's no policyd database, you cannot receive emails.

Could you please show me output of below SQL commands:

# mysql -uroot -p
mysql> SHOW DATABASES;

11 (edited by ag 2012-12-12 20:37:33)

Re: No postfix-policyd in MySQL

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| amavisd            |
| iredadmin          |
| mysql              |
| roundcubemail      |
+--------------------+

12

Re: No postfix-policyd in MySQL

That's strange. Debian package 'postfix-policyd' will initial SQL database automatically, iRedMail doesn't do it.

Anyway, you can find SQL template file under /usr/share/dbconfig-common/data/postfix-policyd/, or download the latest one (version 1.82, not 2.x) here: http://www.policyd.org/content/download then extract the SQL template file.

13

Re: No postfix-policyd in MySQL

Ok, I will try.

This are the errors with can be involve with my problem:

Cron <root@xxx> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) (failed)
run-parts: /etc/cron.daily/postfix-policyd exited with return code 255

/var/log/mail.warn

Dec 12 12:32:54 prosat postfix-policyd: mysql_real_connect(): Access denied for user 'postfix-policyd'@'localhost' (using password: YES)

14

Re: No postfix-policyd in MySQL

Hmm i just get in my logwatch mail, something like that:

 --------------------- fail2ban-messages Begin ------------------------ 

 
 Banned services with Fail2Ban:                 Bans:Unbans
    postfix-iredmail:                                       [  1:1  ]
 
 ---------------------- fail2ban-messages End ------------------------- 

Why it's getting ban?

15

Re: No postfix-policyd in MySQL

Please refer to Fail2ban web site for more details about what it is: http://www.fail2ban.org/

16

Re: No postfix-policyd in MySQL

Yes, be default postfix-policyd won't work on debian.
Since the installer script doesn't provide sql root password when debian asks for it.

Easy fix for it will be just to reinstall it.

So you can safely run:

aptitude purge postfix-policyd
aptitude install postfix-policyd

if you getting


postfix-policyd: fatal: didn't find priority 'LOG_IFOO', exiting

update /etc/postfix-policyd.conf

SYSLOG_FACILITY="LOG_MAIL|LOG_INFO"

Hope that will help smile