javax integrated mail function not working

Functionality discussions and feature requests

Moderators: hugo, alexandre, rmvanarkel

Post Reply
niek
Posts: 77
Joined: Sat Sep 24, 2005 11:51 am
Location: The Netherlands
Contact:

javax integrated mail function not working

Post by niek »

I have two inquiries regarding the mail function of Cyclos.

1. My demo users do not have permission to use the 'invite a friend' function; still the 'invite a friend' field is prominent at the bottom of the welcome screen. Thus it would be my change request to have this option to be hidden when it is disabled.

2. The mail function does not work on my UNIX system. My MTA is Exim and it is correctly configured to send mail originating from the local host to the outside world. Still when I try to send a mail from cyclos, I get an error. The log file of Cyclos says

Caused by: javax.mail.SendFailedException: Sending failed;
nested exception is:
class javax.mail.MessagingException: 501 Syntactically invalid HELO argument(s)

at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at nl.strohalm.cyclos.utils.mail.EmailSender.sendEmail(EmailSender.java:97)
... 34 more

Has anone a clue as to how this can be solved?
Last edited by niek on Thu Feb 23, 2006 10:02 am, edited 1 time in total.

rinke
Posts: 87
Joined: Thu Mar 31, 2005 4:54 pm

Re: Mail function

Post by rinke »

niek wrote:I have two inquiries regarding the mail function of Cyclos.

1. My demo users do not have permission to use the 'invite a friend' function; still the 'invite a friend' field is prominent at the bottom of the welcome screen. Thus it would be my change request to have this option to be hidden when it is disabled.
Good point. Thanks for noticing. It is indeed an item to imporve.
niek wrote: 2. The mail function does not work on my UNIX system. My MTA is Exim and it is correctly configured to send mail originating from the local host to the outside world. Still when I try to send a mail from cyclos, I get an error.
As far as I know, the mail function works via the general <a href="mailto:bla@bla.com"> link. But I didn't have to do anything with this functionality, so I will ask somebody else of the team to answer this question.
________________________
Rinke Hoekstra
cyclos project team,
STRO.

luis
Posts: 183
Joined: Fri Feb 17, 2006 11:01 am

Post by luis »

Did you fill in the "E-mail from" setting (under local settings)?
It required for sending e-mails...
Luis Fernando Planella Gonzalez
Cyclos development team

niek
Posts: 77
Joined: Sat Sep 24, 2005 11:51 am
Location: The Netherlands
Contact:

Post by niek »

luis wrote:Did you fill in the "E-mail from" setting (under local settings)?
It required for sending e-mails...
Yes I did.

hugovanderzee
Posts: 98
Joined: Wed Apr 06, 2005 9:56 am

Post by hugovanderzee »

Hoi Niek,

It could be that your mta does not handle the smtp commands correctly. Can you check if it works with an external smtp server?. For example the smtp of your internet provider?
Hugo van der Zee
Cyclos development team

niek
Posts: 77
Joined: Sat Sep 24, 2005 11:51 am
Location: The Netherlands
Contact:

Post by niek »

Thanks for the reply Hugo.

Using the smtp server of my upstream provider is not an option, as I don't have one for this server.

I want to correct the java code that takes care of sending the mail, where do I find it? Apparently I have to make sure that the HELO is submitted correctly.

luis
Posts: 183
Joined: Fri Feb 17, 2006 11:01 am

Post by luis »

The class for sending mail is nl.strohalm.cyclos.utils.mail.EmailSender.
It is just a wrapper arround JavaMail.
If you leave the "Email from" setting empty, you will always get a "501 Syntactically invalid HELO argument(s)" from the server...
You could run that class in a standalone class and make some tests... You will need cyclos.jar, activation.jar and mail.jar on the classpath.
Please, tell us if you notice something wrong...
Luis Fernando Planella Gonzalez
Cyclos development team

niek
Posts: 77
Joined: Sat Sep 24, 2005 11:51 am
Location: The Netherlands
Contact:

Post by niek »

Thanks Luis,
I will have a look at that. Either I have to specify an extra parameter for the javamail fuction, or that function itself does not work properly in my system.

niek
Posts: 77
Joined: Sat Sep 24, 2005 11:51 am
Location: The Netherlands
Contact:

Post by niek »

Problem is solved partially. The cause was an empty EHLO sent to the MTA (hostname not returned). As a workaround I have changed the EmailSender class to provide the hostname and that works for me. This seems to be a known problem, as I found this sample code for solving it.
Now the mail function log file shows:

DEBUG: JavaMail version 1.3.1
DEBUG: java.io.FileNotFoundException: /usr/local/jdk1.5.0/jre/lib/javamail.providers (No such file or directory)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: java.io.FileNotFoundException: /usr/local/jdk1.5.0/jre/lib/javamail.address.map (No such file or directory)
23:44:01,224 INFO cyclos2_trace:133 - [invite] - [member#3 ()] - Returned, arguments: mail@address.com

BTW Cyclos version is 20060324.

Post Reply