servicemix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marianna Giacchetta <gmar...@gmail.com>
Subject Re: servicemix-mail provider endpoint
Date Mon, 31 Jan 2011 22:48:13 GMT
I tried this way:

1) the URL "smtps://smtp.gmail.com:587?password=zzzzzz" but I have
this exception:

ERROR - MailComponent                  - Error sending mail...
javax.mail.MessagingException: Could not connect to SMTP host:
smtp.gmail.com, port: 587;nested exception is:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

2) So i tried to change the dest port to 465 (gmail port for SSL), and
here i got another exception:

DEBUG SMTP: connected to host "smtp.gmail.com", port: 465

EHLO mapi-pici
250-mx.google.com at your service, [151.16.107.238]
250-SIZE 35651584
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH
250 ENHANCEDSTATUSCODES
DEBUG SMTP: Found extension "SIZE", arg "35651584"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN XOAUTH"
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Attempt to authenticate
DEBUG SMTP: check mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM
AUTH LOGIN
334 uwzuwzuwzuwzuwz

334 xyzxyzxyzxyzxyzxyz
==   vzxvzxvzxvzxvzxvzx
334 xyzxyzxyzxyzxyzxyz
ERROR - MailComponent                  - Error sending mail...
javax.mail.AuthenticationFailedException: 334 xyzxyzxyzxyzxyzxyz


3) Then i tried this way: i wrote my own marshaler for the mail
consumer endpoint, setting in the MimeMessage the property Geert
suggested me. it doesn't work!

public void convertJBIToMail(MimeMessage mimeMessage, MessageExchange
exchange, NormalizedMessage nmsg,
         String configuredSender) throws javax.mail.MessagingException {
		
         try {
	      Properties props = new Properties();
	      props.put("mail.smtp.starttls.enable", "true");
		
	      Session mailSession = Session.getDefaultInstance(props);
	      mimeMessage = new MimeMessage(mailSession);

              ...
        }


here i get the same exception i got yesterday:

com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a
STARTTLS command first. u9sm4177318wbg.12


any suggestion?
thank you,
Marianna



2011/1/31 Lars Heinemann <lhein@apache.org>:
> Googlemail works fine with Servicemix-mail. I tested it a while ago in both directions.
> If you encounter more problems let us know please.
>
> Best regards,
> Lars
>
> --------------------------------------
>
> Lars Heinemann
> FuseSource
> Email: lhein@fusesource.com
> Web: http://www.fusesource.com
> Blog: http://lhein.blogspot.com
> Twitter: lhein77
>
>
>
>
>
> Am 30.01.2011 um 21:58 schrieb Geert Schuring:
>
>> Seems to me like you are not using the correct URL to connect to an encrypted SMTP
server.
>>
>> Try this one: "smtps://smtp.gmail.com:587?password=zzzzzz"
>>
>> If that doesn't work try setting the following property somehow on the mail sender:
mail.smtp.starttls.enable
>>
>> If true, enables the use of the STARTTLS command (if supported by the server) to
switch the connection to a TLS-protected connection before issuing any login commands. Note
that an appropriate trust store must configured so that the client will trust the server's
certificate. Defaults to false.
>> (Got that from http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html)
>>
>> If that does not work either you could try using a camel-mail endpoint.
>>
>> Let me know how it worked out. Would love to know if this solved your problem.
>>
>> Geert.
>>
>> -----Original Message----- From: Marianna Giacchetta
>> Sent: Sunday, January 30, 2011 1:43 PM
>> To: users@servicemix.apache.org
>> Subject: servicemix-mail provider endpoint
>>
>> hi,
>> i can't config the mail provider endpoint to work properly.
>> i would like to use the gmail outgoing mail server. it uses the SMTP
>> encrypted protocol.
>>
>> i tried with this config in the xbean.xml file:
>>
>> <mail:sender service="services:mail-service"
>>           endpoint="mail-endpoint"
>>           sender="zzzzzz@gmail.com"
>>           receiver="zzzzz@hotmail.it"
>>           debugMode="true"
>>           connection="smtp://smtp.gmail.com:587?password=zzzzzz"/>
>>
>> it gives me this exception:
>>
>> com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a
>> STARTTLS command first. u9sm4177318wbg.12
>>
>>
>>
>> i'm using:
>> servicemix version: 3.3.2
>> OS: ubuntu maverick
>> JVM openjdk 1.6
>>
>>
>>
>> can someone help me? :(
>> thanks,
>> marianna
>>
>>
>
>

Mime
View raw message