Re: [Dovecot] Different PROXY for IMAP and POP3 using LDAP-auth

2009-12-15 Thread Timo Sirainen
On Sun, 2009-12-13 at 10:59 +0100, Ralf Becker wrote:

 +attr_names_r[i] = p_strdup(auth_request-pool, str_c(str));

auth_request-pool gets freed when this auth request finishes.

 +hash_insert(conn-user_attr_map,attr_names_r[i],
 + hash_lookup(conn-user_attr_map,attr_names[i]));

Here you add it to conn-*_attr_map and it stays permanently there. So
it looks like it's leaking memory for each request, and also if there
are hash collisions it'll probably crash because there are entries that
point to freed memory.

So you probably should be doing something like first checking if there
already exists such an entry in hash, and if not then do i_strdup() for
the name before adding it to hash.

I was thinking about adding something like this to v2.0 code, but the
hash table updating is pretty ugly.. I think I'll wait adding this until
I'll do a larger rewrite of LDAP configuration.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Different PROXY for IMAP and POP3 using LDAP-auth

2009-12-13 Thread Ralf Becker
--
For all non german speaking people:

Oliver asked:
In an old posting I've read something about different proxy hosts for
IMAP and POP3.
http://www.dovecot.org/list/dovecot/2008-July/031885.html

I've got the same problem and want to ask you, if there is a patch for
replacing [variable names in] pass_attrs.
---

Hello Oliver,

I've attached the patch I'm using. It works in all 1.1.x versions.

Regards, Ralf


Oliver Eales schrieb am 13.12.2009 01:40:
 Hallo,
 
 ich hatte ein etwas älteres Posting von Ihnen auf der Dovecot
 Mailingliste gefunden bei dem es um unterschiedliche Proxy hosts für
 IMAP und POP3 ging.
 http://www.dovecot.org/list/dovecot/2008-July/031885.html
 
 Ich habe das gleiche Problem und wollte fragen ob sie evtl. einen Patch
 zu Ersetzung der pass_attrs umgesetzt haben.
 
 Danke und viele Grüße,
 Oliver Eales
 
  
 

-- 
__

 Dipl.-Inform. (FH) Ralf Becker Rechenzentrum (r/ft) der FH Trier
 (Network|Mail|Web|Firewall)   University of applied sciences
 Administrator   Schneidershof, D-54293 Trier

   Mail: beck...@fh-trier.deFon: +49 651 8103 499
Web: http://www.fh-trier.de/~beckerrFax: +49 651 8103 214
 PubKey: http://www.fh-trier.de/~beckerr Crypto: GnuPG, S/MIME
__

 Wenn Gott gewollt haette, dass E-Mail in HTML geschrieben wuerden,
 endeten Gebete traditionell mit /amen. (Tom Listen)


dovecot-ldap-attribute-templates.patch.gz
Description: GNU Zip compressed data


[Dovecot] Different PROXY for IMAP and POP3 using LDAP-auth

2008-07-04 Thread Ralf Becker

Hello everybody!

I'm trying to configure dovecot 1.1.1 with different proxy hosts and/or 
ports for different protocols (IMAP, POP3). I'm using LDAP for 
authentication.


I've tried:

1) Variable in auth default configuration:

 [dovecot.conf]

  passdb ldap {
args = /usr/local/etc/dovecot-ldap-%Ls.conf
  }
  userdb ldap {
 args = /usr/local/etc/dovecot-ldap-%Ls.conf
  }

  With results in dovecot not starting with error message:
Can't open configuration file /usr/local/etc/dovecot-ldap-%Ls.conf:
No such file or directory
  So %Ls was not replaced.



2) Variable in pass_attrs

  [dovecot-ldap.conf]

   pass_attrs = \
uid=user,userPassword=password,homeDirectory=userdb_home,\
uidNumber=userdb_uid,gidNumber=userdb_gid,\
dovecotProxy%Ls=proxy,dovecotHost%Ls=host,dovecotPort%Ls=port

   With results in this LDAP server log entries:
 SRCH attr=uid userPassword homeDirectory uidNumber gidNumber
  dovecotProxy%Ls dovecotHost%Ls dovecotPort%Ls

   So %Ls was not replaced also.


mmmh...

Would it be an option to use multiple auth sections?
E.g:
  auth pop3 {
...
passdb ldap {
  args = /usr/local/etc/dovecot-ldap-pop3.conf
}
userdb ldap {
  args = /usr/local/etc/dovecot-ldap-pop3.conf
}
...
  }

  auth imap {
...
passdb ldap {
  args = /usr/local/etc/dovecot-ldap-imap.conf
}
userdb ldap {
  args = /usr/local/etc/dovecot-ldap-imap.conf
}
...
  }

 I'm in doubt because of
 http://markmail.org/message/rcpcm67g56kxxdyq


Any ideas?

Regards, Ralf Becker

