click here for details... Sakai Executive Director Position Search now open
Issue Details (XML | Word | Printable)

Key: KNL-229
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Stephen Marquard
Reporter: Stephen Marquard
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Kernel - K1

site notification email missing

Created: 08-Jul-2009 12:01   Updated: 05-Mar-2010 02:46
Component/s: Impl
Affects Version/s: 1.0.10
Fix Version/s: 1.0.12, 1.1.0

Time Tracking:
Not Specified

Issue Links:
Cloners
 

1.0.x Status: Closed


 Description  « Hide
Site notification email (mail when a user is added to a site) is randomly missing. A given front end either works or doesn't work after a restart.

There's a backtrace

2009-07-07 08:52:12,354 WARN http-443-Processor73 org.sakaiproject.email.impl.BasicEmailService - Email.sendMail: exception: Sending fa\
iled;
  nested exception is:
        class javax.mail.AuthenticationFailedException
javax.mail.SendFailedException: Sending failed;
  nested exception is:
        class javax.mail.AuthenticationFailedException
        at javax.mail.Transport.send0(Transport.java:218)
        at javax.mail.Transport.send(Transport.java:102)
        at org.sakaiproject.email.impl.BasicEmailService.sendMessageAndLog(BasicEmailService.java:1081)
        at org.sakaiproject.email.impl.BasicEmailService.sendMail(BasicEmailService.java:477)
        at org.sakaiproject.email.impl.BasicEmailService.sendMail(BasicEmailService.java:285)
        at org.sakaiproject.email.impl.BasicEmailService.send(BasicEmailService.java:546)
        at org.sakaiproject.sitemanage.impl.UserNotificationProviderImpl.notifyAddedParticipant(UserNotificationProviderImpl.java:118)

Rsmart has a fix for 2.5.2 that their release notes say fixed AuthenticationFailedException. However there is no jira associated with it.

I fetched their 2.5.1 and 2.5.2 and diff'ed them. They changed

                Session session = Session.getDefaultInstance(props, null);

to

    Session session = Session.getInstance(props);

I am fairly sure that this is actually the fix. I used a JSP in the context of site-manage and checked the session returned by getDefaultInstance. It had properties that included mail.smtp.auth = true on once of the front ends where we were seeing the failure. Retting the properties in the default instance fixed things. This is going to be hard to test because it often doesn't fail. Here's the jsp I used to look around and also to reset the properties:

<%@ page import="javax.mail.Session" %>
<%@ page import="javax.mail.Transport" %>
<%@ page import="javax.mail.internet.InternetAddress" %>
<%@ page import="javax.mail.internet.MimeMessage" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Properties" %>
<%@ page import="org.sakaiproject.email.cover.EmailService" %>

<%

Properties props = new Properties();
props.put("mail.smtp.host", "rulink.rutgers.edu");
props.put("mail.smtp.port", "25");
props.put("mail.smtp.from", "notifications@sakai.rutgers.edu");
Session s = Session.getDefaultInstance(props, null);
out.println(s.getProperties());
props = s.getProperties();
props.put("mail.smtp.host", "rulink.rutgers.edu");
props.put("mail.smtp.port", "25");
props.put("mail.smtp.auth", false);
props.put("mail.smtp.from", "notifications@sakai.rutgers.edu");
Transport t = s.getTransport(new InternetAddress("hedrick@rutgers.edu"));
out.println(t.getClass());
out.println(s.getProvider("smtp"));



%>
foo



 All   Comments   Work Log   Change History   Subversion Commits   git Commits      Sort Order: Ascending order - Click to sort in descending order
Stephen Marquard added a comment - 25-Jul-2009 11:03
r65195

Applied change as suggested.

Stephen Marquard added a comment - 25-Jul-2009 11:37
Verified that outgoing mail still works on local trunk instance.