classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-javamail] Mail 1.0 tar ball problems


From: Fernando Nasser
Subject: [Classpathx-javamail] Mail 1.0 tar ball problems
Date: Wed, 11 May 2005 11:12:27 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

Hi,

We are trying to use Classpathx mail instead of the Sun reference implementation in JPackage.org. We want to use it for Tomcat, JOnAS, Geronimo, anything that currently rely on the proprietary version.

However, we had problems when trying it as a replacement. Is there a new version with this things fixed?

Thansks for your help.

Regards to all,
Fernando


Here is what I got back:

---------------------------------------------------------------
 Hi Fernando,

I tried gnu javamail that you provided us.


Problem #1


It seems there are differences with javamail reference implementation.

In Appendix A of javamail (http://java.sun.com/products/javamail/JavaMail-1.2.pdf)

If mail.smtp.host is not define, it uses mail.host and if the property is not defined, it uses by default local machine.
(page 67).

But it seems that with GNU javamail, it is required :
 Unexpected Exception No SMTP host set (mail.smtp.host)
 javax.mail.MessagingException: No SMTP host set (mail.smtp.host)
 gnu.mail.providers.smtp.SMTPTransport.protocolConnect(Unknown Source)



Problem #2:

There is also other failure on the API :

With sun reference implementation :
$ java -cp mail.jar:. mail.TestJavaMail
Test Passed.

With gnu javamail :
$ java -cp gnu-mail.jar:. mail.TestJavaMail
javax.mail.internet.AddressException: Missing final @domain in string Florent
       at javax.mail.internet.InternetAddress.validate(Unknown Source)
       at javax.mail.internet.InternetAddress.<init>(Unknown Source)
       at javax.mail.internet.InternetAddress.<init>(Unknown Source)
       at mail.TestJavaMail.main(TestJavaMail.java:44)
Test Failed !



Problem (or problems) #3:

Also, there are other problems on the signature of the gnu javamail API which is not compliant with the javamail API

I can give you an example :
Class javax.mail.Service, method queueEvent :*

*http://java.sun.com/j2ee/1.4/docs/api/javax/mail/Service.html#queueEvent(javax.mail.event.MailEvent,%20java.util.Vector)
(or for 1.3 : http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/mail/Service.html#queueEvent(javax.mail.event.MailEvent,%20java.util.Vector)


Then in GNU classpath :
http://savannah.gnu.org/cgi-bin/viewcvs/classpathx/mail/source/javax/mail/Service.java?rev=1.9&content-type=text/vnd.viewcvs-markup

No queueEvent method.


Another issue :
http://java.sun.com/j2ee/1.4/docs/api/javax/mail/Multipart.html#parts
Here parts is a Vector.

And in GNU Classpath, it is a List :

 /**
  * List of BodyPart objects.
  */
 protected List parts;

http://savannah.gnu.org/cgi-bin/viewcvs/classpathx/mail/source/javax/mail/Multipart.java?rev=1.7&content-type=text/vnd.viewcvs-markup

There are other signatures problems. It was just some examples of failures.

So, for now, JOnAS can't use these jars to be J2EE compliant.









Here is the test program:

/**
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 2005 Bull S.A.
 * Contact: address@hidden
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
* --------------------------------------------------------------------------
 * $Id:$
* --------------------------------------------------------------------------
 */
package mail;

import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;

/**
 * Tests InternetAddress class of javax.mail
 * @author Florent Benoit
 */
public class TestJavaMail {

    /**
     * Launch test
     * @param args given arguments for this test
     */
    public static void main(String[] args) {
        InternetAddress inetAddr = null;
        final String testedAddress = "Florent";
        try {
            inetAddr = new InternetAddress(testedAddress);
        } catch (AddressException ae) {
            ae.printStackTrace();
            System.err.println("Test Failed !");
            System.exit(0);
        }
        System.out.println("Test Passed.");
    }

}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]