• Login
  • Register

DNN Forums

A community discussion page. We're starting from scratch, so...let's get the party started!

Can't view SMTP Settings on Settings -> Servers -> Server Settings tab -> SMTP Server tab

You are not authorized to post a reply.
Sort:


New Member


Posts:16
New Member

    I am running DNN 9.1.1. When I go to Settings -> Servers -> Server Settings tab -> SMTP Server tab to adjust the SMTP settings, my DNN site is throwing this error: 

    System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
       at System.Security.Cryptography.CapiSymmetricAlgorithm.DepadBlock(Byte[] block, Int32 offset, Int32 count)
       at System.Security.Cryptography.CapiSymmetricAlgorithm.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
       at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
       at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
       at System.IO.Stream.Close()
       at DotNetNuke.Security.FIPSCompliant.DecryptAES(String encryptedText, String passPhrase, String salt, Int32 iterations)
       at Dnn.PersonaBar.Servers.Services.ServerSettingsSmtpHostController.GetSmtpSettings() in C:\soruce location\PB.Ext\src\Modules\Settings\Dnn.PersonaBar.Servers\Services\ServerSettingsSmtpHostController.cs:line 69

    I have SMTP setup at the Global level only. I debugged the PersonaBar Servers module and in the getSmtpSettings() method, it is checking for portalId (see the code below), which it is returning 0.

    var portalId = PortalSettings.Current.PortalId;

    Further down in the code,  SMTP password for the particular portal is being retrived (see below), which is throwing the above error. If I change the portalId to 1 and it works fine and returns an empty string.

    smtpPassword = PortalController.GetEncryptedString("SMTPPassword", portalId, Config.GetDecryptionkey())

    And, here is the URL the portal UI is using to retrive the SMTP settings:

    http://site name/API/PersonaBar/ServerSettingsSmtpHost/GetSmtpSettings?

    Ok, my questions, why is the code even trying to get the password for portal 0, which doesn't exist? Is my config messed up somewhere where it is ruturning 0 for PortalSettings.Current.PortalId? How do I get the page loading correctly? Any help would be greatly apprecaited.

     



    Veteran Member


    Posts:425
    Veteran Member

      Upgrade to DNN 9.4.4 please



      New Member


      Posts:16
      New Member

        Posted By Timo Breumelhof on 07 Feb 2020 04:21 AM

        Upgrade to DNN 9.4.4 please

        I upgraded to DNN 9.4.4 and still have the same issue. Can't see SMTP settings. Any idea on what's going on?

         

         



        New Member


        Posts:16
        New Member

          This is resolved now. The issue was that we only use Global SMTP to send emails on our DNN and but for some unknown reason there was 'SMTPPassword’' setting saved in PortalSettings table. I think, the password saved was a bad unecryptable password, which was causing the error above. I removed the setting and everything seems to work as expected.

          SQL command to delete the setting: delete PortalSettings where SettingName = ‘SMTPPassword’ and PortalID = 0



          Veteran Member


          Posts:425
          Veteran Member

            ok, thanks for posting your solution, very helpful for other with the same issue :-)

            You are not authorized to post a reply.

            These Forums are dedicated to discussion of DNN Platform.

            For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

            1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
            2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
            3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
            4. No Flaming or Trolling.
            5. No Profanity, Racism, or Prejudice.
            6. Site Moderators have the final word on approving / removing a thread or post or comment.
            7. English language posting only, please.

            Would you like to help us?

            Awesome! Simply post in the forums using the link below and we'll get you started.

            Get Involved