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

2012-03-16 Thread Ismail YENIGUL

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 
dom...@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 dom...@ejemplo.org

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

Any idea of how to fix this?

regards.





Re: qmail-ldap mail looping issue with bigbrother

2012-03-16 Thread Ismail YENIGUL

Hi Mario,

I made  a test and confirm that the problem you report is exist if you 
use alias as a target.

The solution is add two line for supp...@example.com like following:

# cat bigbrother

supp...@example.com:us...@example.com
supp...@example.com:us...@example.com

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 14.03.2012 10:04, Ismail YENIGUL wrote:

Hi Mario,

On 14.03.2012 07:47, Mario Remy Almeida wrote:

Hi All,

Any email To/From supp...@example.com should be sent to 
us...@example.com and us...@example.com. To achieve this a group 
email is created as supportgr...@example.com.

How did you create the group email supportgr...@example.com?
Can you give please post here ldiff for this record?

Mar 14 09:43:36 miramar qmail: 1331703816.975623 starting delivery 
229400: msg 5000324 to local us...@example.com
Mar 14 09:43:36 miramar qmail: 1331703816.975632 status: local 1/20 
remote 0/10
Mar 14 09:43:36 miramar qmail: 1331703816.975642 starting delivery 
229401: msg 5000324 to local us...@example.com
Mar 14 09:43:36 miramar qmail: 1331703816.975651 status: local 2/20 
remote 0/10
*Mar 14 09:43:37 miramar qmail: 1331703817.000853 starting delivery 
229402: msg 5000324 to local supportgr...@example.com *
This is not normal. Did you include supportgr...@example.com group to 
supportgr...@example.com it self?


