Hi,

I use OpenBSD & PGSQL Backend.

On Openbsd its necessary to install : 

_ opensmtpd-extras
_ opensmtpd-extras-pgsql

I think you have to add / precise specific instruction to implemant the backend.

Caution, seems that mysql backend does not exist before opensmtpd-5.4.1

you can take a look here (fr debian):
https://wiki.debian-fr.xyz/OpenSMTPD


My pgsql.conf file used by smtpd.conf (via:

table aliases   db:/etc/mail/aliases.db
table vdomains  postgres:/etc/mail/pgsql.conf
table passwd    postgres:/etc/mail/pgsql.conf
table valiases  postgres:/etc/mail/pgsql.conf


# /etc/mail/pgsql.conf
conninfo host='127.0.0.1' user='dbmailuser' password='ThePassword' 
dbname='dbmail'
query_alias select destination from vusers where email=$1;                      
# Alias lookup query
query_domain select domain from vdomains where domain=$1;                       
# Domain lookup query
query_credentials select email, password from credentials where email=$1 and 
active = 'Y'; # Credentials lookup query

--> I use $1 instead your ? for the input(var). (Does it different beetween 
pgsql backend & mysql backend ?)
--> The structure of my database has a field to test if the user is Active or 
not


Does dovecot / courrier is well configured to access your mysql database ? 
(with the same base ?)
Jul  4 02:22:16 arya dovecot: imap-login: Login: user=<[email protected]>, 
method=PLAIN, rip=an.IP.addr.somewhere, lip=my.server.ip, mpid=40316, TLS, 
session=<mWow4HJToLZYpqOM>
Jul  4 02:22:16 arya dovecot: imap([email protected]): Connection closed (LIST 
finished 0.322 secs ago) in=50 out=3027

For example my smtp login:
Jul  4 02:44:11 arya smtpd[55148]: 3962f8e7231c2c96 smtp event=connected 
address=xxx.xxx.xxx.xxx host=host.fbx.proxad.net
Jul  4 02:44:11 arya smtpd[55148]: 3962f8e7231c2c96 smtp event=starttls 
address=xxx.xxx.xxx.xxx host=host.fbx.proxad.net ciphers="version=TLSv1.2, 
cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256"
Jul  4 02:44:11 arya smtpd[55148]: 3962f8e7231c2c96 smtp event=authentication 
[email protected] address=xxx.xxx.xxx.xxx host=host.fbx.proxad.net 
result=ok
Jul  4 02:44:11 arya smtpd[55148]: 3962f8e7231c2c96 smtp event=message 
address=xxx.xxx.xxx.xxx host=host.fbx.proxad.net msgid=03056e77 
from=<[email protected]> to=<[email protected]> size=687 
ndest=1 proto=ESMTP
Jul  4 02:44:11 arya smtpd[55148]: 3962f8f1da214412 mta event=connecting 
address=smtp://127.0.0.1:10037 host=localhost
Jul  4 02:44:11 arya smtpd[55148]: 3962f8f1da214412 mta event=connected
Jul  4 02:44:11 arya clamsmtpd: 100000: accepted connection from: 127.0.0.1
Jul  4 02:44:11 arya smtpd[55148]: 3962f8f2e2893a80 smtp event=connected 
address=127.0.0.1 host=localhost
Jul  4 02:44:11 arya smtpd[55148]: 3962f8f2e2893a80 smtp event=message 
address=127.0.0.1 host=localhost msgid=5d1846e6 from=<[email protected]> 
to=<[email protected]> size=921 ndest=1 proto=ESMTP
Jul  4 02:44:11 arya clamsmtpd: 100000: [email protected], 
[email protected], status=CLEAN
Jul  4 02:44:11 arya smtpd[55148]: 3962f8f1da214412 mta event=delivery 
evpid=03056e77e7084771 from=<[email protected]> 
to=<[email protected]> rcpt=<-> source="127.0.0.1" 
relay="127.0.0.1 (localhost)" delay=0s result="Ok" stat="250 2.0.0: 5d1846e6 
Message accepted for delivery"
Jul  4 02:44:11 arya smtpd[55148]: 3962f8e7231c2c96 smtp event=closed 
address=88.166.163.140 host=orc59-1-88-166-163-140.fbx.proxad.net reason=quit


I hope, it will be helpfull, i have no feedback from mysql.

Olivier.


On Mon, 26 Jun 2017 15:40:47 +0200
Tomasz Pajor <[email protected]> wrote:

> Hello,
> 
> For some reason I’m not able to get this to work. I’m running opensmtpd on 
> debian, version is 6.0.2p1-2. I want to have a mysql backend for the users. 
> My configuration 
> https://gist.github.com/nijikon/3357d2f9f6842b4a0aad1380b1502c11 
> <https://gist.github.com/nijikon/3357d2f9f6842b4a0aad1380b1502c11>
> 
> I’m getting this don’t know why.
> 
> 155604f99c56b9a9 smtp event=starttls ciphers="version=TLSv1.2, 
> cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128"
> debug: smtp: SIZE in MAIL FROM command
> 155604f99c56b9a9 smtp event=failed-command command="RCPT 
> TO:<[email protected]>" result="550 Invalid recipient"
> 155604f99c56b9a9 smtp event=closed reason=quit
> debug: smtp: 0x55ac8e22cdb0: deleting session: done
> 
> I would really appreciate any feedback, thanks!
> 
> —
> Tomek

-- 
Olivier  Burelli <[email protected]>

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

Reply via email to