james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Serge Knystautas" <ser...@lokitech.com>
Subject Re: Re: javax.mail.Session access protection
Date Sat, 09 Mar 2002 01:23:11 GMT
What are you testing?  You've included a software that connects to the local
mail server and sends a message to "test@localhost".  What are you expecting
it to do?

Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
----- Original Message -----
From: "Mike K" <montsie@hotmail.com>
To: <james-dev@jakarta.apache.org>
Sent: Friday, March 08, 2002 11:40 PM
Subject: Re: Re: javax.mail.Session access protection


> Hi Serge
>
> I have verified the problem with a test. Please can you (or somebody else)
> verify it too.
>
> Test description and source code is below.
>
> Thanx a lot.
>
> Bye michi
>
>
> Test:
>
> start JAMES...
>
> ... add an user called "test"
>
> ... then compile and run JAMESMailSessionHackTest
> javac -classpath .;mail.jar JAMESMailSessionHackTest.java
> java -classpath .;mail.jar;activation.jar JAMESMailSessionHackTest
>
> ... then open an email client application(e.g.. outlook express) and
> connect to the JAMES test user account.
>
> ... then check the inbox. An email should be arrived with the
> subject "JAMESMailSessionHackTest....!!!!!!!!!!!!!!!!!!!"
>
>
> OS:
> Windows 2000
>
> JAMES version:
> JAMES 1.2.2
>
> JavaMail version:
> JavaMail 1.2
>
>
> The source:
>
>
> import java.util.*;
>
> import javax.mail.*;
> import javax.mail.internet.*;
>
> /**
> * This class gets the default mail session from JAMES
> * and sends an email to test@localhost.
> *
> * @author  Michael Kaegi (kam@brainware.ch)
> * @version 1.0
> */
> public class JAMESMailSessionHackTest {
>
>     private Session session;
>
>     public static void main(String[] args) {
>
>         JAMESMailSessionHackTest jt = new JAMESMailSessionHackTest();
>         jt.getMailSession();
>         jt.sendMail();
>     }
>
>     private void getMailSession() {
>
>         Properties props = new Properties();
>         session = Session.getDefaultInstance(props, null);
>     }
>
>     private void sendMail() {
>
>         try {
>
>             System.out.println("Session mail.smtp.host: " +
> session.getProperty("mail.smtp.host"));
>             System.out.println("Session mail.user: " +
> session.getProperty("mail.user"));
>
>             MimeMessage mm = new MimeMessage(session);
>             mm.setFrom(new
> InternetAddress("JAMESMailSessionHackTest@brainware.ch"));
>             mm.addRecipient(Message.RecipientType.TO, new
> InternetAddress("test@localhost"));
>
> mm.setSubject("JAMESMailSessionHackTest....!!!!!!!!!!!!!!!!!!!");
>             mm.setText("Suprise.");
>             Transport.send(mm);
>
>         } catch(Exception e) {
>
>             System.out.println("Exception: ");
>             System.out.println(e);
>             e.printStackTrace();
>         }
>     }
> }


--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message