Re: postgres and ldap backends

2014-03-06 Thread Marcus MERIGHI
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

2014-03-05 Thread Joel Carnat
I've just compiled and installed 5.4.2.

Not sure why, but smtpd still crashes after a LDAP lookup.

### SMTPD CONFIGURATION (there may be some garbage as I am still digging ;-)
# egrep -v ^$|^# /etc/mail/smtpd.conf.local   
 
lan_addr = 192.168.0.128
listen on all
table aliases db:/etc/mail/aliases.db
table relay-hosts db:/etc/mail/relay-hosts.db
table virtual-domains db:/etc/mail/virtual-domains.db
table virtual-users ldap:/etc/mail/virtual-users.conf
accept for domain foo.net virtual virtual-users deliver to maildir 
/home/vmail/%{dest.user}
accept from source relay-hosts for any relay

# egrep -v ^$|^# /etc/mail/relay-hosts  
127.0.0.1   YES
192.168.0.0/24  YES

# egrep -v ^$|^# /etc/mail/virtual-domains
foo.net OK
bar.net OK

# egrep -v ^$|^# /etc/mail/virtual-users.conf
url ldap://127.0.0.1
usernamecn=email,ou=users,dc=local
passwordvierge
basedn  dc=local
userinfo_filter ((objectClass=inetOrgPerson)(mail=%s))
userinfo_attributes mail
credentials_filter  ((objectClass=inetOrgPerson)(mail=%s))
credentials_attributes  mail,userPassword
alias_filter((objectClass=inetOrgPerson)(mail=%s))
alias_attributesmail


### THE MAIL CLIENT
# telnet 192.168.0.128 25
Trying 192.168.0.128...
Connected to 192.168.0.128.
Escape character is '^]'.
220 bagheera.local ESMTP OpenSMTPD
helo macbook
250 bagheera.local Hello macbook [192.168.0.21], pleased to meet you
mail from: j...@carnat.net
250 2.0.0: Ok
rcpt to: j...@foo.net
250 2.1.5 Destination address valid: Recipient ok
data
354 Enter mail, end with . on a line by itself
test
.
250 2.0.0: 103214a3 Message accepted for delivery
Connection closed by foreign host.