Mar 14 09:43:37 miramar qmail: 1331703817.018882 status: local 3/20 
remote 0/10
Mar 14 09:43:37 miramar qmail: 1331703817.018917 delivery 229402: 
failure: 
This_message_is_looping:_it_already_has_my_Delivered-To_line._(#5.4.6)/
Mar 14 09:43:37 miramar qmail: 1331703817.018927 status: local 2/20 
remote 0/10
Mar 14 09:43:37 miramar qmail: 1331703817.813451 delivery 229401: 
success: qmail-forward:_ok_1331703817_qp_31345./
Mar 14 09:43:37 miramar qmail: 1331703817.813497 status: local 1/20 
remote 0/10
Mar 14 09:43:37 miramar qmail: 1331703817.827669 delivery 229400: 
success: qmail-forward:_ok_1331703817_qp_31346./
Mar 14 09:43:37 miramar qmail: 1331703817.827766 status: local 0/20 
remote 0/10
Mar 14 09:43:37 miramar qmail: 1331703817.862611 bounce msg 5000324 
qp 31347




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


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

2012-03-16 Thread Nicolas de Bari Embriz Garcia Rojas
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
fine but qmail-ldaplook fails again, doing a little debug/diff between
versions (2012 vs 2006)  I notice that qldap-filter.c on version 2012
change considerable and this is because the implementation of the
'domainalias'  patch:

http://kristof.bajnok.hu/qmail/qldap-domainalias.patch

I think that the implementation of the domain alias patch to the core
(for avoiding the -DDOMAIN_ALIAS) on version
qmail-ldap-1.03-20120221.patch is causing problems.

The ldiff that I use is something like:

dn: uid=t...@ejemplo.org,ou=ejemplo.org,ou=vusers,dc=inbox,dc=im
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: qmailUser
uid: t...@ejemplo.org
cn: test
sn: test
mail: t...@ejemplo.org
mailMessageStore: ejemplo.org/test
accountStatus: active
smtpThrottle: 7
mailQuotaSize: 2147483648
userPassword: {SSHA}bRfoHmTRZTXyVywVdunoncu9jWWx32G2
mailQuotaCount: 0


PS. On either version qmail-ldap-1.03-20120221.patch or
qmail-ldap-1.03-20060201-SRS.patch I edit the Makefile and modify the
auto_uids.c with something like this:

auto_uids.c:
  mv auto_uids.c.tmp auto_uids.c

where auto_uids.c has this:

/* These values are hard-coded here, which looks bad until you *
 * realise that they're hard-coded in ${PORTSDIR}/?IDs anyway. */
/* $FreeBSD: ports/mail/qmail/files/patch-auto_uids-c-dist,v 1.1
2011/07/18 20:55:29 garga Exp $ */
int auto_uida = 81;
int auto_uidd = 82;
int auto_uidl = 83;
int auto_uido = 0;
int auto_uidp = 84;
int auto_uidq = 85;
int auto_uidr = 86;
int auto_uids = 87;
int auto_gidq = 82;
int auto_gidn = 81;


On Fri, Mar 16, 2012 at 2:05 PM, Ismail YENIGUL
ismail.yeni...@surgate.com wrote:
 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
 dom...@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 dom...@ejemplo.org

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

 Any idea of how to fix this?

 regards.







-- 
 nbari


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

2012-03-16 Thread Ismail YENIGUL

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
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
fine but qmail-ldaplook fails again, doing a little debug/diff between
versions (2012 vs 2006)  I notice that qldap-filter.c on version 2012
change considerable and this is because the implementation of the
'domainalias'  patch:

http://kristof.bajnok.hu/qmail/qldap-domainalias.patch

I think that the implementation of the domain alias patch to the core
(for avoiding the -DDOMAIN_ALIAS) on version
qmail-ldap-1.03-20120221.patch is causing problems.

The ldiff that I use is something like:

dn: uid=t...@ejemplo.org,ou=ejemplo.org,ou=vusers,dc=inbox,dc=im
objectClass: top
objectClass: person
objectClass: inetOrgPerson
objectClass: qmailUser
uid: t...@ejemplo.org
cn: test
sn: test
mail: t...@ejemplo.org
mailMessageStore: ejemplo.org/test
accountStatus: active
smtpThrottle: 7
mailQuotaSize: 2147483648
userPassword: {SSHA}bRfoHmTRZTXyVywVdunoncu9jWWx32G2
mailQuotaCount: 0


PS. On either version qmail-ldap-1.03-20120221.patch or
qmail-ldap-1.03-20060201-SRS.patch I edit the Makefile and modify the
auto_uids.c with something like this:

auto_uids.c:
   mv auto_uids.c.tmp auto_uids.c

where auto_uids.c has this:

/* These values are hard-coded here, which looks bad until you *
  * realise that they're hard-coded in ${PORTSDIR}/?IDs anyway. */
/* $FreeBSD: ports/mail/qmail/files/patch-auto_uids-c-dist,v 1.1
2011/07/18 20:55:29 garga Exp $ */
int auto_uida = 81;
int auto_uidd = 82;
int auto_uidl = 83;
int auto_uido = 0;
int auto_uidp = 84;
int auto_uidq = 85;
int auto_uidr = 86;
int auto_uids = 87;
int auto_gidq = 82;
int auto_gidn = 81;


On Fri, Mar 16, 2012 at 2:05 PM, Ismail YENIGUL
ismail.yeni...@surgate.com  wrote:

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
dom...@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 dom...@ejemplo.org

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

Any idea of how to fix this?

regards.








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

2012-03-16 Thread Nicolas de Bari Embriz Garcia Rojas
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 t...@ejemplo.org

Searching ldap for:
(|(mail=t...@ejemplo.org)(mailAlternateAddress=t...@ejemplo.org)))
under dn: ou=vusers,dc=inbox,dc=im
qmail-ldaplookup: fatal: qldap_filter: unspecified error


any ideas?

Another test that I did was to use the same qmail-ldaplookup.c  (of
version qmail-ldap-1.03-20060201.patch ) replacing the new version
of qmail-ldap-1.03-20120221.patch but got the same results.

regards.



