Help with pgsql dataset for SigningTable and KeyTable

From: Naresh V <nareshov_at_gmail.com>
Date: Mon, 28 Jun 2010 18:03:02 +0530

Hi all,

I want to use pgsql datasets so I compiled opendkim-2.1.1 with --with-odbx


(and the following packages:
[root_at_staging opendkim-2.1.1]# rpm -qa | egrep '(pg|postgre)sql'
postgresql-server-8.3.7-1PGDG.rhel5
postgresql-contrib-8.3.7-1PGDG.rhel5
postgresql-8.3.7-1PGDG.rhel5
compat-postgresql-libs-4-1PGDG.rhel5
opendbx-pgsql-1.4.5-45.2
postgresql-slony1-engine-1.2.16-2
compat-postgresql-libs-4-1PGDG.rhel5
postgresql-libs-8.3.7-1PGDG.rhel5
postfix-2.7.0-1.pcre.pgsql.sasl2.rhel5
opendbx-pgsql-1.4.5-45.2 )


I have in my opendkim.conf:


[root_at_staging opendkim-2.1.1]# egrep -v '(^#|^ )' /etc/opendkim.conf
| perl -ne 'if ( $_ =~ /^\s+/ ) { next } else { print $_ } ';
Canonicalization relaxed/relaxed
InternalHosts /opt/opendkim/db/internal_hosts
KeyTable
pgsql://opendkim_at_localhost/odkim/table=keytable?keycol=keyname?datacol=dvalue,svalue,privatekey
LogWhy yes
MilterDebug 1
SigningTable
pgsql://opendkim_at_localhost/odkim/table=signingtable?keycol=fromheader?datacol=keyname
Socket inet:8891_at_localhost
Syslog Yes
UserID opendkim


And the tables are as follows:


[root_at_staging opendkim-2.1.1]# psql -Uopendkim odkim
odkim=> \dt
            List of relations
 Schema | Name | Type | Owner
--------+--------------+-------+----------
 public | keytable | table | opendkim
 public | signingtable | table | opendkim
(2 rows)

odkim=> \d keytable
                           Table "public.keytable"
   Column | Type | Modifiers
------------+---------+-------------------------------------------------------
 id | integer | not null default nextval('keytable_id_seq'::regclass)
 keyname | text | not null
 dvalue | text | not null
 svalue | text | not null
 privatekey | text | not null
Indexes:
    "keytable_pkey" PRIMARY KEY, btree (id)
    "keytable_keyname_key" UNIQUE, btree (keyname)

odkim=> \d signingtable
                           Table "public.signingtable"
   Column | Type | Modifiers
------------+---------+-----------------------------------------------------------
 id | integer | not null default
nextval('signingtable_id_seq'::regclass)
 fromheader | text | not null
 keyname | text | not null
Indexes:
    "signingtable_pkey" PRIMARY KEY, btree (id)
    "signingtable_fromheader_key" UNIQUE, btree (fromheader)

odkim=> SELECT * from keytable;
 id | keyname | dvalue | svalue | privatekey
----+---------+-------------+--------+------------------------------------------------------------------
  1 | example | example.com | mail | -----BEGIN RSA PRIVATE KEY-----
                                     : <KEYDATA>
                                     : -----END RSA PRIVATE KEY-----
                                     :
(1 row)

odkim=> SELECT * from signingtable;
 id | fromheader | keyname
----+-------------+---------
  1 | example.com | example
(1 row)


But when I try to start the service, this is what happens:


[root_at_staging opendkim-2.1.1]# /etc/init.d/opendkim start
Starting OpenDKIM Milter: opendkim: /etc/opendkim.conf:
pgsql://opendkim_at_localhost/odkim/table=signingtable?keycol=fromheader?datacol=keyname:
dkimf_db_open(): Success
opendkim [FAILED]


Note, this service is configured to run as the 'opendkim' user:


[root_at_staging opendkim-2.1.1]# id opendkim
uid=500(opendkim) gid=99(nobody) groups=99(nobody)
[root_at_staging opendkim-2.1.1]# grep opendkim /etc/passwd
opendkim:x:500:99::/opt/opendkim:/sbin/nologin


Is there any other information I can provide that can help?


Naresh V

P.S.: My signing was working fine prior to switching to a pgsql
dataset. (I had plain files)
Received on Mon Jun 28 2010 - 12:33:17 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:19:47 PST