Set-up crontab in cPanel and retrieving emails in the inbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ciucaadrian11
    Member
    • Oct 2019
    • 37

    Set-up crontab in cPanel and retrieving emails in the inbox

    Hello,
    I set-up the crontab in cpanel as is mentioned in Menu > Administration > Scheduled Jobs i.e * * * * * cd /home/a123456/mydomain; -f cron.php > /dev/null 2>&1. I have attached the pictures with the method of setting crontab.
    After that I configured the email in espocrm and after I finished configuring IMAP and SMTP and tested, the configuration message was that everything is set ok.
    The issue is that I can send emails from espocrm but in INBOX in espocrm it does not receive any email, even though there are unread emails in my webmail address.

    I also tried to integrate a gmail account using the method to generate App Password. Everything works fine for setting IMAP but for the SMTP I receive error 500 when I make the test.

    I am not sure what I did wrong, if the issue for integration of webmails comes from crontab and what is the reason of issue regarding to the gmail.

    As a note: I think I can't make cd because I don't have root. I don't know how to set the crontab in this situation in cpanel

    Thank you very much for your support!​
    Attached Files
  • yuri
    Member
    • Mar 2014
    • 8795

    #2
    Hi,

    What exactly error do you receive on email sending? It must be logged in the log.

    It could be an intended action on the Google side to force users not to use App Passwords. It's a common practice nowadays: throw random errors when phasing out support.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • ciucaadrian11
      Member
      • Oct 2019
      • 37

      #3
      Hi,
      Thank you for your support. Below is the error:

      [2025-03-30 07:19:39] ERROR: Email sending error: cannot connect to host; error = stream_socket_client(): Unable to connect to ssl://smtp.gmail.com:465 (Unknown error) (errno = 0 )
      [2025-03-30 07:19:39] WARNING: Email sending:unknownError; 0
      [2025-03-30 07:19:39] DEBUG: API (500) sendingFail; POST /Email/sendTest; Input data: {"server":"smtp.gmail.com","port":465,"auth":tr ue, "security":"SSL","username":"ciucaadrian11@gma il.c om","password":null,"authMechanism":"login","fro mN ame":"Admin","fromAddress":"ciucaadrian11@gmail.c o m","type":"emailAccount","id":"67e64443059a1b35 a", "userId":"67e6312380bef40c3","emailAddress":"* **** "}; Route pattern: /Email/sendTest
      [2025-03-30 07:19:39] NOTICE: (500) sendingFail :: POST /Email/sendTest​

      Comment

      • ciucaadrian11
        Member
        • Oct 2019
        • 37

        #4
        This is how I set up SMTP:
        Click image for larger version

Name:	image.png
Views:	24
Size:	41.3 KB
ID:	116363

        Comment

        • victor
          Active Community Member
          • Aug 2022
          • 844

          #5
          For SMTP, replace Port 465 with 587, and in Security, replace SSL with TLS.

          Click image for larger version  Name:	image.png Views:	0 Size:	55.7 KB ID:	116365

          Comment

          • yuri
            Member
            • Mar 2014
            • 8795

            #6
            SSL is almost not used in SMTP nowadays as far as I know. It's been deprecated.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            • ciucaadrian11
              Member
              • Oct 2019
              • 37

              #7
              Hello,
              I modified according to your recommendations. Same issue.

              Click image for larger version

Name:	image.png
Views:	20
Size:	62.2 KB
ID:	116368

              Error from log:
              [2025-03-30 17:24:43] WARNING: E_WARNING: stream_socket_enable_crypto(): Peer certificate CN=`cloud601.c-f.ro' did not match expected CN=`smtp.gmail.com'
              [2025-03-30 17:24:43] ERROR: Email sending error: Unable to connect via TLS
              [2025-03-30 17:24:43] WARNING: Email sending:unknownError; 0​

              Thank you very much for your support!

              Comment

              • ciucaadrian11
                Member
                • Oct 2019
                • 37

                #8
                Maybe this problem is because I can't manage to configure crontab in cPanel (I don't find any instruction how to configure the crontab on a sharing hosting? But I think that the crontab should to work in order to check the messages to retrieve them in inbox.

                Comment

                • yuri
                  Member
                  • Mar 2014
                  • 8795

                  #9
                  I suggest googling the error, or using ChatGPT. It's related to configuration. There cannot be single guideline that would cover any shared hosting.
                  If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                  Comment

                  • ciucaadrian11
                    Member
                    • Oct 2019
                    • 37

                    #10
                    Hello,
                    Thank you very much. I solved with crontab using ChatGPT. Thank you again. All messages are retrieved in my inbox. But the SMTP for gmail is not working yet. Same error yet.

                    Comment

                    • yuri
                      Member
                      • Mar 2014
                      • 8795

                      #11
                      Did you try to look up the error message? There are plenty results. One what I found, is SMTP was disabled on a hosting and needed to be enabled.
                      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                      Comment

                      • ciucaadrian11
                        Member
                        • Oct 2019
                        • 37

                        #12
                        Hi,
                        I spoke with the hosting provider and they told me that there is nothing set on the hosting that blocks SMTP (outgoing emails). As a note: I have set up IMAP and SMTP without any problems for the email address created on my domain, contact@mydomain.com. The problem is only for the SMTP setting on gmail.

                        Comment

                        Working...