On Fri, Mar 16, 2012 at 3:26 PM, Ismail YENIGUL
ismail.yeni...@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
 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
 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
 fine but qmail-ldaplook fails again, doing a little debug/diff between
 versions (2012 vs 2006)  I notice that qldap-filter.c on version 2012
 change considerable and this is because the implementation of the
 'domainalias'  patch:

 http://kristof.bajnok.hu/qmail/qldap-domainalias.patch

 I think that the implementation of the domain alias patch to the core
 (for avoiding the -DDOMAIN_ALIAS) on version
 qmail-ldap-1.03-20120221.patch is causing problems.

 The ldiff that I use is something like:

 dn: uid=t...@ejemplo.org,ou=ejemplo.org,ou=vusers,dc=inbox,dc=im
 objectClass: top
 objectClass: person
 objectClass: inetOrgPerson
 objectClass: qmailUser
 uid: t...@ejemplo.org
 cn: test
 sn: test
 mail: t...@ejemplo.org
 mailMessageStore: ejemplo.org/test
 accountStatus: active
 smtpThrottle: 7
 mailQuotaSize: 2147483648
 userPassword: {SSHA}bRfoHmTRZTXyVywVdunoncu9jWWx32G2
 mailQuotaCount: 0


 PS. On either version qmail-ldap-1.03-20120221.patch or
 qmail-ldap-1.03-20060201-SRS.patch I edit the Makefile and modify the
 auto_uids.c with something like this:

 auto_uids.c:
   mv auto_uids.c.tmp auto_uids.c

 where auto_uids.c has this:

 /* These values are hard-coded here, which looks bad until you *
  * realise that they're hard-coded in ${PORTSDIR}/?IDs anyway. */
 /* $FreeBSD: ports/mail/qmail/files/patch-auto_uids-c-dist,v 1.1
 2011/07/18 20:55:29 garga Exp $ */
 int auto_uida = 81;
 int auto_uidd = 82;
 int auto_uidl = 83;
 int auto_uido = 0;
 int auto_uidp = 84;
 int auto_uidq = 85;
 int auto_uidr = 86;
 int auto_uids = 87;
 int auto_gidq = 82;
 int 

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

2012-03-16 Thread ismail . yenigul
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.yeni...@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
 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
 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
 fine but qmail-ldaplook fails again, doing a little debug/diff between
 versions (2012 vs 2006)  I notice that qldap-filter.c on version 2012
 change considerable and this is because the implementation of the
 'domainalias'  patch:

 http://kristof.bajnok.hu/qmail/qldap-domainalias.patch

 I think that the implementation of the domain alias patch to the core
 (for avoiding the -DDOMAIN_ALIAS) on version
 qmail-ldap-1.03-20120221.patch is causing problems.

 The ldiff that I use is something like:

 dn: uid=t...@ejemplo.org,ou=ejemplo.org,ou=vusers,dc=inbox,dc=im
 objectClass: top
 objectClass: person
 objectClass: inetOrgPerson
 objectClass: qmailUser
 uid: t...@ejemplo.org
 cn: test
 sn: test
 mail: t...@ejemplo.org
 mailMessageStore: ejemplo.org/test
 accountStatus: active
 smtpThrottle: 7
 mailQuotaSize: 2147483648
 userPassword: {SSHA}bRfoHmTRZTXyVywVdunoncu9jWWx32G2
 mailQuotaCount: 0


 PS. On either version qmail-ldap-1.03-20120221.patch or
 qmail-ldap-1.03-20060201-SRS.patch I edit the Makefile and modify the
 auto_uids.c with something like this:

 auto_uids.c:
   mv auto_uids.c.tmp auto_uids.c

 where auto_uids.c has this:

 /* These values are hard-coded here, which looks bad until you *
  * realise that they're hard-coded in ${PORTSDIR}/?IDs anyway. */
 /* $FreeBSD: ports/mail/qmail/files/patch-auto_uids-c-dist,v 1.1
 2011/07/18 20:55:29 garga Exp $ */
 int auto_uida = 81;
 int auto_uidd = 82;
 int auto_uidl = 83;
 int auto_uido = 0;
 int auto_uidp = 84;
 int auto_uidq = 85;
 int auto_uidr = 86;
 int auto_uids = 87;
 int auto_gidq = 82;
 int auto_gidn = 81;


 On Fri, Mar 16, 2012 at 2:05 PM, Ismail YENIGUL
 ismail.yeni...@surgate.com  wrote:

 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
 dom...@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 dom...@ejemplo.org

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

 Any idea of how to fix this?

 regards.




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

