james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike K" <mont...@hotmail.com>
Subject Re: Re: javax.mail.Session access protection
Date Thu, 01 Jan 1970 00:00:00 GMT
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();
        }
    }
}

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
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