Planning Analytics

 View Only
Expand all | Collapse all

Enabling email notification in PAW Local - error sending email

  • 1.  Enabling email notification in PAW Local - error sending email

    Posted Tue August 02, 2022 04:29 PM
    One of the new features of Planning Analytics Workspace version 78 is that you can enable email notifications.  I followed the instructions in the link below and was able to get the Email tab to appear.  However, when I try to send an email, it says Sending Email Failed after trying to generate the email.  I looked in the log files trying to find the error to figure out what was causing the error.  Didn't seem to find the error in the logs.  Anyone been able to successfully set this up and how did you troubleshoot any errors?

    Enable email notifications in Planning Analytics Workspace Local


    ------------------------------
    -----------------------------
    Dong Banh
    Principal Consultant
    GrandView Corporation
    -----------------------------
    ------------------------------

    #PlanningAnalyticswithWatson


  • 2.  RE: Enabling email notification in PAW Local - error sending email

    Posted Fri August 05, 2022 01:45 AM
    Hi Dong
    I went through a similar experience a few days ago. Some tips that I came up with after a fair bit of trial and error before I got it to work:
    - to generate the original $env entries for insertion into paw.ps1 config file, copy the new lines from the end of the defaults.ps1 file (note that the 2.0.78 What's New doco that indicates the email variables are required to be added to the defaults.ps1 file is incorrect)
    - include the SENDGRID_API_KEY variable with value set to "" even if you are not using SENDGRID. When I left this out the email sharing option was not available within the book.

    When you get the 'email failed to send' message it is probably due to incorrect format of the EMAIL_SMTP_URL variable. After some experimenting I got the following to work:
    EMAIL_SMTP_URL="smtp://<mail server name.domain name>:25"     
    Insert the actual name of your mail server including domain name between the < > brackets and delete the < > brackets.
    e.g. EMAIL_SMTP_URL="smtp://<smtpserver.excelerated.com.au:25" 
    i.e. compared to the example provided in the doco I dropped the S off SMTPS and I ignored the user name and password and other switches included in the example. This was for use with a microsoft outlook mail server.

    I have raised a support call with with the PA support team to ask them to correct the doco and include a simpler example of the EMAIL_SMTP_URL.

    ------------------------------
    Paul Coggan
    ------------------------------



  • 3.  RE: Enabling email notification in PAW Local - error sending email

    Posted Fri August 05, 2022 09:11 AM

    Hi All,

    After setting up the parameters according to the docs, even considering what Paul suggested I get this weird error message:

    Error: 140034427783040:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:

    {
      library: 'SSL routines',
      function: 'ssl3_get_record',
      reason: 'wrong version number',
      code: 'ESOCKET',
      command: 'CONN'
    }


    Do you have any ideas what to do with this?



    ------------------------------
    Jakub Liszcz
    ------------------------------



  • 4.  RE: Enabling email notification in PAW Local - error sending email

    Posted Fri August 05, 2022 09:11 AM
    Hi All,

    After setting up the parameters according to the docs, even considering what Paul suggested I get this weird error message:


    Error: 140034427783040:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:

    {
      library: 'SSL routines',
      function: 'ssl3_get_record',
      reason: 'wrong version number',
      code: 'ESOCKET',
      command: 'CONN'
    }


    Do you have any ideas how to resolve this?



    ------------------------------
    Jakub Liszcz
    ------------------------------



  • 5.  RE: Enabling email notification in PAW Local - error sending email

    IBM Champion
    Posted Fri August 05, 2022 07:17 PM
    Edited by System Fri January 20, 2023 04:43 PM

    Hi,

    I would recommend working with someone from IT on this who is responsible for the organization's SMTP server – as different configurations will require different settings and they will be your best bet at understanding how your server is set up.

    That being said, I was just testing the functionality and I certainly don't have a full understanding of email servers, nor do I have any desire to. So trial and error was sufficient for my purposes.

    I got it set up and working for both an Office 365 account and a GMAIL account.

     

    Getting Started

    The obvious starting points are to gather details of your SMTP server, the port it uses (for sending email) – it can often have multiple ports available in which case – find out the "preferred" one. Generally speaking:

    • 587 – for TLS
    • 465 – For SSL
    • 25 – This might work (it does for office 365 at least) but general consensus is to not use it as it's often blocked due to SPAM.

    Also, gather the relevant account's email and password. If you are testing this out and using an account with MFA setup you will probably need to generate an "App Password" – this is a unique password that allows an app (e.g. PAW) to bypass the MFA with its own special password.

     

    Relevant Material

    Based on googling the examples provided in the documentation:

    I believe that node.js is being used to send the emails, and nodemailer.com/smtp has documentation covering most of the parameters used in the examples (e.g. ?Secure=true)

    This doesn't cover the tls.rejectUnauthorized=false that is used in the example, but looking that up suggests that in the event that your server can't be verified it will go ahead and send the email anyway… so that sounds like a parameter that I would be cautious about using!

     

    What Worked

    Office 365:

    • $env:EMAIL_SMTP_URL="smtp://<MyUserName>:<MyPassword>@smtp.office365.com:587"
    • $env:EMAIL_SMTP_URL="smtp://<MyUserName>:<MyPassword>@smtp.office365.com:587?secure=true&requireTLS=true"
    • $env:EMAIL_SMTP_URL="smtp://<MyUserName>:<MyPassword>@smtp.office365.com:587?secure=false"

     

    Gmail:

    • $env:EMAIL_SMTP_URL="smtp://<MyUserName>:<MyPassword>@smtp.gmail.com:587"
    • $env:EMAIL_SMTP_URL="smtps://<MyUserName>:<MyPassword>@smtp.gmail.com:465"
    • $env:EMAIL_SMTP_URL="smtps://<MyUserName>:<MyPassword>@smtp.gmail.com:465?secure=true&tls.rejectUnauthorized=false"

    In all cases:
    • $env:ENABLE_EMAIL="true"
    • $env:SENDGRID_API_KEY=""
    • $env:EMAIL_FROM="<An email address that the credentials used in $env:EMAIL_SMTP_URL have access to send from>"

     
    I have not yet tested/tried setting this up wit a Sendgrid API Key.

    Errors

    When you get an error that an email could not be sent, you will be able to see detailed error logs in the folder:

    <PawDirectory>\log\share-app\

    Generally speaking, if you are a novice like me on this stuff googling these error messages won't provide the EXACT answer for PAW but with a bit of deduction, they can point you in the right direction.

     

    The errors I encountered:

    • Error: 33020:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:
      • This appeared when trying to connect to TLS (587) port with the prefix smtps:// and I needed to replace with smtp://
    • Error: Mail command failed: 451 5.7.3 STARTTLS is required to send mail
      • This appeared when using "587?ignoreTLS=true" as per the example for 587… need to remove the "?ignoreTLS=true" section as why would you ever ignore TLS for the port that is specifically intended for TLS…
    • Error: connect ETIMEDOUT 52.97.208.2:465
      • This appeared when I stupidly tried to connect to Office 365 on port 465 which it doesn't use for SMTP
      • I think this error will generally appear when you manage to reach the server but the port isn't open etc.
    • Error: Invalid login: 535-5.7.8 Username and Password not accepted
      • This is what happens if you have the wrong credentials… be happy if you see this as it means you have at least managed to shake hands with the email server!
    • Error: Unexpected socket close
      • This appeared when using only smtp:// prefix for the SSL port (465) – replaced with smtps:// and it worked.
    • Error: Message failed: SendAsDenied; xxx@email.com not allowed to send as yyy@email.com
      • Authentication worked but the EMAIL_FROM parameter is for an account that the authenticated one is not allowed to send from (this is a setting in your exchange server)

     

    Assumptions

    So, some assumptions that are based on my personal trial and error experience:

    • smtps:// prefix seems to be for 465/SSL and smtp:// prefix for 587/TLS.
    • In most cases you can probably get away without using the suffix parameters as the default settings work in most cases. 
    • ignoreTLS=true makes no sense in the example for TLS/587… conversely requireTLS=true worked.

     



    And just to share something that once you notice, you can't stop noticing - this is the text for the email successed message...

     



    ------------------------------
    Declan Rodger
    Technical Director
    Spitfire Analytics
    ------------------------------



  • 6.  RE: Enabling email notification in PAW Local - error sending email

    Posted Thu August 11, 2022 09:47 AM
    Thank you, Declan and Paul.  Your suggestions both helped.  I was able to get it working.

    If IBM could update their documentation with more details like what you've included, Declan, I think that would help others trying to get this working with different mail servers.  Especially which log file to review to find the error message in order to troubleshoot this issue.

    ------------------------------
    -----------------------------
    Dong Banh
    Principal Consultant
    GrandView Corporation
    -----------------------------
    ------------------------------



  • 7.  RE: Enabling email notification in PAW Local - error sending email

    Posted Thu August 11, 2022 10:02 AM
    Hi Dong,

    The documentation for this E-mail notification functionality is under review now.
    I'll post the updated link as it'd be publicly available,

    Best Regards,

    ------------------------------
    Svetlana Pestsova
    IBM Planning Analytics Product Manager
    ------------------------------



  • 8.  RE: Enabling email notification in PAW Local - error sending email

    Posted Fri January 20, 2023 09:42 AM

    Svetlana, this information really needs to go in the official TM1 documentation as a major headline. Currently it's only listed under "2.0.78 - What's new, July 13, 2022" and no where else in https://www.ibm.com/docs/en/planning-analytics/2.0.0

    Googling into this forum post after several hours of searching was the only way I found a solution.

    The information listed here appears to be irrelevant for PAW local e-mail configuration: https://www.ibm.com/docs/en/planning-analytics/2.0.0?topic=only-configure-event-notifications



    ------------------------------
    William Smith
    ------------------------------



  • 9.  RE: Enabling email notification in PAW Local - error sending email

    Posted Fri January 20, 2023 10:02 AM
    Edited by Svetlana Pestsova Fri January 20, 2023 12:12 PM
    Thank you, Willam!

    We'll make sure that the above info is included into the IBM official documentation
    and fix the toast message as well.

    Best regards,
    ------------------------------
    Svetlana Pestsova
    IBM Planning Analytics Product Manager
    ------------------------------



  • 10.  RE: Enabling email notification in PAW Local - error sending email

    Posted Tue January 31, 2023 04:24 PM
    Thank you for all who contributed to this area of functionality,
    We revewed and updated the document on this Enable email  notification subject:
    https://www.ibm.com/docs/en/planning-analytics/2.0.0?topic=only-enable-email-notifications

    ------------------------------
    Svetlana Pestsova
    IBM Planning Analytics Product Manager
    ------------------------------