OpenWebMail support
Selcuk Yazar <[email protected]> Mon, 22 Aug 2011 15:59:09 +0300
| Newsgroups | gmane.mail.jamm.user |
|---|---|
| Message-ID | <CACBG-R3+4nFyrbmmfrDYwENanMTpmfAOQzYjTwfY3TfRm9VFjA@mail.gmail.com> |
--===============4317192895603348261==
Content-Type: multipart/alternative; boundary=00504502c7e446e4bb04ab17a6ea
--00504502c7e446e4bb04ab17a6ea
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,
How can we user OpenWEbMail with Jamm schemas ?
sub check_userpassword {
# 0 : ok
# -2 : parameter format error
# -3 : authentication system/internal error
# -4 : password incorrect
my ($r_config, $user, $password) =3D @_;
return (-2, 'User or password is null')
if !defined $user || $user eq '' || !defined $password || $password e=
q
'';
my $ldap =3D Net::LDAP->new($ldapHost) or return(-3, "LDAP error $@");
$ldap->bind (dn=3D>"$cn, $dc1, $dc2", password =3D>$pwd) or return(-3, =
"LDAP
error $@");
# Attempt to bind using the username and password provided.
# (For a secure LDAP config, only auth should be allowed for
# any user other than self and rootdn.)
#mail=3Dselcukyazar@*******.edu.tr,ou=3D**********,jvd=3Dtrakya.edu.tr
,o=3Dhosting,dc=3Dmyhosting,dc=3Dexample
my $list =3D $ldap->search(
base =3D> $ldapBase,
filter =3D>
"(&(objectClass=3DJammMailAccount)(mail=3D$user\@********.edu.tr
)(accountActive=3DTRUE)(delete=3DFALSE))",
attrs =3D> ['ou']
) or return(-3, "LDAP error $@");
my $entry =3D $list->entry(0);
my $ou_t =3D $entry->get_value('ou');
undef($ldap); # disconnect
my $mesg =3D $ldap->bind(
dn =3D> "mail=3D$user\@***.edu.tr, $ou_t,
jvd=3D**********.edu.tr,o=3Dhosting,dc=3Dmyhosting,dc=3Dexample",
password =3D> $password
);
undef($ldap); # disconnect
thanks in advance.
--=20
Sel=E7uk YAZAR
http://www.selcukyazar.blogspot.com
--00504502c7e446e4bb04ab17a6ea
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,<div><br></div><div>How can we user OpenWEbMail with Jamm schemas ?</div=
><div><br></div><div><br></div><div><br></div><div><div>sub check_userpassw=
ord {</div><div>=A0 =A0# =A00 : ok</div><div>=A0 =A0# -2 : parameter format=
error</div>
<div>=A0 =A0# -3 : authentication system/internal error</div><div>=A0 =A0# =
-4 : password incorrect</div><div>=A0 =A0my ($r_config, $user, $password) =
=3D @_;</div><div><br></div><div>=A0 =A0return (-2, 'User or password i=
s null')</div>
<div>=A0 =A0 =A0 if !defined $user || $user eq '' || !defined $pass=
word || $password eq '';</div><div><br></div><div>=A0 =A0my $ldap =
=3D Net::LDAP->new($ldapHost) or return(-3, "LDAP error $@");<=
/div><div>
=A0 =A0$ldap->bind (dn=3D>"$cn, $dc1, $dc2", password =3D&g=
t;$pwd) or =A0return(-3, "LDAP error $@");</div><div><br></div><d=
iv>=A0 =A0# Attempt to bind using the username and password provided.</div>=
<div>=A0 =A0# (For a secure LDAP config, only auth should be allowed for</d=
iv>
<div>=A0 =A0# any user other than self and rootdn.)</div><div>=A0 =A0#mail=
=3Dselcukyazar@*******.<a href=3D"http://edu.tr">edu.tr</a>,ou=3D**********=
,jvd=3D<a href=3D"http://trakya.edu.tr">trakya.edu.tr</a>,o=3Dhosting,dc=3D=
myhosting,dc=3Dexample</div>
<div><br></div><div>=A0 =A0my $list =3D $ldap->search(</div><div>=A0 =A0=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 base =A0 =A0=3D> $l=
dapBase,</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 filter =A0=3D> "(&(objectClass=3DJammMailAccount)(mail=3D$u=
ser\@********.<a href=3D"http://edu.tr">edu.tr</a>)(accountActive=3DTRUE)(d=
elete=3DFALSE))",</div>
<div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 attrs =A0 =
=3D> ['ou']</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0) or return(-3, "LDAP error $@");</div><div><br></=
div><div><br></div><div>=A0 =A0my $entry =A0 =3D $list->entry(0);</div>
<div>=A0 =A0my $ou_t =3D $entry->get_value('ou');</div><div><br>=
</div><div>=A0 =A0undef($ldap); # disconnect</div><div><br></div><div>=A0 =
=A0my $mesg =3D $ldap->bind(</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 dn =A0 =A0 =A0 =3D> "mail=3D$user\@***.<a h=
ref=3D"http://edu.tr">edu.tr</a>, $ou_t, jvd=3D**********.<a href=3D"http:/=
/edu.tr">edu.tr</a>,o=3Dhosting,dc=3Dmyhosting,dc=3Dexample",</div>
<div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 password =3D&g=
t; $password</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0)=
;</div><div><br></div><div>=A0 =A0undef($ldap); # disconnect</div></div><di=
v><br></div><div>thanks=A0in advance.</div><div><br clear=3D"all">
<div><br></div>-- <br>Sel=E7uk YAZAR<br><a href=3D"http://www.selcukyazar.b=
logspot.com">http://www.selcukyazar.blogspot.com</a><br>
</div>
--00504502c7e446e4bb04ab17a6ea--
--===============4317192895603348261==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at: http://p.sf.net/sfu/wandisco-dev2dev
--===============4317192895603348261==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Jamm-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jamm-users
--===============4317192895603348261==--