Connecting with SQLGrey

Revision as of 22:08, 28 September 2006 by Deugenin (talk | contribs)

SQLGrey

Download SQLGrey from: http://sqlgrey.sourceforge.net/

Note: This example use SQLite as DB for SQLGrey (you can use MySQL, but SQLite it's so easy)


Before install, you need some packages:

  * perl-Date-Calc (from Red Hat or CentOS CDs)
  * perl-Net-Server (from DAG repository: http://apt.sw.be/redhat/el4/en/i386/RPMS.dag/)
  * perl-IO-Multiplex  (from DAG repository: http://apt.sw.be/redhat/el4/en/i386/RPMS.dag/)
  * perl-DBD-SQLite (from DAG repository: http://apt.sw.be/redhat/el4/en/i386/RPMS.dag/)
  * sqlite (from DAG repository: http://apt.sw.be/redhat/el4/en/i386/RPMS.dag/)


If you have Red Hat 4 or CentOS 4, you can install them using APT:

   rpm -Uvh http://apt.sw.be/redhat/el4/en/i386...el4.rf.i386.rpm
   apt-get update
   apt-get install perl-Net-Server perl-IO-Multiplex perl-DBD-SQLite sqlite -y

Note: before using APT, you must install perl-Date-Calc from Red Hat or CentOS CDs.


Install SQLGrey RPM:

  root# rpm -ivh sqlgrey-x.x.x-x.noarch.rpm


Configure SQLGrey: /etc/sqlgrey/sqlgrey.conf

  conf_dir = /etc/sqlgrey
  user = sqlgrey
  group = sqlgrey
  inet = 2501
  confdir = /etc/sqlgrey
  db_type = SQLite
  db_name = sqlgrey


Start SQLGrey:

  root# service sqlgrey start
  root# chkconfig sqlgrey on


Connecting SQLGrey with Zimbra Postfix

As the zimbra user, update zimbraMtaRestriction. I've added all the other restrictions that Zimbra suggests to add as well, including several Realtime Blackhole Lists (RBL). The important one is at the end. For 3.x Zimbra versions:

   root# su - zimbra
   zimbra$ zmprov mcf +zimbraMtaRestriction "check_policy_service inet:127.0.0.1:2501"

If you're using the lastest (4.x) Zimbra version:

   root# su - zimbra
   zimbra$ zmprov -l
   prov> mcf +zimbraMtaRestriction "check_policy_service inet:127.0.0.1:2501"
   prov> quit


Edit /opt/zimbra/conf/postfix_recipient_restrictions.cf

  ...
  reject_unauth_destination
  %%contains VAR:zimbraMtaRestriction check_policy_service inet:127.0.0.1:2501%%
  permit


Now restart zimbra, and it should all just work!

  root# su - zimbra
  zimbra$ zmcontrol stop
  zimbra$ zmcontrol start


Good luck, and enjoy.


--
Daniel Eugenin M.
IT Linux Ltda.

Jump to: navigation, search