qmail-ldaplookup: fatal: qldap_filter: unspecified error

Hi, after compiling qmail with the new patch qmail-ldap-1.03-20060201,
(freebsd) something seems to be broken on qldap-filter.c

when trying to run /var/qmail/bin/qmail-ldaplookup -m domain <at> ejemplo.org

I get qmail-ldaplookup: fatal: qldap_filter: unspecified error

Any idea of how to fix this?

regards.

--

-- 
> nbari

Ismail YENIGUL | 16 Mar 2012 15:05

Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

Hi Nicolas,

First of all new patch is qmail-ldap-1.03-20120221.patch not 
qmail-ldap-1.03-20060201.patch
I compiled both patch on FreeBSD & Linux without any problem.
Can you please post here exact output and ldap ldiff about 
domain <at> ejemplo.org
Did you verify that control/ldap* settings are correct?

Thanks

Ismail YENIGUL
Team Leader / Takım Lideri
SurGATE Labs
Phone :+90 216-4709423 | Mobile:+90 533 747 36 65
SurGATE: West Coast Labs Premium Anti-Spam Certificated
Twitter: http://www.twitter.com/surgate
Blog: http://www.surgate.com/blog

On 15.03.2012 15:41, Nicolas de Bari Embriz Garcia Rojas wrote:
> Hi, after compiling qmail with the new patch qmail-ldap-1.03-20060201,
> (freebsd) something seems to be broken on qldap-filter.c
>
> when trying to run /var/qmail/bin/qmail-ldaplookup -m domain <at> ejemplo.org
>
> I get qmail-ldaplookup: fatal: qldap_filter: unspecified error
>
> Any idea of how to fix this?
>
> regards.
(Continue reading)

Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

Hi, sorry for the confusion, I mean qmail-ldap-1.03-20120221.patch.

Also I do not think it is an issue with the control/ldap settings
since with the past versions < 20120221 the qmail-ldaplookup  works
fine, I think something is missing/broken on qldap-filter.c.

What I am doing for testing (FreeBSD 9 amd64) is compiling the base of
qmail-ldap-1.03-20060201.patch plus this patches:

domain alias
http://kristof.bajnok.hu/qmail/qldap-domainalias.patch (domain alias)

multiple qmqpc servers (for ezml lists)
http://code.google.com/p/qmail-ldap-smtpauthuser/source/browse/trunk/qmail-qmqpc-servers_on_cmd_line.c

SRS support
http://code.google.com/p/qmail-ldap-smtpauthuser/source/browse/trunk/qmail-ldap-1.03-20060201-SRS.patch

my conf-cc looks like this:
cc -O2 -pipe -DLDAP_DEPRECATED -fno-strict-aliasing

and conf-ld
cc -s  -rpath=/usr/lib:/usr/local/lib

So far, version qmail-ldap-1.03-20060201 works fine with all this
patches, but now when trying to 'upgrade'/compile/test  version
qmail-ldap-1.03-20120221.patch using/sharing the same
/var/qmail/control, qmail-ldaplookup does not work.

Using only qmail-ldap-1.03-20120221.patch (no extra patches) compiles
(Continue reading)

Ismail YENIGUL | 16 Mar 2012 16:26

Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

Hi Nicolas,

I am also using  qmail-ldap-1.03-20120221.patch without extra patch 
(just small fix about auth_dovecot sent by Claudio)
It does not report any error for qmail-ldaplookup.  Are you applying 
domainalias patch to qmail-ldap-1.03-20120221.patch?
This patch is already exist in qmail-ldap-1.03-20120221.patch

Can you please do following and tell the result:

1. Apply only qmail-ldap-1.03-20120221.patch and just type make without 
setup check
2. run ./qmail-ldaplookup -m  test

Ismail YENIGUL
Team Leader / Takım Lideri
SurGATE Labs
Phone :+90 216-4709423 | Mobile:+90 533 747 36 65
SurGATE: West Coast Labs Premium Anti-Spam Certificated
Twitter: http://www.twitter.com/surgate
Blog: http://www.surgate.com/blog

