Access denied Can't relate with non-existing EmailAccount record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tao-Lee
    Junior Member
    • Sep 2023
    • 13

    #1

    Access denied Can't relate with non-existing EmailAccount record

    Hi all, a user reported that she could not send emails anymore.
    It has worked all fine and I cannot find something in the logs.
    I am using the latest version (9.0.8) with php version 8.2.28

    When sending a new email or replying on a mail I get this error: Access denied
    Can't relate with non-existing EmailAccount record

    I tried sending test email in the email settings and that works.
    The emails are coming in the groupmail folder.
    Cronjob is working fine.
    Looked at the roles and everything is set wright as far I can see.

    Click image for larger version

Name:	image.png
Views:	45
Size:	32.9 KB
ID:	117165

    Click image for larger version

Name:	image.png
Views:	27
Size:	107.2 KB
ID:	117166


    I have no clue why it suddenly does not work sending emails.

  • victor
    Active Community Member
    • Aug 2022
    • 885

    #2
    - Enable Debug mode: https://docs.espocrm.com/administrat...ng/#debug-mode.
    - Reproduce the error.
    - Submit the EspoCRM error log. EspoCRM log files are located in {ESPO_ROOT}/data/logs/ directory. Most errors are logger there.

    Comment

    • Tao-Lee
      Junior Member
      • Sep 2023
      • 13

      #3
      victor thanks, here is the output:

      [2025-04-30 12:35:32] DEBUG: API (403) Can't relate with non-existing record. entity type: Email, link: emailAccounts.; POST /Email; Input data:
      {"status":"Sending","isRead":true,"isImportant" :fa lse,"inTrash":false,"inArchive":false,"folderId":n ull,"isUsers":false,"isHtml":true,"isSystem":false ,"isJustSent":false,
      "inboundEmailsIds":["675eeb62311180121"],"inboundEmailsNames":{"675eeb62311180121":"som e@e mail.nl"},"emailAccountsIds":["675ef0a5d185e6e75"],
      "emailAccountsNames":{"675ef0a5d185e6e75":"som e@em ail.nl"},"from":"some@email.nl",
      "to":"my@email.nl","cc":"","bcc":"","parentTyp e":n ull,"parentName":null,"parentId":null,"selectTempl ateName":null,
      "selectTemplateId":null,"subject":"test","name ":"t est","attachmentsIds":[],"body":"<p>test</p>","bodyPlain":"test"};
      Route pattern: /{controller}; Route params: Array ( [controller] => Email [action] => create )[2025-04-30 12:35:32] NOTICE: (403) Can't relate with non-existing record. entity type: Email,
      link: emailAccounts. :: POST /Email

      I could see this log today, yesterday I was not able to see this log.

      Comment

      • victor
        Active Community Member
        • Aug 2022
        • 885

        #4
        - Try deleting the old Group Email Account and creating a new one with the correct settings and permissions.
        - Try sending an email as Admin and as Regular User (if the role is set for this user, as in your screenshot).
        - Send emails to existing email addresses. So that you can check the delivery of emails on the mail service side.

        Comment

        • Tao-Lee
          Junior Member
          • Sep 2023
          • 13

          #5
          Originally posted by victor
          - Try deleting the old Group Email Account and creating a new one with the correct settings and permissions.
          - Try sending an email as Admin and as Regular User (if the role is set for this user, as in your screenshot).
          - Send emails to existing email addresses. So that you can check the delivery of emails on the mail service side.
          I have done all of the above, I still get the same error.

          Comment

          • victor
            Active Community Member
            • Aug 2022
            • 885

            #6
            I am unable to reproduce your error. Need a more detailed description of the reproduction steps and screenshots of the real settings for this Email Account.

            Comment

            • Tao-Lee
              Junior Member
              • Sep 2023
              • 13

              #7
              Click image for larger version

Name:	image.png
Views:	0
Size:	166.3 KB
ID:	117296

              Click image for larger version

Name:	image.png
Views:	0
Size:	174.4 KB
ID:	117297

              Click image for larger version

Name:	image.png
Views:	0
Size:	161.9 KB
ID:	117298

              Click image for larger version

Name:	image.png
Views:	0
Size:	270.5 KB
ID:	117299

              In the last screenshot, I just want to compose a email and then I get to see like in screenshot.

              The only thing I could think of is that I had first problem with personal mail that appears in the compose mail as first, that is the email address what is in the user module on the users field so if you forgot your password that it sends to that email address. Strange to see the personal email there so I disabled the personal mail.
              I also had tried to enable it but same error.

              Comment

              • victor
                Active Community Member
                • Aug 2022
                • 885

                #8
                Try clearing the email field in this User's profile and save -> Clear EspoCRM and browser cache -> Refresh the page and try creating and sending an email again.

                Click image for larger version

Name:	image.png
Views:	0
Size:	17.0 KB
ID:	117303

                Comment

                • Tao-Lee
                  Junior Member
                  • Sep 2023
                  • 13

                  #9
                  I have done that with 1 user, same error.

                  I noticed that I try to compose email, I get the error: access denied before I can type the whole email and send it.
                  If I copy paste a email address I dont get the access denied, pressing send gives me the same error.

                  Comment

                  Working...