RE: GNU JavaMail CRAM-MD5 Support
"Jos Collin-ERS,HCLTech" <[email protected]> Tue, 5 Oct 2010 13:31:05 +0530
| Newsgroups | gmane.comp.java.classpath.extensions.javamail |
|---|---|
| Message-ID | <8DEDC34680D63646A30A754A2DC02B163855A78559@CHN-HCLT-EVS07.HCLT.CORP.HCL.IN> |
Thanks=20Chris=20for=20the=20information.
So=20you=20mean,=20I=20have=20to=20set=20the=20property=20mail.smtp.auth.=
mechanisms=20as=20props.put("mail.smtp.auth.mechanisms",=20"CRAM-MD5").=
=20The=20following=20is=20my=20code=20where=20I=20set=20the=20properties.=
=20Also,=20do=20I=20have=20to=20do=20anything=20additional,=20as=20the=20=
CRAM-MD5=20authentication=20is=20different=20from=20PLAIN?=20How=20does=
=20it=20receive=20the=20challenge=20from=20the=20server=20and=20send=20th=
e=20digest=20back?
Thanks,
Jos=20Collin
-----------------------
=20=20=20=20=09//Create=20a=20Properties=20object=20and=20set=20the=20pro=
perties
=20=20=20=20=20=20=20=20Properties=20props=20=3D=20new=20Properties();
=20=20=20=20=20=20=20=20props.put("mail.transport.protocol",=20"smtp");
=20=20=20=20=20=20=20=20props.put("mail.smtp.host",=20SMTP_HOST_NAME);
=20=20=20=20=20=20=20=20props.put("mail.smtp.port",=20SMTP_HOST_PORT);
=20=20=20=20=20=20=20=20props.put("mail.smtp.auth",=20"true");=20
=20=20=20=20=20=20=20=20props.put("mail.smtp.ssl.enable",=20"true");
=20=20=20=20=20=20=20=20//Authenticator=20can=20be=20used=20only=20by=20c=
reating=20a=20child=20class
=20=20=20=20=20=20=20=20Authenticator=20auth=20=3D=20new=20SMTPAuthentica=
tor();
=20=20=20=20=20=20=20=20
=20=20=20=20=20=20=20=20//=20Create=20a=20session=20using=20the=20authent=
icator=20object
=20=20=20=20=20=20=20=20Session=20mailSession=20=3D=20Session.getDefaultI=
nstance(props,=20auth);
=20=20=20=20=20=20=20=20
=20=20=20=20=20=20=20=20Transport=20transport=20=3D=20mailSession.getTran=
sport();
________________________________________
From:=20Chris=20Burdess=20[[email protected]]
Sent:=20Tuesday,=20October=2005,=202010=201:17=20PM
To:[email protected]
Cc:=20Jos=20Collin-ERS,HCLTech
Subject:=20Re:=20[Classpathx-javamail]=20GNU=20JavaMail=20CRAM-MD5=20Supp=
ort
Jos=20Collin-ERS,HCLTech=20wrote:
>=20I'm=20using=20GNU=20JavaMail=20in=20my=20program.=20I'm=20using=20a=
=20PLAIN=20SMTP=20Authentication=20right=20now.=20But=20my=20SMTP=20serve=
r=20is=20configured=20to=20use=20CRAM-MD5.=20So=20I=20want=20to=20know=20=
whether=20GNU=20JavaMail=20supports=20CRAM-MD5=20authentication=20for=20S=
MTP.
Yes=20it=20does.
If=20for=20some=20reason=20it=20keeps=20falling=20back=20to=20PLAIN,=20it=
=20may=20be=20that=20the=20server=20is=20presenting=20the=20authenticatio=
n=20mechanisms=20in=20the=20"wrong"=20order.=20You=20can=20override=20the=
=20order=20in=20which=20authentication=20mechanisms=20are=20attempted=20b=
y=20the=20client=20by=20setting=20the=20mail.smtp.auth.mechanisms=20sessi=
on=20property=20(e.g.=20"mail.smtp.auth.mechanisms=3DCRAM-MD5,PLAIN,LOGIN=
"),=20see=20the=20SMTP=20provider=20package=20JavaDoc=20for=20more=20info=
rmation.
--
Chris=20Burdess
DISCLAIMER:
-------------------------------------------------------------------------=
----------------------------------------------
The=20contents=20of=20this=20e-mail=20and=20any=20attachment(s)=20are=20c=
onfidential=20and=20intended=20for=20the=20named=20recipient(s)=20only.=
=20
It=20shall=20not=20attach=20any=20liability=20on=20the=20originator=20or=
=20HCL=20or=20its=20affiliates.=20Any=20views=20or=20opinions=20presented=
=20in=20
this=20email=20are=20solely=20those=20of=20the=20author=20and=20may=20not=
=20necessarily=20reflect=20the=20opinions=20of=20HCL=20or=20its=20affilia=
tes.=20
Any=20form=20of=20reproduction,=20dissemination,=20copying,=20disclosure,=
=20modification,=20distribution=20and=20/=20or=20publication=20of=20
this=20message=20without=20the=20prior=20written=20consent=20of=20the=20a=
uthor=20of=20this=20e-mail=20is=20strictly=20prohibited.=20If=20you=20hav=
e=20
received=20this=20email=20in=20error=20please=20delete=20it=20and=20notif=
y=20the=20sender=20immediately.=20Before=20opening=20any=20mail=20and=20
attachments=20please=20check=20them=20for=20viruses=20and=20defect.
-------------------------------------------------------------------------=
----------------------------------------------