Hello,

Having working OpenSMTPd with plain text file user authentication. The
auth from table(5) works like a charm currently. But I have a trouble to
authenticate users by OpenSMTPd + Dovecot from shared PGSQL database.

As for Dovecot, it authenticates users from PGSQL as expected. Dovecot's
LMTP authentication works pretty fine too when OpenSMTPd connects to it.

The trouble especially with smptd PGSQL users auth for now.

$ tail -n5 /var/log/maillog
smtpd[9579]: info: OpenSMTPD 6.0.0 starting
smtpd[9579]: warn: table-proc: pipe closed
smtpd[9579]: lookup: table-proc: exiting
smtpd[9579]: smtpd: process lka socket closed

After restart by

# rcctl restart smtpd

I see closed connection to a PGSQL which initiated by smtpd

# netstat -an | grep 5432
tcp     0       0       127.0.0.1.3245  127.0.0.1.5432  TIME_WAIT

Configuration steps I have listed below:

1. OpenSMTPd is a part of OpenBSD 6.2amd64 I'm running.
2. # pkg_add opensmtpd-extras opensmtpd-extras-pgsql
3. $ cat /etc/mail/smtpd.conf
...
table alias db:/etc/mail/alias
table domain posgres:/etc/mail/pgsql.conf
table virtuals postgres:/etc/mail/pgsql.conf
table pass postgres:/etc/mail/pgsql.conf
table userinfo postgres:/etc/mail/pgsql.conf
...
4. $ cat /etc/mail/pgsql.conf
# PostgreSQL
conninfo host='127.0.0.1:5432' dbname='maildatabase' user='maildbuser'
password='secret'

query_alias SELECT CONCAT (alias, ' ', dest) AS alias FROM maildatabase
WHERE alias=$1
query_domain SELECT domain FROM maildatabase WHERE domain=$1
query_credentials SELECT user, pass FROM maildatabase WHERE userid=$1
AND active=$1
query_userinfo SELECT CONCAT (user, realm) AS user, uid, gid FROM
maildatabase WHERE user=$1 AND active='1'

5. The database schema is self written, I can share it if it was necessary.

---

What can be wrong?

Denis

-- 
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to