The jndi mail config in
context.xml
looks like this:
<Resource name="mail/Session"
type="javax.mail.Session"
mail.transport.protocol="smtp"
mail.smtp.host="smtp.gmail.com"
mail.smtp.auth="true"
mail.smtp.port="465"
mail.smtp.socketFactory.port="465"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
mail.smtp.user="something@gmail.com"
password="makemyday"
mail.smtp.starttls.enable="true"/>
Note the user is "mail.smtp.user" but the password is just "password". (For more on this, check here and here.
Great. But that's not all. There's a bug in the mailing system causing the password
not to be set right. Or something. With the patch provided, you'll have to recreate some jars.
Get the source:
svn co http://svn.codehaus.org/plexus/tags/plexus-mail-sender-1.0-alpha-7
find
JndiJavamailMailSender.java
and change the return line to return s;
according to the patch (or just use the patch).Run
mvn package
and copy the resulting jar files plexus-mail-sender-javamail-1.0-alpha-7.jar
and plexus-mail-sender-api-1.0-alpha-7.jar
to your continuum installations lib directory. (er, i extracted the .war file into my $CATALINA_HOME/webapps, if you're running the war itself, you need to repackage it).Finally, tweak the sender in WEB-INF/classes/META-INF/plexus/application.xml, look
for the tags
from-mailbox
and from-name
.That's about it.
2 comments:
Tested and working on Continuum 1.2.2 on Debian Etch, Java 1.6.0_05, Tomcat 6.0.16, Maven 2.0.7
Thanks for sharing.
Just for information, I used:
mvn -Dmaven.test.skip=true package
for building the necessary .jar files, because the build was unsuccessful, because of the tests failure.
Post a Comment