[Building Sakai] mail.smtp.sendpartial

Hedrick Charles hedrick at rutgers.edu
Tue Aug 31 14:37:47 PDT 2010


We regard this as a bug. In any large site there will be invalid addresses. We've fixed it locally. See SAK-12703 for the patch. It looks like this one was for mailtool, The same problem exists in mailsender. Here's a fix in BasicEmailService:

===================================================================
--- kernel/kernel-impl/src/main/java/org/sakaiproject/email/impl/BasicEmailService.java	(revision 2171)
+++ kernel/kernel-impl/src/main/java/org/sakaiproject/email/impl/BasicEmailService.java	(revision 2172)
@@ -755,7 +755,7 @@
 
 		// get a session for our smtp setup, include host, port, reverse-path, and set partial delivery
 		Properties props = createMailSessionProperties();
-
+		props.put("mail.smtp.sendpartial", "true");
 		Session session = Session.getInstance(props);
 
 		// form our Message

I see no reason to make it configurable. Would you ever want mail to fail if some addresses don't exist? It will properly report what was and wasn't sent.

On Aug 30, 2010, at 12:06:27 PM, Carl Hall wrote:

> Unless something looks specifically for "mail.smtp.sendpartial" as a property, setting it in sakai.properties will not have an effect.  There are a couple of mail.smtp.* properties that BasicEmailService looks for but sendpartial is not one of them.
> 
> This is an interesting option for commons-email.  I've not yet found a straightforward setting for this but it should be settable through System.setProperty(..).  I've not tested this and thusly can't make any suggestions around this.  I'm reading through the commons-email code in hopes of getting a better idea of how to add this option.  As I fill in more unit tests for mailsender I should be able to figure something out.
> 
> 
> On Thu, Aug 26, 2010 at 4:47 PM, Omer Piperdi <omer at rice.edu> wrote:
> Thanks Carl. I also saw this in mailsender code..
> 
> Even when I set mail.smtp.sendpartial=true in sakai.properties, MailSender will not send partial if there is an invalid email address in list.. Not sure how to set this properties in org.apache.commons.mail.Email.
> 
> Thanks
> Omer
> 
> 
> 
> On 8/26/2010 3:01 PM, Carl Hall wrote:
> Hi Omer,
> 
> BasicEmailService always sets this property to true.
> 
> BasicEmailService:880
> props.put(propName(MAIL_SENDPARTIAL_T), Boolean.TRUE.toString());
> 
> There's not an option to set this as the current code stands, but I've
> submitted a JIRA with a patch, so keep an eye out for updates.
> http://jira.sakaiproject.org/browse/KNL-570
> 
> Later,
> Carl
> 
> 
> On Mon, Aug 23, 2010 at 5:11 PM, Omer Piperdi <omer at rice.edu
> <mailto:omer at rice.edu>> wrote:
> 
> 
>    Is there a properties in sakai.properties, that will set
>    mail.smtp.sendpartial to set true or false..
> 
>    Does org.sakaiproject.email.impl.BasicEmailService use this property?
> 
>    Thanks
>    Omer
>    _______________________________________________
>    sakai-dev mailing list
>    sakai-dev at collab.sakaiproject.org
>    <mailto:sakai-dev at collab.sakaiproject.org>
> 
>    http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
>    TO UNSUBSCRIBE: send email to
>    sakai-dev-unsubscribe at collab.sakaiproject.org
>    <mailto:sakai-dev-unsubscribe at collab.sakaiproject.org> with a
>    subject of "unsubscribe"
> 
> 
> !DSPAM:2294,4c76ca12145621914274172!
> 
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100831/c1352ac7/attachment.html 


More information about the sakai-dev mailing list