### THE SMTPD LOG
debug: smtp: new client on listener: 0x19c7d226c000
smtp-in: New session 29e925d57787e672 from host 192.168.0.21 [192.168.0.21]
debug: 0x19c7d5549000: end of message, msgflags=0x
smtp-in: Accepted message 103214a3 on session 29e925d57787e672: 
from=j...@carnat.net, to=j...@foo.net, size=5, ndest=1, proto=SMTP
debug: scheduler: evp:103214a36b0ca766 scheduled (mta)
debug: mta: received evp:103214a36b0ca766 for j...@foo.net
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 (0x19c7cde103a0, 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: 0x19c7d98d8c00: 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 de8f21dcdbc05dcc...
debug: smtp: new client on listener: 0x19c7d226c000
smtp-out: Connected on session de8f21dcdbc05dcc
smtp-in: New session 29e925d6c137dcb8 from host bagheera.local. [192.168.0.128]
debug: mta-routing: route [] - 192.168.0.128 (bagheera.local.) is now valid.
debug: mta: connecting with [connector:[]-[relay:foo.net],0x2]
debug: mta: canceling connector timeout
debug: mta: enough connections already
debug: mta: 0x19c7d98d8c00: handling next task for relay [relay:foo.net]
debug: table_ldap_internal_query: 
filter=((objectClass=inetOrgPerson)(mail=j...@foo.net)), ret=1
Segmentation fault 
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 

Re: postgres and ldap backends

2014-03-05 Thread Joel Carnat

Le 5 mars 2014 à 18:10, Gilles Chehade gil...@poolp.org 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 anydestination type=LIST config=
*
bagheera
TABLE anyhost type= config=
0.0.0.0/0
::/0
local
TABLE dynamic:0 type=LIST config=
foo.net
TABLE getpwnam type=DYNAMIC config=
TABLE localhost 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 localnames 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:localhost - 0
lookup: check 192.168.0.21 as NETADDR in table db:relay-hosts - found
lookup: check foo.net as DOMAIN in table static:anydestination - found
debug: 0x9854d6bd000: end of message, msgflags=0x
smtp-in: Accepted message 30972eb5 on session ce7f1f365cb16f30: 
from=j...@carnat.net, to=j...@foo.net, size=5, ndest=1, proto=SMTP
debug: scheduler: evp:30972eb53e98e2d4 scheduled (mta)
debug: mta: received evp:30972eb53e98e2d4 for j...@foo.net
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 ce7f1f374e6767ab from host 

Re: postgres and ldap backends

2014-03-05 Thread Gilles Chehade
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 gil...@poolp.org 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 anydestination type=LIST config=
 *
 bagheera
 TABLE anyhost type= config=
 0.0.0.0/0
 ::/0
 local
 TABLE dynamic:0 type=LIST config=
 foo.net
 TABLE getpwnam type=DYNAMIC config=
 TABLE localhost 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 localnames 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:localhost - 0
 lookup: check 192.168.0.21 as NETADDR in table db:relay-hosts - found
 lookup: check foo.net as DOMAIN in table static:anydestination - found
 debug: 0x9854d6bd000: end of message, msgflags=0x
 smtp-in: Accepted message 30972eb5 on session ce7f1f365cb16f30: 
 from=j...@carnat.net, to=j...@foo.net, size=5, ndest=1, proto=SMTP
 debug: scheduler: evp:30972eb53e98e2d4 scheduled (mta)
 debug: mta: received evp:30972eb53e98e2d4 for j...@foo.net
 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...
 

Re: postgres and ldap backends

2014-03-05 Thread Joel Carnat
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 gil...@poolp.org 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 gil...@poolp.org 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 anydestination type=LIST config=
*
bagheera
 TABLE anyhost type= config=
0.0.0.0/0
::/0
local
 TABLE dynamic:0 type=LIST config=
foo.net
 TABLE getpwnam type=DYNAMIC config=
 TABLE localhost 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 localnames 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:localhost - 0
 lookup: check 192.168.0.21 as NETADDR in table db:relay-hosts - found
 lookup: check foo.net as DOMAIN in table static:anydestination - found
 debug: 0x9854d6bd000: end of message, msgflags=0x
 smtp-in: Accepted message 30972eb5 on session ce7f1f365cb16f30: 
 from=j...@carnat.net, to=j...@foo.net, size=5, ndest=1, proto=SMTP
 debug: scheduler: evp:30972eb53e98e2d4 scheduled (mta)
 debug: mta: received evp:30972eb53e98e2d4 for j...@foo.net
 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 
 

Re: postgres and ldap backends

2014-03-05 Thread Gilles Chehade
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 gil...@poolp.org 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 gil...@poolp.org 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 anydestination type=LIST config=
 *
 bagheera
  TABLE anyhost type= config=
 0.0.0.0/0
 ::/0
 local
  TABLE dynamic:0 type=LIST config=
 foo.net
  TABLE getpwnam type=DYNAMIC config=
  TABLE localhost 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 localnames 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:localhost - 0
  lookup: check 192.168.0.21 as NETADDR in table db:relay-hosts - found
  lookup: check foo.net as DOMAIN in table static:anydestination - found
  debug: 0x9854d6bd000: end of message, msgflags=0x
  smtp-in: Accepted message 30972eb5 on session ce7f1f365cb16f30: 
  from=j...@carnat.net, to=j...@foo.net, size=5, ndest=1, proto=SMTP
  debug: scheduler: evp:30972eb53e98e2d4 scheduled (mta)
  debug: mta: received evp:30972eb53e98e2d4 for j...@foo.net
  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 [] -