On 16.03.2012 17:15, Nicolas de Bari Embriz Garcia Rojas wrote:
> Hi, sorry for the confusion, I mean qmail-ldap-1.03-20120221.patch.
>
> Also I do not think it is an issue with the control/ldap settings
> since with the past versions<  20120221 the qmail-ldaplookup  works
> fine, I think something is missing/broken on qldap-filter.c.
>
> What I am doing for testing (FreeBSD 9 amd64) is compiling the base of
(Continue reading)

Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

Hi,  I am not applying the domain alias patch, I am only using
qmail-ldap-1.03-20120221.patch (no extra patches) that is why I
mention that I think the problem is with qldap-filter.c or either
qmail-ldap in the way the 'domain alias' patch was applied on this
release to support domain aliasing.

On freebsd qbiff/auth_dovecot cause problems, in the middle time I
will disable them, since I currently don't have the fix that Claudio
post earlier.

After compiling, just using (make) and running ./qmail-ldaplookup -m
test I got this:

Searching ldap for: (null pointer)
under dn: ou=vusers,dc=inbox,dc=im
Found 4 entries:
Uh-oh: multiple entries found but should be unique!

dn: ou=vusers,dc=inbox,dc=im
-------------------------------------------------------
objectClass: top
objectClass: organizationalUnit
qmail-ldaplookup: fatal: qldap_get_attr(mail): no such object

And when using  ./qmail-ldaplookup -m test <at> ejemplo.org

Searching ldap for:
(|(mail=test <at> ejemplo.org)(mailAlternateAddress=test <at> ejemplo.org)))
under dn: ou=vusers,dc=inbox,dc=im
qmail-ldaplookup: fatal: qldap_filter: unspecified error
(Continue reading)

ismail.yenigul | 16 Mar 2012 18:53

Re: Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

Hi
-- orijinal mesaj --
>Found 4 entries:
>Uh-oh: multiple entries found but should >be unique!

I think something wrong with your ldap records. This error occurs usually when you define the same
mail/mailalternate address for the different user.
Please check your ldap entries.
-ismail
On Fri, Mar 16, 2012 at 3:26 PM, Ismail YENIGUL
<ismail.yenigul <at> surgate.com> wrote:
> Hi Nicolas,
>
> I am also using  qmail-ldap-1.03-20120221.patch without extra patch (just
> small fix about auth_dovecot sent by Claudio)
> It does not report any error for qmail-ldaplookup.  Are you applying
> domainalias patch to qmail-ldap-1.03-20120221.patch?
> This patch is already exist in qmail-ldap-1.03-20120221.patch
>
> Can you please do following and tell the result:
>
> 1. Apply only qmail-ldap-1.03-20120221.patch and just type make without
> setup check
> 2. run ./qmail-ldaplookup -m  test
>
>
>
>
> Ismail YENIGUL
> Team Leader / Takım Lideri
(Continue reading)

Re: Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

There is something else missing, I am sure, that it is not an issue
with the ldap entries. this is the full ldap I am using for testing,
as you can notice it as only 1 user:

---
dn: dc=lab,dc=inbox,dc=im
dc: lab
objectClass: top
objectClass: domain
objectClass: domainRelatedObject
associatedDomain: lab.inbox.im

dn: ou=vusers,dc=lab,dc=inbox,dc=im
objectClass: top
objectClass: organizationalUnit
ou: vusers
description: vusers
structuralObjectClass: organizationalUnit

dn: ou=ejemplo.org,ou=vusers,dc=lab,dc=inbox,dc=im
objectClass: top
objectClass: organizationalUnit
ou: ejemplo.org
description: ejemplo.org
structuralObjectClass: organizationalUnit

dn: uid=test <at> ejemplo.org,ou=ejemplo.org,ou=vusers,dc=lab,dc=inbox,dc=im
objectClass: top
objectClass: person
objectClass: iimOrgPerson
(Continue reading)

Re: Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

I think I have found the problem. but need some help fixing the code

For some reason the qldap-filter.c is not adding the
/var/qmail/control/ldapobjectclass

There is a method call 'filter_objectclass' on version
qmail-ldap-1.03-20060201.patch the one is called after filtering by
(uid/mail) and properly builds the ldap query.

but on version qmail-ldap-1.03-20120221.patch

The filter_objectclass has been replaced with this one:

