[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554052 ] cjhowe edited comment on OFBIZ-1256 at 12/21/07 2:44 PM: ------------------------------------------------------------- These apear to be all of the variables available for the map(store). The first group is dealt with between the current implementation and Fabiens patch, the second group appears ignored. Is there a need to address any of them? mail.smtp.user mail.smtp.host mail.smtp.port mail.smtp.from mail.smtp.auth mail.smtp.socketFactory.class mail.smtp.socketFactory.fallback mail.smtp.socketFactory.port mail.smtp.starttls.enable mail.smtp.connectiontimeout (default infinite) mail.smtp.timeout (default infinite) mail.smtp.localhost (default InetAddress.getLocalHost().getHostName()) mail.smtp.localaddress (default picked by Socket class) mail.smtp.localport (default picked by Socket class) mail.smtp.ehlo (default true) mail.smtp.submitter mail.smtp.dsn.notify mail.smtp.dsn.ret mail.smtp.allow8bitmime mail.smtp.sendpartial (default false) mail.smtp.sasl.realm mail.smtp.quitwait (default true) mail.smtp.reportsuccess mail.smtp.mailextension mail.smtp.userset (default false) mail.smtp.ssl.protocols mail.smtp.ssl.ciphersuites was (Author: cjhowe): These apear to be all of the variables available for the map(store). The first group is dealt with between the current implementation and Fabiens patch, the second group appears ignored. Is there a need to address any of them? mail.smtp.user mail.smtp.host mail.smtp.port mail.smtp.from mail.smtp.auth mail.smtp.socketFactory.class mail.smtp.socketFactory.fallback mail.smtp.socketFactory.port mail.smtp.starttls.enable mail.smtp.connectiontimeout mail.smtp.timeout mail.smtp.localhost mail.smtp.localaddress mail.smtp.localport mail.smtp.ehlo mail.smtp.submitter mail.smtp.dsn.notify mail.smtp.dsn.ret mail.smtp.allow8bitmime mail.smtp.sendpartial mail.smtp.sasl.realm mail.smtp.quitwait mail.smtp.reportsuccess mail.smtp.mailextension mail.smtp.userset mail.smtp.ssl.protocols mail.smtp.ssl.ciphersuites > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554054 ] BJ Freeman commented on OFBIZ-1256: ----------------------------------- it is not variables but design the design that goes with the mutiple will replace all this and in a different sequence. for instance the structure that stores this into is already in the smtp format. eventually it will be part of the contactmech electronic address > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554057 ] BJ Freeman commented on OFBIZ-1256: ----------------------------------- at this point I suggest that my jira not be linked to this one my comments removed and let this one go foward with chrises guidance > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554098 ] Jacques Le Roux commented on OFBIZ-1256: ---------------------------------------- I'd prefer to keep BJ comments but now the 2 issues are not related anymore. > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554238 ] Jacques Le Roux commented on OFBIZ-1256: ---------------------------------------- Chris, I wonder why you have uncommented mail.smtp.auth.user= mail.smtp.auth.password= in your patch ? And I'm not sure we want mail.notifications.enabled=Y by default > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554263 ] Chris Howe commented on OFBIZ-1256: ----------------------------------- woops..going too fast...i also had smtp.gmail.com as the default mail server. I'll fix it here in a bit > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554264 ] BJ Freeman commented on OFBIZ-1256: ----------------------------------- I can see the properties being uncommented and set to null as long as code checks for a null and give a log error. and add code if the mail.notifications.redirectTo= is null mail.notifications.enabled should be set to N. > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chris Howe updated OFBIZ-1256: ------------------------------ Attachment: (was: gmail.patch) > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chris Howe updated OFBIZ-1256: ------------------------------ Attachment: gmail.patch > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554309 ] Jacques Le Roux commented on OFBIZ-1256: ---------------------------------------- Thanks for update Chris, I will have a look soon. BJ, I understand your POV, but I think we don't need to put this information there (as you did for PayPal) since it is well documented in production setup guide and obvious in general.properties file, thanks for comment. > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-1256. ---------------------------------- Resolution: Fixed Thanks Fabien and Chris, I commited a refactored patch from Fabien and Chris's patch in trunk revision 606789 . Some other code reformating changes in this commit also. > Send mail through gmail with the javamail api in ofbiz > ------------------------------------------------------ > > Key: OFBIZ-1256 > URL: https://issues.apache.org/jira/browse/OFBIZ-1256 > Project: OFBiz > Issue Type: New Feature > Components: content > Affects Versions: SVN trunk > Environment: All > Reporter: Fabien Carrion > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: emailssl_diff.patch, gmail.patch > > > This a small patch to accept ssl connections to smtp servers. > Index: content/src/org/ofbiz/content/email/EmailServices.java > =================================================================== > --- content/src/org/ofbiz/content/email/EmailServices.java (revision 576503) > +++ content/src/org/ofbiz/content/email/EmailServices.java (working copy) > @@ -129,6 +129,8 @@ > > String sendFrom = (String) context.get("sendFrom"); > String sendType = (String) context.get("sendType"); > + String port = (String) context.get("port"); > + String ssl = (String) context.get("ssl"); > String sendVia = (String) context.get("sendVia"); > String authUser = (String) context.get("authUser"); > String authPass = (String) context.get("authPass"); > @@ -151,6 +153,12 @@ > if (authUser != null && authUser.length() > 0) { > useSmtpAuth = true; > } > + if (port == null || port.length() == 0) { > + port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25"); > + } > + if (ssl == null || ssl.length() == 0) { > + ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory"); > + } > } else if (sendVia == null) { > return ServiceUtil.returnError("Parameter sendVia is required when sendType is not mail.smtp.host"); > } > @@ -168,6 +176,14 @@ > try { > Properties props = System.getProperties(); > props.put(sendType, sendVia); > + if (port != null && port.length() > 0) { > + props.put("mail.smtp.port", port); > + props.put("mail.smtp.socketFactory.port", port); > + } > + if (ssl != null && ssl.length() > 0) { > + props.put("mail.smtp.socketFactory.class", ssl); > + props.put("mail.smtp.socketFactory.fallback", "false"); > + } > if (useSmtpAuth) { > props.put("mail.smtp.auth", "true"); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |