ICEpush
  1. ICEpush
  2. PUSH-334

Verify and fix the email provider for Cloud Push

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.BETA
    • Fix Version/s: 4.0
    • Component/s: Push Library
    • Labels:
      None
    • Environment:
      Cloud Push

      Description

      Cloud Push supports a number of endpoints as delivery options - native (iOS, Android), SMS, etc. While these are all EE NotificationProvider implementations, the list also includes email - the only option we provide in the open source version of ICEfaces.

      The task is to verify and, if necessary, fix the org.icepush.EmailNotificationProvider that we ship with ICEfaces.

        Activity

        Hide
        Jack Van Ooststroom added a comment -

        In order to verify this I used ICEpush Trunk in combination with NaaS due to its ease of the REST API.

        1. The deployment must contain the mail.jar, otherwise the EmailNotificationProvider doesn't get registered with the MainServlet's OutOfBandNotifier. I noticed the scheme used to register the EmailNotificationProvider is set to "mail", instead of the official "mailto" scheme. I think we should change this to "mailto".
        2. The web.xml must be configured with the appropriate SMTP configuration as follows:
              <!--
                  Default: false
              -->
              <context-param>
                  <param-name>smtp.debug</param-name>
                  <param-value></param-value>
              </context-param>
          
              <!--
                  Default: localhost
              -->
              <context-param>
                  <param-name>smtp.host</param-name>
                  <param-value></param-value>
              </context-param>
          
              <!--
                  Default: 465 (if using TLS or SSL) or 25
              -->
              <context-param>
                  <param-name>smtp.port</param-name>
                  <param-value></param-value>
              </context-param>
          
              <!--
                  Default: nobody@localhost.com
              -->
              <context-param>
                  <param-name>smtp.from</param-name>
                  <param-value></param-value>
              </context-param>
          
              <!--
                  Default: <empty string>
              -->
              <context-param>
                  <param-name>smtp.user</param-name>
                  <param-value></param-value>
              </context-param>
          
              <!--
                  Default: <empty string>
              -->
              <context-param>
                  <param-name>smtp.password</param-name>
                  <param-value></param-value>
              </context-param>
          
              <!--
                  Default: NONE (other options are TLS or SSL)
              -->
              <context-param>
                  <param-name>smtp.security</param-name>
                  <param-value></param-value>
              </context-param>
          

          I used a dummy Gmail account without success and my ICEsoft account with success.

        3. At some point the listen request must contain a valid NotifyBackURI. In this case the e-mail address of the User. I'm not sure how this works or would work with the JavaScript Bridge, but to test I used the REST API of NaaS in order to achieve this. Basically,
          CreatePushID
          POST http://localhost:8080/push/rest/{realm}/push-ids HTTP/1.1
          Accept: application/json
          Content-Type: application/json
          
          {
              "access_token": "<access-token>"
          }
          
          AddGroupMember
          PUT http://localhost:8080/push/rest/{realm}/groups/{group-name}/push-ids/{push-id} HTTP/1.1
          Accept: application/json
          Content-Type: application/json
          
          {
              "access_token": "<access-token>",
              "browser": {
                  "id": "<browser-id>"
              }
          }
          
          Listen
          POST http://localhost:8080/push/rest/{realm}/push-ids/{push-id} HTTP/1.1
          Accept: application/json
          Content-Type: application/json
          
          {
              "access_token": "<access-token>",
              "browser": {
                  "id": "<browser-id>"
              },
              "notify_back": {
                  "uri": "mail:<email-address>"
              }
          }
          
          Push
          POST http://localhost:8080/push/rest/{realm}/groups/{group-name} HTTP/1.1
          Accept: application/json
          Content-Type: application/json
          
          {
              "access_token": "<access-token>",
              "push_configuration": {
                  "subject": "<subject>",
                  "detail": "<detail>"
              }
          }
          

        Though I got this to work with my ICEsoft account, I feel that the EmailNotificationProvider could use some attention to figure out why it didn't work with the Gmail account, test it with a non-ICEsoft and non-Gmail account, test it with SSL and NONE security options, and maybe provide a test (in our bundle) that utilizes the JavaScript Bridge in order to set the User's e-mail address from within the Browser for instance.

        Show
        Jack Van Ooststroom added a comment - In order to verify this I used ICEpush Trunk in combination with NaaS due to its ease of the REST API. The deployment must contain the mail.jar, otherwise the EmailNotificationProvider doesn't get registered with the MainServlet's OutOfBandNotifier. I noticed the scheme used to register the EmailNotificationProvider is set to "mail", instead of the official "mailto" scheme. I think we should change this to "mailto". The web.xml must be configured with the appropriate SMTP configuration as follows: <!-- Default: false --> <context-param> <param-name>smtp.debug</param-name> <param-value></param-value> </context-param> <!-- Default: localhost --> <context-param> <param-name>smtp.host</param-name> <param-value></param-value> </context-param> <!-- Default: 465 ( if using TLS or SSL) or 25 --> <context-param> <param-name>smtp.port</param-name> <param-value></param-value> </context-param> <!-- Default: nobody@localhost.com --> <context-param> <param-name>smtp.from</param-name> <param-value></param-value> </context-param> <!-- Default: <empty string> --> <context-param> <param-name>smtp.user</param-name> <param-value></param-value> </context-param> <!-- Default: <empty string> --> <context-param> <param-name>smtp.password</param-name> <param-value></param-value> </context-param> <!-- Default: NONE (other options are TLS or SSL) --> <context-param> <param-name>smtp.security</param-name> <param-value></param-value> </context-param> I used a dummy Gmail account without success and my ICEsoft account with success. At some point the listen request must contain a valid NotifyBackURI. In this case the e-mail address of the User. I'm not sure how this works or would work with the JavaScript Bridge, but to test I used the REST API of NaaS in order to achieve this. Basically, CreatePushID POST http: //localhost:8080/push/ rest /{realm}/push-ids HTTP/1.1 Accept: application/json Content-Type: application/json { "access_token" : "<access-token>" } AddGroupMember PUT http: //localhost:8080/push/ rest /{realm}/groups/{group-name}/push-ids/{push-id} HTTP/1.1 Accept: application/json Content-Type: application/json { "access_token" : "<access-token>" , "browser" : { "id" : "<browser-id>" } } Listen POST http: //localhost:8080/push/ rest /{realm}/push-ids/{push-id} HTTP/1.1 Accept: application/json Content-Type: application/json { "access_token" : "<access-token>" , "browser" : { "id" : "<browser-id>" }, "notify_back" : { "uri" : "mail:<email-address>" } } Push POST http: //localhost:8080/push/ rest /{realm}/groups/{group-name} HTTP/1.1 Accept: application/json Content-Type: application/json { "access_token" : "<access-token>" , "push_configuration" : { "subject" : "<subject>" , "detail" : "<detail>" } } Though I got this to work with my ICEsoft account, I feel that the EmailNotificationProvider could use some attention to figure out why it didn't work with the Gmail account, test it with a non-ICEsoft and non-Gmail account, test it with SSL and NONE security options, and maybe provide a test (in our bundle) that utilizes the JavaScript Bridge in order to set the User's e-mail address from within the Browser for instance.
        Hide
        Ken Fyten added a comment -

        I've created a new JIRA (ICE-10352) to add a new mobi:cloudPush demo to the showcase to demonstrate using the email provider.

        Marking this resolved.

        Show
        Ken Fyten added a comment - I've created a new JIRA ( ICE-10352 ) to add a new mobi:cloudPush demo to the showcase to demonstrate using the email provider. Marking this resolved.

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: