Note that there are some explanatory texts on larger screens.

plurals
  1. POWorkaround for PHP IMAP functions? Trying to work with incoming email on localhost using XAMPP
    primarykey
    data
    text
    <p>In the project I am working on right now, I am trying to add the functionality where I can change the status of a ticket from 'closed' to 'reopened' when the user sends an email to the support desk. I would also like to save their email reply to the database.</p> <p>The problem I am running into is that I cannot get PHP's IMAP functions to work on my current Apache configuration. From looking at quite a few posts here at stackoverflow and other places, it seems that the problem is OpenSSL is not enabled in the standard configuration. So for example, when I run this code: </p> <pre><code>&lt;h1&gt;IMAP testing!&lt;/h1&gt; &lt;?php $connect = "{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX"; $user = "my email address @gmail.com"; $pass = "my password"; $mailbox = imap_open($connect, $user, $pass); ?&gt; </code></pre> <p>I get the error: </p> <pre><code>Can't open mailbox {imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX: invalid remote specification. </code></pre> <p>Is there anything I can do, short of recompiling PHP, to mimic IMAP functionality on my local machine to be able to continue developing the functionality of working with email (email piping)?</p> <p>Some notes on my current configuration, just in case it helps:</p> <ul> <li>OS X 10.7.4</li> <li>PHP v.5.3.1</li> </ul> <p>UPDATE - </p> <p>I am almost there (thanks to dAm2K)!</p> <p>I installed Stunnel (using Mac Ports), got everything configured finally and ran the command:</p> <pre><code>sudo stunnel /opt/local/etc/stunnel/stunnel.conf -c -d 127.0.0.1:443 -r imap.gmail.com:993 </code></pre> <p>(For whatever reason I had to add the path to the .conf file)</p> <p>Now my code looks like this:</p> <pre><code>&lt;?php $connect = "{localhost:443}INBOX"; $user = "my email address @gmail.com"; $pass = "my password"; $mailbox = imap_open($connect, $user, $pass); ?&gt; </code></pre> <p>Now when I load the page, it just hangs for 30 seconds or so and gives the warning: </p> <pre><code>Notice: Unknown: Connection failed to localhost,443: Operation timed out (errflg=2) in Unknown on line 0 </code></pre> <p>What is interesting is that if I change $connect to:</p> <pre><code>$connect = "{localhost:443/ssl}INBOX"; </code></pre> <p>or</p> <pre><code>$connect = "{localhost:443/novalidate-cert}INBOX"; </code></pre> <p>I get the original error, which was:</p> <pre><code>Notice: Unknown: Can't open mailbox {localhost:443/novalidate-cert}INBOX: invalid remote specification (errflg=2) in Unknown on line 0 </code></pre> <p>Any ideas? Just a guess but could it maybe be something to do with the setup of stunnel, like having a self-signed cert or something with the stunnel.conf file I am missing?</p> <p>Thanks a lot.</p> <p>Tim</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload