Hi,

(Can't believe I'm so unlucky with that daemon...)
I'm having a try with osmtpd 5.4.1 on obsd 5.4/amd64.
It was compiled locally from "opensmtpd-5.4.1.tar.gz".

Virtual users table is hosted in (localhost openbsd native) LDAP.
OpenSMTPD connects properly to LDAP but badly quits when getting a mail.

# smtpd -dvv
debug: init ssl-tree
info: OpenSMTPD 5.4.1 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: parent_send_config_ruleset: reloading
debug: parent_send_config_mfa: reloading
debug: parent_send_config: configuring smtp
mfa: building simple chains...
debug: queue: done loading queue into scheduler
mfa: building complex chains...
mfa: done building complex chains
mfa: done building default chain
debug: mfa ready
debug: smtp: listen on IPv6:fe80::20c:29ff:fe08:7d50%em0 port 25 flags 0x0 pki 
""
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 "alias_filter" -> 
"(&(objectClass=inetOrgPerson)(mail=%s))"
debug: table-ldap: parsing attribute "alias_attributes" (1) -> "mail"
debug: table-ldap: done reading config
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: table-ldap: ldap server accepted credentials
debug: table-ldap: connected
debug: smtpd: scanning offline queue...
debug: smtpd: offline scanning done
debug: smtp: new client on listener: 0x181d06b4d000
smtp-in: New session 2851bd0c7505cf16 from host 192.168.0.21 [192.168.0.21]
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: smtp -> lka: pipe closed
warn: mda -> lka: pipe closed
warn: control -> lka: pipe closed
warn: mta -> lka: pipe closed
warn: mfa -> smtp: pipe closed
warn: scheduler -> control: pipe closed
warn: parent -> lka: pipe closed
warn: queue -> lka: pipe closed

On the client side, I had:
# 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 Ok
rcpt to: <j...@foo.net>
Connection closed by foreign host.

A manual LDAP request does work:
# 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))"
(...)
# j...@foo.net, users, foo.net, local
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
(...)

A bit of configuration ?
# 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/"
accept from source <relay-hosts> for any relay

# egrep -v '^$|^#' /etc/mail/virtual-users.conf
url             ldap://127.0.0.1
username        cn=email,ou=users,dc=local
password        vierge
basedn          dc=local
alias_filter            (&(objectClass=inetOrgPerson)(mail=%s))
alias_attributes        mail

Any thoughts?
TIA,
  Joe
--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org

Reply via email to