incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Holeczek <flor...@holeczek.de>
Subject Re: teaching mailing to JSPWiki
Date Wed, 23 Jan 2008 23:35:41 GMT
Now that I've posted the bug part of the solution to JIRA JSPWIKI-102,
the rest follows here.

My configuration now is:

conf/server.xml in section GlobalNamingResources:
---
    <Resource name="mail/Session" auth="Container"
              type="javax.mail.Session"
              username="xy@somewhere.de"
              password="secret"
              mail.user="xy@somewhere.de"
              mail.password="secret"
              mail.smtp.host="smtp.1und1.de"
              mail.smtp.auth="true"
              mail.smtp.starttls.enable="true"
              description="globale Mailresource für meinen Tomcat-Server zum Verschicken
über 1und1" />
---
If anything goes wrong, you may want to add a line mail.debug="true"
to this section.
As you see, I'm using an SMTP mail server that requires authentication
and supports TLS. The problem with this configuration is that it won't
work if only the mail.user/password are set. These aren't
automatically used for authentication, so authentication fails (an
AuthenticationFailedException is thrown).
Therefore, you have to set username/password to the same values (or
values that authenticate you properly).
I got this information from here:
http://forum.java.sun.com/thread.jspa?threadID=615393&messageID=3422166

Next you have to link this global resource into JSPWiki's Context.
I did this via webapps/<jspwiki>/META-INF/context.xml (Tomcat 6), but
there are several possibilities to do this. Additionally, these differ
in different versions.
---
<Context path="/jspwiki" debug="false">

        <ResourceLink name="mail/Session"
                global="mail/Session"
                type="javax.mail.Session" />

</Context>
---

Then you'll have to uncomment the following section in JSPWiki's
web.xml descriptor:
---
   <resource-ref>
     <description>Resource reference to a container-managed JNDI JavaMail factory for
sending e-mails.</description>
     <res-ref-name>mail/Session</res-ref-name>
     <res-type>javax.mail.Session</res-type>
     <res-auth>Container</res-auth>
   </resource-ref>
---

If your mail factory's resource name differs from "mail/Session",
you'll have to set this name in jspwiki.properties:
---
jspwiki.mail.jndiname=mail/Session
---

As Dave already mentioned, depending on your configuration you may
have to delete JSPWiki's activation.jar and mail.jar.
activation.jar isn't needed if your servlet container runs with Java
1.6+. mail.jar isn't needed if it's already contained in the servlet
container's library path.

Dave, please give it another try with these hints. I'm quite sure it
will work :-)
Then, we can publish this on some wiki page.
Janne, where to put it?

Regards,
 Florian


Mime
View raw message