--
__

 Dipl.-Inform. (FH) Ralf Becker Rechenzentrum (r/ft) der FH Trier
 (Network|Mail|Web|Firewall)   University of applied sciences
 Administrator   Schneidershof, D-54293 Trier

   Mail: [EMAIL PROTECTED]Fon: +49 651 8103 499
Web: http://www.fh-trier.de/~beckerrFax: +49 651 8103 214
 PubKey: http://www.fh-trier.de/~beckerr Crypto: GnuPG, S/MIME
__

 Wenn Gott gewollt haette, dass E-Mail in HTML geschrieben wuerden,
 endeten Gebete traditionell mit /amen. (Tom Listen)


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [Dovecot] Different PROXY for IMAP and POP3 using LDAP-auth

2008-07-04 Thread Zhang Huangbin

Ralf Becker wrote:

Hello everybody!

I'm trying to configure dovecot 1.1.1 with different proxy hosts 
and/or ports for different protocols (IMAP, POP3). I'm using LDAP for 
authentication.


I've tried: 



Refer to this thread:
http://marc.info/?l=dovecotm=121376558429308w=2

--
Best Regards.

Zhang Huangbin

- iRedMail: Mail Server Solution for Red Hat(R) Enterprise Linux  CentOS 5.x:
 http://iRedMail.googlecode.com/



Re: [Dovecot] Different PROXY for IMAP and POP3 using LDAP-auth

2008-07-04 Thread Timo Sirainen

On Jul 4, 2008, at 2:15 PM, Ralf Becker wrote:


1) Variable in auth default configuration:

[dovecot.conf]

 passdb ldap {
   args = /usr/local/etc/dovecot-ldap-%Ls.conf
 }
 userdb ldap {
args = /usr/local/etc/dovecot-ldap-%Ls.conf
 }

 With results in dovecot not starting with error message:
   Can't open configuration file /usr/local/etc/dovecot-ldap-%Ls.conf:
   No such file or directory
 So %Ls was not replaced.


This is a lot of work to implement.


2) Variable in pass_attrs

 [dovecot-ldap.conf]

  pass_attrs = \
   uid=user,userPassword=password,homeDirectory=userdb_home,\
uidNumber=userdb_uid,gidNumber=userdb_gid,\
   dovecotProxy%Ls=proxy,dovecotHost%Ls=host,dovecotPort%Ls=port

  With results in this LDAP server log entries:
SRCH attr=uid userPassword homeDirectory uidNumber gidNumber
 dovecotProxy%Ls dovecotHost%Ls dovecotPort%Ls

  So %Ls was not replaced also.


This probably wouldn't be difficult to implement, but I'm not sure  
when I have time for it. If you want to try yourself, src/auth/passdb- 
ldap.c and/or db-ldap.c see the existing var_expand() calls.



Would it be an option to use multiple auth sections?
E.g:
 auth pop3 {
 auth imap {


Multiple auth sections don't work in any reasonable way currently.

I don't think you really have any working solutions for LDAP  
currently, other than running two separate Dovecot instances.


PGP.sig
Description: This is a digitally signed message part


Re: [Dovecot] Different PROXY for IMAP and POP3 using LDAP-auth

2008-07-04 Thread Ralf Becker

Hi Timo,

Timo Sirainen schrieb am 04.07.2008 11:08:

2) Variable in pass_attrs

 [dovecot-ldap.conf]

  pass_attrs = \
   uid=user,userPassword=password,homeDirectory=userdb_home,\
uidNumber=userdb_uid,gidNumber=userdb_gid,\
   dovecotProxy%Ls=proxy,dovecotHost%Ls=host,dovecotPort%Ls=port

  With results in this LDAP server log entries:
SRCH attr=uid userPassword homeDirectory uidNumber gidNumber
 dovecotProxy%Ls dovecotHost%Ls dovecotPort%Ls

  So %Ls was not replaced also.


This probably wouldn't be difficult to implement, but I'm not sure when 
I have time for it. If you want to try yourself, src/auth/passdb-ldap.c 
and/or db-ldap.c see the existing var_expand() calls.




Thanks for the hint. I'll have a look to the source.


--
__

 Dipl.-Inform. (FH) Ralf Becker Rechenzentrum (r/ft) der FH Trier
 (Network|Mail|Web|Firewall)   University of applied sciences
 Administrator   Schneidershof, D-54293 Trier

   Mail: [EMAIL PROTECTED]Fon: +49 651 8103 499
Web: http://www.fh-trier.de/~beckerrFax: +49 651 8103 214
 PubKey: http://www.fh-trier.de/~beckerr Crypto: GnuPG, S/MIME
__

 Wenn Gott gewollt haette, dass E-Mail in HTML geschrieben wuerden,
 endeten Gebete traditionell mit /amen. (Tom Listen)


smime.p7s
Description: S/MIME Cryptographic Signature