Re: table-postgres fix nullptr deref
On 2024/02/03 02:05:06 +0100, Philipp wrote: > Hi > > I found a nullpointer deref in table-postgres. A patch is attached. > > Philipp > > Ps: thanks gilles for so nice to read code. Good catch! Committed, thanks! (I took the chance to knf-ify the comment before committing.)
table-postgres fix nullptr deref
Hi I found a nullpointer deref in table-postgres. A patch is attached. Philipp Ps: thanks gilles for so nice to read code. From becf40f667f4510e9e964f950b8d78d5c56ee2ba Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Fri, 2 Feb 2024 12:27:04 +0100 Subject: [PATCH] table-postgres check if errfld is NULL before deref --- extras/tables/table-postgres/table_postgres.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extras/tables/table-postgres/table_postgres.c b/extras/tables/table-postgres/table_postgres.c index e1aa613..2dae3ec 100644 --- a/extras/tables/table-postgres/table_postgres.c +++ b/extras/tables/table-postgres/table_postgres.c @@ -459,7 +459,9 @@ retry: res = PQexecPrepared(config->db, stmt, 0, NULL, NULL, NULL, 0); if (PQresultStatus(res) != PGRES_TUPLES_OK) { errfld = PQresultErrorField(res, PG_DIAG_SQLSTATE); - if (errfld[0] == '0' && errfld[1] == '8') { + /* PQresultErrorField can return NULL if the connection to the server + suddenly closed (e.g. server restart) */ + if (errfld == NULL || (errfld[0] == '0' && errfld[1] == '8')) { log_warnx("warn: trying to reconnect after error: %s", PQerrorMessage(config->db)); PQclear(res); if (config_connect(config)) -- 2.39.2
Re: Postgres backend missing?
$ pkg_info -Q opensmtpd-extras ... opensmtpd-extras-pgsql-6.4.0p0v0 ... On 12/8/19 7:04 PM, Norman Golisz wrote: > Hi, > > I'm currently migrating an old instance of OpenSMTPD (6.3) on OpenBSD to > current. > > This setup uses Postgres as backend for the user database. Now, it seems > the Postgres backend is gone, because smtpd claims there is no such > backend. Then I've installed the opensmtpd-extras package to no avail. > > So, is the Postgres backend gone forever, WIP, or am I just failing to > read manuals properly? > > Thanks! > > Norman > >
Postgres backend missing?
Hi, I'm currently migrating an old instance of OpenSMTPD (6.3) on OpenBSD to current. This setup uses Postgres as backend for the user database. Now, it seems the Postgres backend is gone, because smtpd claims there is no such backend. Then I've installed the opensmtpd-extras package to no avail. So, is the Postgres backend gone forever, WIP, or am I just failing to read manuals properly? Thanks! Norman
Re: Postgres?
On 2014-09-05 19:19, Giovanni Bechis wrote: > On 09/05/14 15:19, Hugo Osvaldo Barrera wrote: > > Hi, > > > > For a while now I've been wanting to try the postgres support properly. I've > > finally sat down to do it, but haven't had much luck: > > > > # grep postgres smtpd.conf > > table postgres postgres://postgres.conf > > # smtpd -n > > fatal: table_create: backend "postgres" does not exist > > > > Do I need to do any special building? Am I using the wrong syntax? > > > > I'm using OpenBSD-current (updated like 2 weeks ago?). > > > > Thanks, > > > This is still work-in-progress on OpenBSD, (see > http://marc.info/?l=openbsd-ports&m=140845596917927&w=2), if interested I > have a quite-working port. > Cheers > Giovanni > > -- > You received this mail because you are subscribed to misc@opensmtpd.org > To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org > Oh, I though the OpenBSD port was actually ahead of -portable. Would this port be -latest, or another not-yet-public one? I'd be willing to try it out, so: yes, please! :D Cheers, -- Hugo Osvaldo Barrera A: Because we read from top to bottom, left to right. Q: Why should I start my reply below the quoted text? pgp3HN9FgZ9iO.pgp Description: PGP signature
Re: Postgres?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/05/14 15:19, Hugo Osvaldo Barrera wrote: > Hi, > > For a while now I've been wanting to try the postgres support properly. I've > finally sat down to do it, but haven't had much luck: > > # grep postgres smtpd.conf > table postgres postgres://postgres.conf > # smtpd -n > fatal: table_create: backend "postgres" does not exist > > Do I need to do any special building? Am I using the wrong syntax? > > I'm using OpenBSD-current (updated like 2 weeks ago?). > > Thanks, > This is still work-in-progress on OpenBSD, (see http://marc.info/?l=openbsd-ports&m=140845596917927&w=2), if interested I have a quite-working port. Cheers Giovanni -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJUCfCxAAoJEI7Sc79XDlKKVzwH/1timymhqZvNWuFxr2EvLKMI jtYXTyVkczE7QkWJQ01MlVPe7OVt0Fi2pZmPFg4eRBdMRauzU8eLIpwl+c3hlGHZ S600a7Hq1dv6GLnJ2suC5P+1EefUe0jR4t9QMIvbAJF8qcn069gfufgchNVBwl92 F7D/yft1WnwCwOj0dFvGA2ETGjnt6kM5Gp4L1se7CpUBw7ysOtGYlQ3u6yuuWKE/ z0nskJ1w7LVo/LKUxpa3BqBGgmNeG2WKHfj9sA2Qh5K1RL27FIhPM5MTfWGwXJt6 exDGCbaawm9KfB9PsuYF8X7uWI0U1KpBecKLZRlFKmoOhTLXXqyaTopp6w51Qng= =BKTt -END PGP SIGNATURE- -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
Postgres?
Hi, For a while now I've been wanting to try the postgres support properly. I've finally sat down to do it, but haven't had much luck: # grep postgres smtpd.conf table postgres postgres://postgres.conf # smtpd -n fatal: table_create: backend "postgres" does not exist Do I need to do any special building? Am I using the wrong syntax? I'm using OpenBSD-current (updated like 2 weeks ago?). Thanks, -- Hugo Osvaldo Barrera A: Because we read from top to bottom, left to right. Q: Why should I start my reply below the quoted text? pgpjp9KKBuMOY.pgp Description: PGP signature
Re: postgres and ldap backends
On Mon, Mar 17, 2014 at 07:51:00PM -0300, Hugo Osvaldo Barrera wrote: > On 2014-03-05 02:35, Gilles Chehade wrote: > > Hi, > > > > We have just released a minor stable version and hopefully we should not > > see another minor release before OpenSMTPD 5.5.0 comes out several weeks > > from now. > > > > In the meantime, I'd like to stabilize table_ldap and table_postgres, so > > we could *maybe* stop shipping them as experimental with our next big > > release. > > > > If people willing to use ldap or postgres could get in touch with me, it > > would be nice ;-) > > > > -- > > Gilles Chehade > > > > https://www.poolp.org @poolpOrg > > A bit late. > Are you still needing people willing to test postgres? > No that I have finally finished moving to a new city, this thread can revive ;-) I fixed LDAP experimental support yesterday, it no longer segfaults. LDAP users are encouraged to test and report if they hit issues so that we can stabilize the backend a bit. Same applied to Postgres. -- Gilles Chehade https://www.poolp.org @poolpOrg -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
Re: postgres and ldap backends
On Mon, Mar 17, 2014 at 07:51:00PM -0300, Hugo Osvaldo Barrera wrote: > On 2014-03-05 02:35, Gilles Chehade wrote: > > Hi, > > > > We have just released a minor stable version and hopefully we should not > > see another minor release before OpenSMTPD 5.5.0 comes out several weeks > > from now. > > > > In the meantime, I'd like to stabilize table_ldap and table_postgres, so > > we could *maybe* stop shipping them as experimental with our next big > > release. > > > > If people willing to use ldap or postgres could get in touch with me, it > > would be nice ;-) > > > > -- > > Gilles Chehade > > > > https://www.poolp.org @poolpOrg > > A bit late. > Are you still needing people willing to test postgres? > Yes always ;-) -- Gilles Chehade https://www.poolp.org @poolpOrg -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
Re: postgres and ldap backends
On 2014-03-05 02:35, Gilles Chehade wrote: > Hi, > > We have just released a minor stable version and hopefully we should not > see another minor release before OpenSMTPD 5.5.0 comes out several weeks > from now. > > In the meantime, I'd like to stabilize table_ldap and table_postgres, so > we could *maybe* stop shipping them as experimental with our next big > release. > > If people willing to use ldap or postgres could get in touch with me, it > would be nice ;-) > > -- > Gilles Chehade > > https://www.poolp.org @poolpOrg A bit late. Are you still needing people willing to test postgres? -- Hugo Osvaldo Barrera A: No, it doesn't make sense. Q: Should I include quotations *after* my reply? pgp8y3n2lh9w4.pgp Description: PGP signature
Re: postgres and ldap backends
gil...@poolp.org (Gilles Chehade), 2014.03.05 (Wed) 02:35 (CET): > In the meantime, I'd like to stabilize table_ldap and table_postgres, so > we could *maybe* stop shipping them as experimental with our next big > release. > > If people willing to use ldap or postgres could get in touch with me, it > would be nice ;-) Got an active directory use case here: opensmtpd to check valid recipients in active directory. Somewhat short in time currently and thus waiting until the initial problems already found are gone. Bye, Marcus -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
Re: postgres and ldap backends
OpenBSD ldapd. Le 5 mars 2014 à 18:56, Gilles Chehade a écrit : > it's ok ;-) > > you're using openldap or openbsd's ldapd ? > > On Wed, Mar 05, 2014 at 06:51:10PM +0100, Joel Carnat wrote: >> Unfortunately, real life take precedence tonight ;-) >> >> I may find time to connect tomorrow during work-day. Or a bit late in the >> evening. >> Although it's been tenths of years since I ran an IRC client on my laptop ;-) >> >> Le 5 mars 2014 ? 18:42, Gilles Chehade a ?crit : >> >>> if you can come on irc and stay for a while, i can kill this one >>> by tonight >>> >>> On Wed, Mar 05, 2014 at 06:22:04PM +0100, Joel Carnat wrote: Le 5 mars 2014 ? 18:10, Gilles Chehade a ?crit : > can you start smtpd with -dv -T lookup -T table ? > this should provide a bit more information about the ldap lookup yup. # smtpd -dv -T lookup -T table debug: init ssl-tree info: OpenSMTPD 5.4.2 starting debug: bounce warning after 4h debug: using "fs" queue backend debug: using "ramqueue" scheduler backend debug: using "ram" stat backend info: startup [debug mode] debug: queue: done loading queue into scheduler debug: parent_send_config_ruleset: reloading debug: parent_send_config_mfa: reloading debug: parent_send_config: configuring smtp TABLE "" type=LIST config="" "*" "bagheera" TABLE "" type= config="" "0.0.0.0/0" "::/0" "local" TABLE "" type=LIST config="" "foo.net" TABLE "" type=DYNAMIC config="" TABLE "" type= config="" "127.0.0.1" "192.168.0.128" "ipv6:::1" "ipv6:fe80::1%lo0" "ipv6:fe80::20c:29ff:fe08:7d50%em0" "local" TABLE "" type=LIST config="" "bagheera.local" "localhost" TABLE "aliases" type=DYNAMIC config="/etc/mail/aliases.db" TABLE "relay-hosts" type=DYNAMIC config="/etc/mail/relay-hosts.db" TABLE "virtual-domains" type=DYNAMIC config="/etc/mail/virtual-domains.db" TABLE "virtual-users" type=DYNAMIC config="/usr/libexec/smtpd/table-ldap /etc/mail/virtual-users.conf" mfa: building simple chains... mfa: building complex chains... mfa: done building complex chains mfa: done building default chain debug: mfa ready debug: table-ldap: reading key "url" -> "ldap://127.0.0.1"; debug: table-ldap: reading key "username" -> "cn=email,ou=users,dc=local" debug: table-ldap: reading key "password" -> "vierge" debug: table-ldap: reading key "basedn" -> "dc=local" debug: table-ldap: reading key "userinfo_filter" -> "(&(objectClass=inetOrgPerson)(mail=%s))" debug: table-ldap: parsing attribute "userinfo_attributes" (4) -> "mail" debug: table-ldap: reading key "credentials_filter" -> "(&(objectClass=inetOrgPerson)(mail=%s))" debug: table-ldap: parsing attribute "credentials_attributes" (2) -> "mail,userPassword" debug: table-ldap: reading key "alias_filter" -> "(&(objectClass=inetOrgPerson)(mail=%s))" debug: table-ldap: parsing attribute "alias_attributes" (1) -> "mail" debug: table-ldap: done reading config debug: table-ldap: ldap server accepted credentials debug: table-ldap: connected debug: smtp: listen on IPv6:fe80::20c:29ff:fe08:7d50%em0 port 25 flags 0x0 pki "" debug: smtp: listen on 192.168.0.128 port 25 flags 0x0 pki "" debug: smtp: listen on 127.0.0.1 port 25 flags 0x0 pki "" debug: smtp: listen on IPv6:fe80::1%lo0 port 25 flags 0x0 pki "" debug: smtp: listen on IPv6:::1 port 25 flags 0x0 pki "" debug: smtp: will accept at most 500 clients debug: smtpd: scanning offline queue... debug: smtpd: offline scanning done debug: smtp: new client on listener: 0x98551cb9000 smtp-in: New session ce7f1f365cb16f30 from host 192.168.0.21 [192.168.0.21] lookup: check "192.168.0.21" as NETADDR in table static: -> 0 lookup: check "192.168.0.21" as NETADDR in table db:relay-hosts -> found lookup: check "foo.net" as DOMAIN in table static: -> found debug: 0x9854d6bd000: end of message, msgflags=0x smtp-in: Accepted message 30972eb5 on session ce7f1f365cb16f30: from=, to=, size=5, ndest=1, proto=SMTP debug: scheduler: evp:30972eb53e98e2d4 scheduled (mta) debug: mta: received evp:30972eb53e98e2d4 for debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, nconn=0 debug: mta: querying MX for [relay:foo.net]... debug: mta: [relay:foo.net] waiting for MX debug: MXs for domain foo.net: 192.168.0.128 preference 10 debug: mta: ... got mx (0x98545ea7420, foo.net, [relay:foo.net]) debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, nconn=0 debug: mta: querying source for [relay:foo.net]... debug: mta: ... got
Re: postgres and ldap backends
it's ok ;-) you're using openldap or openbsd's ldapd ? On Wed, Mar 05, 2014 at 06:51:10PM +0100, Joel Carnat wrote: > Unfortunately, real life take precedence tonight ;-) > > I may find time to connect tomorrow during work-day. Or a bit late in the > evening. > Although it's been tenths of years since I ran an IRC client on my laptop ;-) > > Le 5 mars 2014 ? 18:42, Gilles Chehade a ?crit : > > > if you can come on irc and stay for a while, i can kill this one > > by tonight > > > > On Wed, Mar 05, 2014 at 06:22:04PM +0100, Joel Carnat wrote: > >> > >> Le 5 mars 2014 ? 18:10, Gilles Chehade a ?crit : > >> > >>> can you start smtpd with -dv -T lookup -T table ? > >>> this should provide a bit more information about the ldap lookup > >> yup. > >> > >> # smtpd -dv -T lookup -T table > >> debug: init ssl-tree > >> info: OpenSMTPD 5.4.2 starting > >> debug: bounce warning after 4h > >> debug: using "fs" queue backend > >> debug: using "ramqueue" scheduler backend > >> debug: using "ram" stat backend > >> info: startup [debug mode] > >> debug: queue: done loading queue into scheduler > >> debug: parent_send_config_ruleset: reloading > >> debug: parent_send_config_mfa: reloading > >> debug: parent_send_config: configuring smtp > >> TABLE "" type=LIST config="" > >>"*" > >>"bagheera" > >> TABLE "" type= config="" > >>"0.0.0.0/0" > >>"::/0" > >>"local" > >> TABLE "" type=LIST config="" > >>"foo.net" > >> TABLE "" type=DYNAMIC config="" > >> TABLE "" type= config="" > >>"127.0.0.1" > >>"192.168.0.128" > >>"ipv6:::1" > >>"ipv6:fe80::1%lo0" > >>"ipv6:fe80::20c:29ff:fe08:7d50%em0" > >>"local" > >> TABLE "" type=LIST config="" > >>"bagheera.local" > >>"localhost" > >> TABLE "aliases" type=DYNAMIC config="/etc/mail/aliases.db" > >> TABLE "relay-hosts" type=DYNAMIC config="/etc/mail/relay-hosts.db" > >> TABLE "virtual-domains" type=DYNAMIC config="/etc/mail/virtual-domains.db" > >> TABLE "virtual-users" type=DYNAMIC config="/usr/libexec/smtpd/table-ldap > >> /etc/mail/virtual-users.conf" > >> mfa: building simple chains... > >> mfa: building complex chains... > >> mfa: done building complex chains > >> mfa: done building default chain > >> debug: mfa ready > >> debug: table-ldap: reading key "url" -> "ldap://127.0.0.1"; > >> debug: table-ldap: reading key "username" -> "cn=email,ou=users,dc=local" > >> debug: table-ldap: reading key "password" -> "vierge" > >> debug: table-ldap: reading key "basedn" -> "dc=local" > >> debug: table-ldap: reading key "userinfo_filter" -> > >> "(&(objectClass=inetOrgPerson)(mail=%s))" > >> debug: table-ldap: parsing attribute "userinfo_attributes" (4) -> "mail" > >> debug: table-ldap: reading key "credentials_filter" -> > >> "(&(objectClass=inetOrgPerson)(mail=%s))" > >> debug: table-ldap: parsing attribute "credentials_attributes" (2) -> > >> "mail,userPassword" > >> debug: table-ldap: reading key "alias_filter" -> > >> "(&(objectClass=inetOrgPerson)(mail=%s))" > >> debug: table-ldap: parsing attribute "alias_attributes" (1) -> "mail" > >> debug: table-ldap: done reading config > >> debug: table-ldap: ldap server accepted credentials > >> debug: table-ldap: connected > >> debug: smtp: listen on IPv6:fe80::20c:29ff:fe08:7d50%em0 port 25 flags 0x0 > >> pki "" > >> debug: smtp: listen on 192.168.0.128 port 25 flags 0x0 pki "" > >> debug: smtp: listen on 127.0.0.1 port 25 flags 0x0 pki "" > >> debug: smtp: listen on IPv6:fe80::1%lo0 port 25 flags 0x0 pki "" > >> debug: smtp: listen on IPv6:::1 port 25 flags 0x0 pki "" > >> debug: smtp: will accept at most 500 clients > >> debug: smtpd: scanning offline queue... > >> debug: smtpd: offline scanning done > >> debug: smtp: new client on listener: 0x98551cb9000 > >> smtp-in: New session ce7f1f365cb16f30 from host 192.168.0.21 [192.168.0.21] > >> lookup: check "192.168.0.21" as NETADDR in table static: -> 0 > >> lookup: check "192.168.0.21" as NETADDR in table db:relay-hosts -> found > >> lookup: check "foo.net" as DOMAIN in table static: -> found > >> debug: 0x9854d6bd000: end of message, msgflags=0x > >> smtp-in: Accepted message 30972eb5 on session ce7f1f365cb16f30: > >> from=, to=, size=5, ndest=1, proto=SMTP > >> debug: scheduler: evp:30972eb53e98e2d4 scheduled (mta) > >> debug: mta: received evp:30972eb53e98e2d4 for > >> debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, > >> nconn=0 > >> debug: mta: querying MX for [relay:foo.net]... > >> debug: mta: [relay:foo.net] waiting for MX > >> debug: MXs for domain foo.net: > >>192.168.0.128 preference 10 > >> debug: mta: ... got mx (0x98545ea7420, foo.net, [relay:foo.net]) > >> debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, > >> nconn=0 > >> debug: mta: querying source for [relay:foo.net]... > >> debug: mta: ... got source for [relay:foo.net]: [] > >> debug: mta: new [connector:[]->[r
Re: postgres and ldap backends
Unfortunately, real life take precedence tonight ;-) I may find time to connect tomorrow during work-day. Or a bit late in the evening. Although it's been tenths of years since I ran an IRC client on my laptop ;-) Le 5 mars 2014 à 18:42, Gilles Chehade a écrit : > if you can come on irc and stay for a while, i can kill this one > by tonight > > On Wed, Mar 05, 2014 at 06:22:04PM +0100, Joel Carnat wrote: >> >> Le 5 mars 2014 ? 18:10, Gilles Chehade a ?crit : >> >>> can you start smtpd with -dv -T lookup -T table ? >>> this should provide a bit more information about the ldap lookup >> yup. >> >> # smtpd -dv -T lookup -T table >> debug: init ssl-tree >> info: OpenSMTPD 5.4.2 starting >> debug: bounce warning after 4h >> debug: using "fs" queue backend >> debug: using "ramqueue" scheduler backend >> debug: using "ram" stat backend >> info: startup [debug mode] >> debug: queue: done loading queue into scheduler >> debug: parent_send_config_ruleset: reloading >> debug: parent_send_config_mfa: reloading >> debug: parent_send_config: configuring smtp >> TABLE "" type=LIST config="" >>"*" >>"bagheera" >> TABLE "" type= config="" >>"0.0.0.0/0" >>"::/0" >>"local" >> TABLE "" type=LIST config="" >>"foo.net" >> TABLE "" type=DYNAMIC config="" >> TABLE "" type= config="" >>"127.0.0.1" >>"192.168.0.128" >>"ipv6:::1" >>"ipv6:fe80::1%lo0" >>"ipv6:fe80::20c:29ff:fe08:7d50%em0" >>"local" >> TABLE "" type=LIST config="" >>"bagheera.local" >>"localhost" >> TABLE "aliases" type=DYNAMIC config="/etc/mail/aliases.db" >> TABLE "relay-hosts" type=DYNAMIC config="/etc/mail/relay-hosts.db" >> TABLE "virtual-domains" type=DYNAMIC config="/etc/mail/virtual-domains.db" >> TABLE "virtual-users" type=DYNAMIC config="/usr/libexec/smtpd/table-ldap >> /etc/mail/virtual-users.conf" >> mfa: building simple chains... >> mfa: building complex chains... >> mfa: done building complex chains >> mfa: done building default chain >> debug: mfa ready >> debug: table-ldap: reading key "url" -> "ldap://127.0.0.1"; >> debug: table-ldap: reading key "username" -> "cn=email,ou=users,dc=local" >> debug: table-ldap: reading key "password" -> "vierge" >> debug: table-ldap: reading key "basedn" -> "dc=local" >> debug: table-ldap: reading key "userinfo_filter" -> >> "(&(objectClass=inetOrgPerson)(mail=%s))" >> debug: table-ldap: parsing attribute "userinfo_attributes" (4) -> "mail" >> debug: table-ldap: reading key "credentials_filter" -> >> "(&(objectClass=inetOrgPerson)(mail=%s))" >> debug: table-ldap: parsing attribute "credentials_attributes" (2) -> >> "mail,userPassword" >> debug: table-ldap: reading key "alias_filter" -> >> "(&(objectClass=inetOrgPerson)(mail=%s))" >> debug: table-ldap: parsing attribute "alias_attributes" (1) -> "mail" >> debug: table-ldap: done reading config >> debug: table-ldap: ldap server accepted credentials >> debug: table-ldap: connected >> debug: smtp: listen on IPv6:fe80::20c:29ff:fe08:7d50%em0 port 25 flags 0x0 >> pki "" >> debug: smtp: listen on 192.168.0.128 port 25 flags 0x0 pki "" >> debug: smtp: listen on 127.0.0.1 port 25 flags 0x0 pki "" >> debug: smtp: listen on IPv6:fe80::1%lo0 port 25 flags 0x0 pki "" >> debug: smtp: listen on IPv6:::1 port 25 flags 0x0 pki "" >> debug: smtp: will accept at most 500 clients >> debug: smtpd: scanning offline queue... >> debug: smtpd: offline scanning done >> debug: smtp: new client on listener: 0x98551cb9000 >> smtp-in: New session ce7f1f365cb16f30 from host 192.168.0.21 [192.168.0.21] >> lookup: check "192.168.0.21" as NETADDR in table static: -> 0 >> lookup: check "192.168.0.21" as NETADDR in table db:relay-hosts -> found >> lookup: check "foo.net" as DOMAIN in table static: -> found >> debug: 0x9854d6bd000: end of message, msgflags=0x >> smtp-in: Accepted message 30972eb5 on session ce7f1f365cb16f30: >> from=, to=, size=5, ndest=1, proto=SMTP >> debug: scheduler: evp:30972eb53e98e2d4 scheduled (mta) >> debug: mta: received evp:30972eb53e98e2d4 for >> debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, >> nconn=0 >> debug: mta: querying MX for [relay:foo.net]... >> debug: mta: [relay:foo.net] waiting for MX >> debug: MXs for domain foo.net: >>192.168.0.128 preference 10 >> debug: mta: ... got mx (0x98545ea7420, foo.net, [relay:foo.net]) >> debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, >> nconn=0 >> debug: mta: querying source for [relay:foo.net]... >> debug: mta: ... got source for [relay:foo.net]: [] >> debug: mta: new [connector:[]->[relay:foo.net],0x1] >> debug: mta: connecting with [connector:[]->[relay:foo.net],0x0] >> debug: mta-routing: searching new route for >> [connector:[]->[relay:foo.net],0x0]... >> debug: mta-routing: selecting candidate route [] <-> 192.168.0.128 >> debug: mta-routing: spawning new connection on [] <-> 192.168.0.128 >> debug: mta:
Re: postgres and ldap backends
if you can come on irc and stay for a while, i can kill this one by tonight On Wed, Mar 05, 2014 at 06:22:04PM +0100, Joel Carnat wrote: > > Le 5 mars 2014 ? 18:10, Gilles Chehade a ?crit : > > > can you start smtpd with -dv -T lookup -T table ? > > this should provide a bit more information about the ldap lookup > yup. > > # smtpd -dv -T lookup -T table > debug: init ssl-tree > info: OpenSMTPD 5.4.2 starting > debug: bounce warning after 4h > debug: using "fs" queue backend > debug: using "ramqueue" scheduler backend > debug: using "ram" stat backend > info: startup [debug mode] > debug: queue: done loading queue into scheduler > debug: parent_send_config_ruleset: reloading > debug: parent_send_config_mfa: reloading > debug: parent_send_config: configuring smtp > TABLE "" type=LIST config="" > "*" > "bagheera" > TABLE "" type= config="" > "0.0.0.0/0" > "::/0" > "local" > TABLE "" type=LIST config="" > "foo.net" > TABLE "" type=DYNAMIC config="" > TABLE "" type= config="" > "127.0.0.1" > "192.168.0.128" > "ipv6:::1" > "ipv6:fe80::1%lo0" > "ipv6:fe80::20c:29ff:fe08:7d50%em0" > "local" > TABLE "" type=LIST config="" > "bagheera.local" > "localhost" > TABLE "aliases" type=DYNAMIC config="/etc/mail/aliases.db" > TABLE "relay-hosts" type=DYNAMIC config="/etc/mail/relay-hosts.db" > TABLE "virtual-domains" type=DYNAMIC config="/etc/mail/virtual-domains.db" > TABLE "virtual-users" type=DYNAMIC config="/usr/libexec/smtpd/table-ldap > /etc/mail/virtual-users.conf" > mfa: building simple chains... > mfa: building complex chains... > mfa: done building complex chains > mfa: done building default chain > debug: mfa ready > debug: table-ldap: reading key "url" -> "ldap://127.0.0.1"; > debug: table-ldap: reading key "username" -> "cn=email,ou=users,dc=local" > debug: table-ldap: reading key "password" -> "vierge" > debug: table-ldap: reading key "basedn" -> "dc=local" > debug: table-ldap: reading key "userinfo_filter" -> > "(&(objectClass=inetOrgPerson)(mail=%s))" > debug: table-ldap: parsing attribute "userinfo_attributes" (4) -> "mail" > debug: table-ldap: reading key "credentials_filter" -> > "(&(objectClass=inetOrgPerson)(mail=%s))" > debug: table-ldap: parsing attribute "credentials_attributes" (2) -> > "mail,userPassword" > debug: table-ldap: reading key "alias_filter" -> > "(&(objectClass=inetOrgPerson)(mail=%s))" > debug: table-ldap: parsing attribute "alias_attributes" (1) -> "mail" > debug: table-ldap: done reading config > debug: table-ldap: ldap server accepted credentials > debug: table-ldap: connected > debug: smtp: listen on IPv6:fe80::20c:29ff:fe08:7d50%em0 port 25 flags 0x0 > pki "" > debug: smtp: listen on 192.168.0.128 port 25 flags 0x0 pki "" > debug: smtp: listen on 127.0.0.1 port 25 flags 0x0 pki "" > debug: smtp: listen on IPv6:fe80::1%lo0 port 25 flags 0x0 pki "" > debug: smtp: listen on IPv6:::1 port 25 flags 0x0 pki "" > debug: smtp: will accept at most 500 clients > debug: smtpd: scanning offline queue... > debug: smtpd: offline scanning done > debug: smtp: new client on listener: 0x98551cb9000 > smtp-in: New session ce7f1f365cb16f30 from host 192.168.0.21 [192.168.0.21] > lookup: check "192.168.0.21" as NETADDR in table static: -> 0 > lookup: check "192.168.0.21" as NETADDR in table db:relay-hosts -> found > lookup: check "foo.net" as DOMAIN in table static: -> found > debug: 0x9854d6bd000: end of message, msgflags=0x > smtp-in: Accepted message 30972eb5 on session ce7f1f365cb16f30: > from=, to=, size=5, ndest=1, proto=SMTP > debug: scheduler: evp:30972eb53e98e2d4 scheduled (mta) > debug: mta: received evp:30972eb53e98e2d4 for > debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, > nconn=0 > debug: mta: querying MX for [relay:foo.net]... > debug: mta: [relay:foo.net] waiting for MX > debug: MXs for domain foo.net: > 192.168.0.128 preference 10 > debug: mta: ... got mx (0x98545ea7420, foo.net, [relay:foo.net]) > debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, > nconn=0 > debug: mta: querying source for [relay:foo.net]... > debug: mta: ... got source for [relay:foo.net]: [] > debug: mta: new [connector:[]->[relay:foo.net],0x1] > debug: mta: connecting with [connector:[]->[relay:foo.net],0x0] > debug: mta-routing: searching new route for > [connector:[]->[relay:foo.net],0x0]... > debug: mta-routing: selecting candidate route [] <-> 192.168.0.128 > debug: mta-routing: spawning new connection on [] <-> 192.168.0.128 > debug: mta: 0x985504b5c00: spawned for relay [relay:foo.net] > debug: mta: connecting with [connector:[]->[relay:foo.net],0x0] > debug: mta: cannot use [relay:foo.net] before 2s > debug: mta-routing: no route available for > [connector:[]->[relay:foo.net],0x0]: must wait a bit > debug: mta: retrying to connect on [connector:[]->[relay:foo.net],0x0] in > 2s... > debug:
Re: postgres and ldap backends
Le 5 mars 2014 à 18:10, Gilles Chehade a écrit : > can you start smtpd with -dv -T lookup -T table ? > this should provide a bit more information about the ldap lookup yup. # smtpd -dv -T lookup -T table debug: init ssl-tree info: OpenSMTPD 5.4.2 starting debug: bounce warning after 4h debug: using "fs" queue backend debug: using "ramqueue" scheduler backend debug: using "ram" stat backend info: startup [debug mode] debug: queue: done loading queue into scheduler debug: parent_send_config_ruleset: reloading debug: parent_send_config_mfa: reloading debug: parent_send_config: configuring smtp TABLE "" type=LIST config="" "*" "bagheera" TABLE "" type= config="" "0.0.0.0/0" "::/0" "local" TABLE "" type=LIST config="" "foo.net" TABLE "" type=DYNAMIC config="" TABLE "" type= config="" "127.0.0.1" "192.168.0.128" "ipv6:::1" "ipv6:fe80::1%lo0" "ipv6:fe80::20c:29ff:fe08:7d50%em0" "local" TABLE "" type=LIST config="" "bagheera.local" "localhost" TABLE "aliases" type=DYNAMIC config="/etc/mail/aliases.db" TABLE "relay-hosts" type=DYNAMIC config="/etc/mail/relay-hosts.db" TABLE "virtual-domains" type=DYNAMIC config="/etc/mail/virtual-domains.db" TABLE "virtual-users" type=DYNAMIC config="/usr/libexec/smtpd/table-ldap /etc/mail/virtual-users.conf" mfa: building simple chains... mfa: building complex chains... mfa: done building complex chains mfa: done building default chain debug: mfa ready debug: table-ldap: reading key "url" -> "ldap://127.0.0.1"; debug: table-ldap: reading key "username" -> "cn=email,ou=users,dc=local" debug: table-ldap: reading key "password" -> "vierge" debug: table-ldap: reading key "basedn" -> "dc=local" debug: table-ldap: reading key "userinfo_filter" -> "(&(objectClass=inetOrgPerson)(mail=%s))" debug: table-ldap: parsing attribute "userinfo_attributes" (4) -> "mail" debug: table-ldap: reading key "credentials_filter" -> "(&(objectClass=inetOrgPerson)(mail=%s))" debug: table-ldap: parsing attribute "credentials_attributes" (2) -> "mail,userPassword" debug: table-ldap: reading key "alias_filter" -> "(&(objectClass=inetOrgPerson)(mail=%s))" debug: table-ldap: parsing attribute "alias_attributes" (1) -> "mail" debug: table-ldap: done reading config debug: table-ldap: ldap server accepted credentials debug: table-ldap: connected debug: smtp: listen on IPv6:fe80::20c:29ff:fe08:7d50%em0 port 25 flags 0x0 pki "" debug: smtp: listen on 192.168.0.128 port 25 flags 0x0 pki "" debug: smtp: listen on 127.0.0.1 port 25 flags 0x0 pki "" debug: smtp: listen on IPv6:fe80::1%lo0 port 25 flags 0x0 pki "" debug: smtp: listen on IPv6:::1 port 25 flags 0x0 pki "" debug: smtp: will accept at most 500 clients debug: smtpd: scanning offline queue... debug: smtpd: offline scanning done debug: smtp: new client on listener: 0x98551cb9000 smtp-in: New session ce7f1f365cb16f30 from host 192.168.0.21 [192.168.0.21] lookup: check "192.168.0.21" as NETADDR in table static: -> 0 lookup: check "192.168.0.21" as NETADDR in table db:relay-hosts -> found lookup: check "foo.net" as DOMAIN in table static: -> found debug: 0x9854d6bd000: end of message, msgflags=0x smtp-in: Accepted message 30972eb5 on session ce7f1f365cb16f30: from=, to=, size=5, ndest=1, proto=SMTP debug: scheduler: evp:30972eb53e98e2d4 scheduled (mta) debug: mta: received evp:30972eb53e98e2d4 for debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, nconn=0 debug: mta: querying MX for [relay:foo.net]... debug: mta: [relay:foo.net] waiting for MX debug: MXs for domain foo.net: 192.168.0.128 preference 10 debug: mta: ... got mx (0x98545ea7420, foo.net, [relay:foo.net]) debug: mta: draining [relay:foo.net] refcount=1, ntask=1, nconnector=0, nconn=0 debug: mta: querying source for [relay:foo.net]... debug: mta: ... got source for [relay:foo.net]: [] debug: mta: new [connector:[]->[relay:foo.net],0x1] debug: mta: connecting with [connector:[]->[relay:foo.net],0x0] debug: mta-routing: searching new route for [connector:[]->[relay:foo.net],0x0]... debug: mta-routing: selecting candidate route [] <-> 192.168.0.128 debug: mta-routing: spawning new connection on [] <-> 192.168.0.128 debug: mta: 0x985504b5c00: spawned for relay [relay:foo.net] debug: mta: connecting with [connector:[]->[relay:foo.net],0x0] debug: mta: cannot use [relay:foo.net] before 2s debug: mta-routing: no route available for [connector:[]->[relay:foo.net],0x0]: must wait a bit debug: mta: retrying to connect on [connector:[]->[relay:foo.net],0x0] in 2s... debug: mta: draining [relay:foo.net] refcount=3, ntask=1, nconnector=1, nconn=1 debug: mta: scheduling relay [relay:foo.net] in 1s... smtp-out: Connecting to smtp+tls://192.168.0.128:25 (bagheera.local.) on session a477a901ccc2e17c... debug: smtp: new client on listener: 0x98551cb9000 smtp-out: Connected on session a477a901ccc2e17c smtp-in: New session ce7f1f374e67
Re: postgres and ldap backends
lt > warn: table-proc: pipe closed > fatal: table-proc: exiting > warn: queue -> lka: pipe closed > warn: smtp -> lka: pipe closed > warn: mta -> lka: pipe closed > warn: control -> lka: pipe closed > warn: mda -> lka: pipe closed > warn: mfa -> smtp: pipe closed > warn: scheduler -> control: pipe closed > warn: parent -> lka: pipe closed > > ### THE LDAPD LOG > Mar 5 17:57:39.356 [20646] consumed 125 bytes > Mar 5 17:57:39.356 [20646] got request type 3, id 2 > Mar 5 17:57:39.356 [20646] base dn = dc=local, scope = 2 > Mar 5 17:57:39.356 [20646] requesting 01 access to dc=local by > cn=email,ou=users,dc=local, in namespace dc=local > Mar 5 17:57:39.356 [20646] init index scan on [mail=j...@foo.net,] > Mar 5 17:57:39.356 [20646] found index > mail=j...@foo.net,mail=j...@foo.net,ou=users,ou=foo.net, > Mar 5 17:57:39.356 [20646] lookup indexed key > [mail=j...@foo.net,ou=users,ou=foo.net,dc=local] > Mar 5 17:57:39.356 [20646] found dn > mail=j...@foo.net,ou=users,ou=foo.net,dc=local > Mar 5 17:57:39.356 [20646] requesting 01 access to > mail=j...@foo.net,ou=users,ou=foo.net,dc=local by cn=email,ou=users,dc=local, > in namespace dc=local > Mar 5 17:57:39.356 [20646] found index > mail=maria...@bar.net,mail=maria...@bar.net,ou=users,ou=bar.net, > Mar 5 17:57:39.356 [20646] scanned past index prefix [mail=j...@foo.net,] > Mar 5 17:57:39.357 [20646] 1 scanned, 1 matched, 0 dups > Mar 5 17:57:39.357 [20646] sending response 5 with result 0 > Mar 5 17:57:39.357 [20646] finished search on msgid 2 > Mar 5 17:57:39.357 [20646] end-of-file on connection 12 > Mar 5 17:57:39.357 [20646] closing connection 12 > > ### THE LDAP CLIENT > # ldapsearch -H ldap://127.0.0.1 -D "cn=email,ou=users,dc=local" -w vierge -b > "dc=local" "(&(objectClass=inetOrgPerson)(mail=j...@foo.net))" > (...) > dn: mail=j...@foo.net,ou=users,ou=foo.net,dc=local > objectClass: top > objectClass: person > objectClass: organizationalPerson > objectClass: inetOrgPerson > cn: Joel Carnat > sn: Carnat > givenName: Joel > mail: j...@foo.net > userPassword:: dmllcmdl > > # search result > search: 2 > result: 0 Success > > # numResponses: 2 > # numEntries: 1 > > Le 5 mars 2014 ? 10:27, Gilles Chehade a ?crit : > > > Well, first question first, does it work for you ? :-) > > > > On Wed, Mar 05, 2014 at 07:59:27AM +0100, Joel Carnat wrote: > >> Will for LDAP here. :) > >> Feel free to MP. French or English. > >> > >> -- > >> e-mail different > >> > >>> Le 5 mars 2014 ?? 02:35, Gilles Chehade a ??crit : > >>> > >>> Hi, > >>> > >>> We have just released a minor stable version and hopefully we should not > >>> see another minor release before OpenSMTPD 5.5.0 comes out several weeks > >>> from now. > >>> > >>> In the meantime, I'd like to stabilize table_ldap and table_postgres, so > >>> we could *maybe* stop shipping them as experimental with our next big > >>> release. > >>> > >>> If people willing to use ldap or postgres could get in touch with me, it > >>> would be nice ;-) > >>> > >>> -- > >>> Gilles Chehade > >>> > >>> https://www.poolp.org @poolpOrg > >>> > >>> -- > >>> You received this mail because you are subscribed to misc@opensmtpd.org > >>> To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org > >>> > >> > >> -- > >> You received this mail because you are subscribed to misc@opensmtpd.org > >> To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org > >> > > > > -- > > Gilles Chehade > > > > https://www.poolp.org @poolpOrg > > > > -- > > You received this mail because you are subscribed to misc@opensmtpd.org > > To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org > > > > > -- > You received this mail because you are subscribed to misc@opensmtpd.org > To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org > -- Gilles Chehade https://www.poolp.org @poolpOrg -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
Re: postgres and ldap backends
57:39.356 [20646] found index mail=j...@foo.net,mail=j...@foo.net,ou=users,ou=foo.net, Mar 5 17:57:39.356 [20646] lookup indexed key [mail=j...@foo.net,ou=users,ou=foo.net,dc=local] Mar 5 17:57:39.356 [20646] found dn mail=j...@foo.net,ou=users,ou=foo.net,dc=local Mar 5 17:57:39.356 [20646] requesting 01 access to mail=j...@foo.net,ou=users,ou=foo.net,dc=local by cn=email,ou=users,dc=local, in namespace dc=local Mar 5 17:57:39.356 [20646] found index mail=maria...@bar.net,mail=maria...@bar.net,ou=users,ou=bar.net, Mar 5 17:57:39.356 [20646] scanned past index prefix [mail=j...@foo.net,] Mar 5 17:57:39.357 [20646] 1 scanned, 1 matched, 0 dups Mar 5 17:57:39.357 [20646] sending response 5 with result 0 Mar 5 17:57:39.357 [20646] finished search on msgid 2 Mar 5 17:57:39.357 [20646] end-of-file on connection 12 Mar 5 17:57:39.357 [20646] closing connection 12 ### THE LDAP CLIENT # ldapsearch -H ldap://127.0.0.1 -D "cn=email,ou=users,dc=local" -w vierge -b "dc=local" "(&(objectClass=inetOrgPerson)(mail=j...@foo.net))" (...) dn: mail=j...@foo.net,ou=users,ou=foo.net,dc=local objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetOrgPerson cn: Joel Carnat sn: Carnat givenName: Joel mail: j...@foo.net userPassword:: dmllcmdl # search result search: 2 result: 0 Success # numResponses: 2 # numEntries: 1 Le 5 mars 2014 à 10:27, Gilles Chehade a écrit : > Well, first question first, does it work for you ? :-) > > On Wed, Mar 05, 2014 at 07:59:27AM +0100, Joel Carnat wrote: >> Will for LDAP here. :) >> Feel free to MP. French or English. >> >> -- >> e-mail different >> >>> Le 5 mars 2014 ?? 02:35, Gilles Chehade a ??crit : >>> >>> Hi, >>> >>> We have just released a minor stable version and hopefully we should not >>> see another minor release before OpenSMTPD 5.5.0 comes out several weeks >>> from now. >>> >>> In the meantime, I'd like to stabilize table_ldap and table_postgres, so >>> we could *maybe* stop shipping them as experimental with our next big >>> release. >>> >>> If people willing to use ldap or postgres could get in touch with me, it >>> would be nice ;-) >>> >>> -- >>> Gilles Chehade >>> >>> https://www.poolp.org @poolpOrg >>> >>> -- >>> You received this mail because you are subscribed to misc@opensmtpd.org >>> To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org >>> >> >> -- >> You received this mail because you are subscribed to misc@opensmtpd.org >> To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org >> > > -- > Gilles Chehade > > https://www.poolp.org @poolpOrg > > -- > You received this mail because you are subscribed to misc@opensmtpd.org > To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org > -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
Re: postgres and ldap backends
Well, first question first, does it work for you ? :-) On Wed, Mar 05, 2014 at 07:59:27AM +0100, Joel Carnat wrote: > Will for LDAP here. :) > Feel free to MP. French or English. > > -- > e-mail different > > > Le 5 mars 2014 ?? 02:35, Gilles Chehade a ??crit : > > > > Hi, > > > > We have just released a minor stable version and hopefully we should not > > see another minor release before OpenSMTPD 5.5.0 comes out several weeks > > from now. > > > > In the meantime, I'd like to stabilize table_ldap and table_postgres, so > > we could *maybe* stop shipping them as experimental with our next big > > release. > > > > If people willing to use ldap or postgres could get in touch with me, it > > would be nice ;-) > > > > -- > > Gilles Chehade > > > > https://www.poolp.org @poolpOrg > > > > -- > > You received this mail because you are subscribed to misc@opensmtpd.org > > To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org > > > > -- > You received this mail because you are subscribed to misc@opensmtpd.org > To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org > -- Gilles Chehade https://www.poolp.org @poolpOrg -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
Re: postgres and ldap backends
Will for LDAP here. :) Feel free to MP. French or English. -- e-mail different > Le 5 mars 2014 à 02:35, Gilles Chehade a écrit : > > Hi, > > We have just released a minor stable version and hopefully we should not > see another minor release before OpenSMTPD 5.5.0 comes out several weeks > from now. > > In the meantime, I'd like to stabilize table_ldap and table_postgres, so > we could *maybe* stop shipping them as experimental with our next big > release. > > If people willing to use ldap or postgres could get in touch with me, it > would be nice ;-) > > -- > Gilles Chehade > > https://www.poolp.org @poolpOrg > > -- > You received this mail because you are subscribed to misc@opensmtpd.org > To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org > -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org
postgres and ldap backends
Hi, We have just released a minor stable version and hopefully we should not see another minor release before OpenSMTPD 5.5.0 comes out several weeks from now. In the meantime, I'd like to stabilize table_ldap and table_postgres, so we could *maybe* stop shipping them as experimental with our next big release. If people willing to use ldap or postgres could get in touch with me, it would be nice ;-) -- Gilles Chehade https://www.poolp.org @poolpOrg -- You received this mail because you are subscribed to misc@opensmtpd.org To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org