Title: Error checking connection
Last modified: October 5, 2018

---

# Error checking connection

 *  [deancs](https://wordpress.org/support/users/deancs/)
 * (@deancs)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/error-checking-connection/)
 * Hi, I use gmail under my own domain for email. If I try and setup bounce handling
   I am unable to test the connection. I wrote a piece of PHP that calls imap_open
   with the same parameters and ran it from the server and it successfully connects
   and shows me all the message headers.
 * In /includes/class-mailpoet-handle-bounces.php in function imap_connection_check
   after the call to imap_open you check the connection via if (!$mailbox) (line
   136). This is problematic as depending on the server the response will vary, 
   you need to check if ($mailbox = false).
 * In my case I was then able to test connection and bounce handler is working correctly.
   It may not cover all scenarios but according to php docs for imap_open this returns
   false if there is an error.

The topic ‘Error checking connection’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bounce-handler-mailpoet_cb522b.svg)
 * [Bounce Handler MailPoet 3](https://wordpress.org/plugins/bounce-handler-mailpoet/)
 * [Support Threads](https://wordpress.org/support/plugin/bounce-handler-mailpoet/)
 * [Active Topics](https://wordpress.org/support/plugin/bounce-handler-mailpoet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bounce-handler-mailpoet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bounce-handler-mailpoet/reviews/)

## Tags

 * [gmail](https://wordpress.org/support/topic-tag/gmail/)

 * 0 replies
 * 1 participant
 * Last reply from: [deancs](https://wordpress.org/support/users/deancs/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/error-checking-connection/)
 * Status: not resolved