Search code examples
phpperformancegmailimap

IMAP gmail connection is very slow


In my CRM online system (made in PHP) I handle IMAP connections. I have problem with gmail... Long times, very long times :/ It always takes 2-4 sec to connect and I cannot speed it up. Somewhere I read that using ip insead of server in imap string {imap.gmail.com:993/ssl} will be good, but there is problem with certificate :/

Does anyone has more ideas??


Solution

  • Try to put IP to your /etc/hosts file and use hostname.It will skip DNS lookup and directly to IP, but certificate should work.By the way, which functions you're use to access IMAP?

    Use this code to ignore certificate problems:

    imap_open ("{IP_OF_GMAIL:995/imap/ssl/novalidate-cert}", "user_id", "password");