2012-03-16 Thread Nicolas de Bari Embriz Garcia Rojas
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=t...@ejemplo.org,ou=ejemplo.org,ou=vusers,dc=lab,dc=inbox,dc=im
objectClass: top
objectClass: person
objectClass: iimOrgPerson
objectClass: qmailUser
uid: t...@ejemplo.org
cn: test
sn: test
mail: t...@ejemplo.org
mailMessageStore: ejemplo.org/test
accountStatus: active
smtpThrottle: 7
mailQuotaSize: 2147483648
mailQuotaCount: 0
---

the only Found 4 entries that I see when running ./qmail-ldaplookup
-m test are
uid: t...@ejemplo.org
cn: test
sn: test
mail: t...@ejemplo.org

when running ./qmail-ldaplookup -m t...@ejemplo.org (the right way
full email with @) on versions qmail-ldap-1.03-20060201.patch works
fine, by returning the ldiff  but  on qmail-ldap-1.03-20120221.patch
Id does not returns nothing.

If the ldifs where wrong, the qmail-ldaplooup would fail also with
versions  qmail-ldap-1.03-20120221.patch

regards.


On Fri, Mar 16, 2012 at 5:53 PM,  ismail.yeni...@surgate.com wrote:
 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.yeni...@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
 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
 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
 fine but qmail-ldaplook fails again, doing a little debug/diff between
 versions (2012 vs 2006)  I notice that qldap-filter.c on version 2012
 change considerable and this is because the implementation of the
 'domainalias'  patch:

 http://kristof.bajnok.hu/qmail/qldap-domainalias.patch

 I think that the implementation of the domain alias patch to the core
 (for avoiding the -DDOMAIN_ALIAS) on version
 qmail-ldap-1.03-20120221.patch is causing problems.

 The ldiff that I use is something like:

 dn: uid=t...@ejemplo.org,ou=ejemplo.org,ou=vusers,dc=inbox,dc=im
 objectClass: top
 objectClass: person
 objectClass: inetOrgPerson
 objectClass: qmailUser
 uid: t...@ejemplo.org
 cn: test
 sn: test
 mail: t...@ejemplo.org
 mailMessageStore: ejemplo.org/test
 accountStatus: active
 smtpThrottle: 7
 mailQuotaSize: 2147483648
 userPassword: {SSHA}bRfoHmTRZTXyVywVdunoncu9jWWx32G2
 mailQuotaCount: 0


 PS. On either version qmail-ldap-1.03-20120221.patch or
 qmail-ldap-1.03-20060201-SRS.patch I edit the Makefile and modify the
 auto_uids.c with 

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

2012-03-16 Thread Nicolas de Bari Embriz Garcia Rojas
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;
}

But for an unknown reason it is not  appending  the : /*
((objectclass=...)%searchfilter%) */ in my case
((objectClass=qmailUser) that is why I am getting:

qmail-ldaplookup: fatal: qldap_filter: unspecified error

since the ldap query is malformed :
Searching ldap for:
(|(mail=t...@ejemplo.org)(mailAlternateAddress=t...@ejemplo.org)))

The correct query (using /var/qmail/control/ldapobjectclass) should be
something like:

((objectClass=qmailUser)(|(mail=t...@ejemplo.org)(mailAlternateAddress=t...@ejemplo.org)))




On Fri, Mar 16, 2012 at 6:21 PM, Nicolas de Bari Embriz Garcia Rojas
nb...@unixmexico.org wrote:
 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=t...@ejemplo.org,ou=ejemplo.org,ou=vusers,dc=lab,dc=inbox,dc=im
 objectClass: top
 objectClass: person
 objectClass: iimOrgPerson
 objectClass: qmailUser
 uid: t...@ejemplo.org
 cn: test
 sn: test
 mail: t...@ejemplo.org
 mailMessageStore: ejemplo.org/test
 accountStatus: active
 smtpThrottle: 7
 mailQuotaSize: 2147483648
 mailQuotaCount: 0
 ---

 the only Found 4 entries that I see when running ./qmail-ldaplookup
 -m test are
 uid: t...@ejemplo.org
 cn: test
 sn: test
 mail: t...@ejemplo.org

 when running ./qmail-ldaplookup -m t...@ejemplo.org (the right way
 full email with @) on versions qmail-ldap-1.03-20060201.patch works
 fine, by returning the ldiff  but  on qmail-ldap-1.03-20120221.patch
 Id does not returns nothing.

 If the ldifs where wrong, the qmail-ldaplooup would fail also with
 versions  qmail-ldap-1.03-20120221.patch

 regards.


 On Fri, Mar 16, 2012 at 5:53 PM,  ismail.yeni...@surgate.com wrote:
 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.yeni...@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
 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
 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

 

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

