You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Chris Howe (JIRA)" <ji...@apache.org> on 2007/12/21 23:45:43 UTC

[jira] Issue Comment Edited: (OFBIZ-1256) Send mail through gmail with the javamail api in ofbiz

    [ 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.