int
filter_start(stralloc *filter)
{
  if (!stralloc_copys(filter, ""))
    return 0;
  if (objectclass.s != (char *)0 && objectclass.len != 0) {
    /* (&(objectclass=...)%searchfilter%) */
    if (!stralloc_copys(filter, "(&(") ||
        !stralloc_cats(filter, LDAP_OBJECTCLASS) ||
        !stralloc_cats(filter, "=") ||
        !stralloc_cat(filter, &objectclass) ||
        !stralloc_cats(filter, ")"))
      return 0;
  }
  return 1;
}

(Continue reading)

Claudio Jeker | 16 Mar 2012 23:39

Re: Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

On Fri, Mar 16, 2012 at 08:26:55PM +0000, Nicolas de Bari Embriz Garcia Rojas wrote:
> I think I have found the problem. but need some help fixing the code
> 
> For some reason the qldap-filter.c is not adding the
> /var/qmail/control/ldapobjectclass
> 

... thanks for the detailed report. I was able to verify it and the
attached diff should fix this problem.

-- 
:wq Claudio

Index: qldap-filter.c
===================================================================
RCS file: /home/cvs-djbware/CVS/qmail-ldap/qldap-filter.c,v
retrieving revision 1.10
diff -u -p -r1.10 qldap-filter.c
--- qldap-filter.c	10 Nov 2009 22:46:06 -0000	1.10
+++ qldap-filter.c	16 Mar 2012 23:37:23 -0000
 <at>  <at>  -107,7 +107,7  <at>  <at>  filter_uid(char *uid)
 		return 0;

 	if (!filter_start(&filter)  ||
-	    !stralloc_copys(&filter,"(") ||
+	    !stralloc_cats(&filter,"(") ||
 	    !stralloc_cats(&filter, LDAP_UID) ||
 	    !stralloc_cats(&filter, "=") ||
 	    !filter_escape(&filter, uid, str_len(uid)) ||
 <at>  <at>  -179,7 +179,6  <at>  <at>  filter_mail(char *mail, int *done)
(Continue reading)

Re: Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

Hi, thanks for the reply, I applied the patch and it is working now.

Changing a little the topic, I modified  qmail-qmqpc.c  for supporting
multiple qmpqc servers ( one server per line in DIR/qmqpservers/0),
but would like to know your feed back about it.

the patch: http://qmail-ldap-smtpauthuser.googlecode.com/svn/trunk/qmail-qmqpc-servers_on_cmd_line.c

Original:
---
  if ( argv[1] ) {
    char temp[IPFMT];
    if (!stralloc_copys(&servers,argv[1])) nomem();
    dns_init(0);
    switch (dns_ip(&ia,&servers)) {
      case DNS_HARD: die_perm();
      case DNS_SOFT: die_temp();
      case DNS_MEM: nomem();
    }

    temp[ip_fmt(temp,&ia.ix[0].ip)]=0;
    if (!stralloc_copys(&servers, temp)) nomem();
    if (!stralloc_0(&servers)) nomem();
  }
---

Replaced with this:

---
  if ( argv[1] ) {
(Continue reading)

Re: Re: qmail-ldaplookup: fatal: qldap_filter: unspecified error

Forget this 'patch/modification' bellow, it will just crash
ldapcluster forwarding

On Sat, Mar 17, 2012 at 12:05 AM, Nicolas de Bari Embriz Garcia Rojas
<nbari <at> unixmexico.org> wrote:
> Hi, thanks for the reply, I applied the patch and it is working now.
>
> Changing a little the topic, I modified  qmail-qmqpc.c  for supporting
> multiple qmpqc servers ( one server per line in DIR/qmqpservers/0),
> but would like to know your feed back about it.
>
> the patch: http://qmail-ldap-smtpauthuser.googlecode.com/svn/trunk/qmail-qmqpc-servers_on_cmd_line.c
>
> Original:
> ---
>  if ( argv[1] ) {
>    char temp[IPFMT];
>    if (!stralloc_copys(&servers,argv[1])) nomem();
>    dns_init(0);
>    switch (dns_ip(&ia,&servers)) {
>      case DNS_HARD: die_perm();
>      case DNS_SOFT: die_temp();
>      case DNS_MEM: nomem();
>    }
>
>    temp[ip_fmt(temp,&ia.ix[0].ip)]=0;
>    if (!stralloc_copys(&servers, temp)) nomem();
>    if (!stralloc_0(&servers)) nomem();
>  }
> ---
(Continue reading)


Gmane