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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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
    Affects Versions: SVN trunk
         Environment: All
            Reporter: Fabien Carrion
            Priority: Minor
             Fix For: Release Branch 4.0


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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532908 ]

Jacques Le Roux commented on OFBIZ-1256:
----------------------------------------

I would prefer a file than to have to copy a comment and create a file but at least this patch is near the good format (but I had also to indent + lines and the path begin in applications and not root)

Eventually, I was not able to merge it : outdated...

> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Priority: Minor
>             Fix For: Release Branch 4.0
>
>
> 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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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 updated OFBIZ-1256:
-----------------------------------

    Fix Version/s:     (was: Release Branch 4.0)
                   SVN trunk

Actually I guess it's not outdated but because it does not respect the indentation. Also new features can't go to release but trunk.

> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Priority: Minor
>             Fix For: SVN trunk
>
>
> 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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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 ]

Fabien Carrion updated OFBIZ-1256:
----------------------------------

    Attachment: emailssl_diff.patch.gz

Making a file patch and changing to coding style

> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: emailssl_diff.patch.gz
>
>
> 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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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 ]

Fabien Carrion updated OFBIZ-1256:
----------------------------------

    Attachment:     (was: emailssl_diff.patch.gz)

> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: emailssl_diff.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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 ]

Fabien Carrion updated OFBIZ-1256:
----------------------------------

    Attachment: emailssl_diff.patch

done with trunk version,

> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: emailssl_diff.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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 reassigned OFBIZ-1256:
--------------------------------------

    Assignee: Jacques Le Roux

> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: emailssl_diff.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12549770 ]

Jacques Le Roux commented on OFBIZ-1256:
----------------------------------------

I would like to commit this patch if nobody see troubles in it

> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: emailssl_diff.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12549779 ]

BJ Freeman commented on OFBIZ-1256:
-----------------------------------

not sure you want to wait
but I am submitting a patch to he javamail container that allows multiple email accounts for SMTP that is searched by email from


> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: emailssl_diff.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12549820 ]

Jacques Le Roux commented on OFBIZ-1256:
----------------------------------------

Which is the Jira issue number please ?

> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: emailssl_diff.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12549839 ]

BJ Freeman commented on OFBIZ-1256:
-----------------------------------

https://issues.apache.org/jira/browse/OFBIZ-65

> 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
>    Affects Versions: SVN trunk
>         Environment: All
>            Reporter: Fabien Carrion
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: emailssl_diff.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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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 ]

Marco Risaliti updated OFBIZ-1256:
----------------------------------

    Component/s: content

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

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12553901 ]

Chris Howe commented on OFBIZ-1256:
-----------------------------------

First, good job Fabien!

Four minor things on this
1)port = UtilProperties.getPropertyValue("general.properties", "mail.smtp.port", "25");
   this should not have a default value.  While smtp's default port is indeed 25, the default value should remain handled by the Transport

2)ssl = UtilProperties.getPropertyValue("general.properties", "mail.smtp.ssl", "javax.net.ssl.SSLSocketFactory");
   this should not have a default value.  While this is the default ssl socket for JavaMail currently, we need to allow JavaMail to set this in the event of an improvement or change.

maybe:
3)props.put("mail.smtp.socketFactory.port", port);
   Since JavaMail considers mail.smtp.socketFactory.port and mail.smtp.port as separate variables, perhaps we should as well

maybe:
4)http://www.javaworld.com/javatips/jw-javatip115.html claims that we need to add a provider :
  Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider()); to the java security or add it dynamically in this method.  I don't know if we already have it included through the other things going on in OFBiz, but we may want to add it again here dynamically.

I'm attaching the diff to general.properties that would be required if these four points are considered

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

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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.

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12554024 ]

Chris Howe commented on OFBIZ-1256:
-----------------------------------

Looking at BJ's suggestions for the multiple email accounts, it shouldn't affect this issue.

A mutliple account solution would make the appropriate data available in the context.get(""); for what ever account is sending the email.  As a side note to BJ's suggestion, the account information should be stored in the database, not in property files.  The general.properties are simply default configurations to pass to JavaMail if nothing is provided in the context.

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

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12554032 ]

BJ Freeman commented on OFBIZ-1256:
-----------------------------------

the next step was to put all of the configuration that is in the javamail containter in the database.
this would require more discussion about how to implement, using contactMech. contactmech would have to modified for electronic address types
and contact purpose of Default outgoing Mail address.
the javamail container uses a map(store) which in not available to context.get so some more code would have to be added to incorporate this
the current javamail container only deals with getting incoming mail   for a provider
the Added code in the
https://issues.apache.org/jira/browse/OFBIZ-65
provides for which provider to send to and would be depreciated one the issues about dealing with sending emails addresses from
properties.
which is part of the whole
https://issues.apache.org/jira/browse/OFBIZ-1286

I have implemented the contactmech way of sending different emails types to a suppliers.
https://issues.apache.org/jira/browse/OFBIZ-143



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

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12554040 ]

Chris Howe commented on OFBIZ-1256:
-----------------------------------

It appears that Fabien's patch and my previous comment would add the remaining map(store) variables, does it not?

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

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12554046 ]

BJ Freeman commented on OFBIZ-1256:
-----------------------------------

If you wish to put this patch in for expendency then let it be so.
however the answer is no.

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

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12554048 ]

Chris Howe commented on OFBIZ-1256:
-----------------------------------

What additional variables are needed?

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

Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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_12554052 ]

Chris Howe commented on OFBIZ-1256:
-----------------------------------

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.

12