2012-03-16 Thread Claudio Jeker
On Fri, Mar 16, 2012 at 08:26:55PM +, 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 -  1.10
+++ qldap-filter.c  16 Mar 2012 23:37:23 -
@@ -107,7 +107,7 @@ 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)) ||
@@ -179,7 +179,6 @@ filter_mail(char *mail, int *done)
}
extcnt--;
 #else
-#error XXX XXX 
/* basic qmail-ldap behavior test for usern...@domain.com and
   catch...@domain.com */
ext = 0;
@@ -193,7 +192,7 @@ filter_mail(char *mail, int *done)
/* build the search string for the email address */
/* mail address */
if (!filter_start(filter) ||
-   !stralloc_copys(filter, (|() ||
+   !stralloc_cats(filter, (|() ||
!stralloc_cats(filter, LDAP_MAIL) ||
!stralloc_cats(filter, =))
return 0;
Index: qmail-ldaplookup.c
===
RCS file: /home/cvs-djbware/CVS/qmail-ldap/qmail-ldaplookup.c,v
retrieving revision 1.39
diff -u -p -r1.39 qmail-ldaplookup.c
--- qmail-ldaplookup.c  10 Nov 2009 22:43:06 -  1.39
+++ qmail-ldaplookup.c  16 Mar 2012 23:37:23 -
@@ -223,12 +223,12 @@ int main(int argc, char **argv)
switch (mode) {
case mail:
f = filter_mail(value, done);
-   if (value == 0)
+   if (f == 0)
strerr_die2sys(1, FATAL, building filter: );
break;
case uid:
f = filter_uid(value);
-   if (value == 0)
+   if (f == 0)
strerr_die2sys(1, FATAL, building filter: );
done = 1;
break;


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

2012-03-16 Thread Nicolas de Bari Embriz Garcia Rojas
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] ) {
getmess();
i = 1;
while (argv[i])
  doit(argv[i++]);
  }
---

thanks in advance.


On Fri, Mar 16, 2012 at 10:39 PM, Claudio Jeker je...@n-r-g.com wrote:
 On Fri, Mar 16, 2012 at 08:26:55PM +, 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 -      1.10
 +++ qldap-filter.c      16 Mar 2012 23:37:23 -
 @@ -107,7 +107,7 @@ 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)) ||
 @@ -179,7 +179,6 @@ filter_mail(char *mail, int *done)
                }
                extcnt--;
  #else
 -#error XXX XXX
                /* basic qmail-ldap behavior test for usern...@domain.com and
                   catch...@domain.com */
                ext = 0;
 @@ -193,7 +192,7 @@ filter_mail(char *mail, int *done)
                        /* build the search string for the email address */
                        /* mail address */
                        if (!filter_start(filter) ||
 -                           !stralloc_copys(filter, (|() ||
 +                           !stralloc_cats(filter, (|() ||
                            !stralloc_cats(filter, LDAP_MAIL) ||
                            !stralloc_cats(filter, =))
                                return 0;
 Index: qmail-ldaplookup.c
 ===
 RCS file: /home/cvs-djbware/CVS/qmail-ldap/qmail-ldaplookup.c,v
 retrieving revision 1.39
 diff -u -p -r1.39 qmail-ldaplookup.c
 --- qmail-ldaplookup.c  10 Nov 2009 22:43:06 -      1.39
 +++ qmail-ldaplookup.c  16 Mar 2012 23:37:23 -
 @@ -223,12 +223,12 @@ int main(int argc, char **argv)
                switch (mode) {
                case mail:
                        f = filter_mail(value, done);
 -                       if (value == 0)
 +                       if (f == 0)
                                strerr_die2sys(1, FATAL, building filter: );
                        break;
                case uid:
                        f = filter_uid(value);
 -                       if (value == 0)
 +                       if (f == 0)
                                strerr_die2sys(1, FATAL, building filter: );
                        done = 1;
                        break;



-- 
 nbari