diff --git a/imap.php b/imap.php index 5f88848..ed55a4a 100644 --- a/imap.php +++ b/imap.php @@ -63,6 +63,9 @@ class imap { // imap_errors() takes the errors and clear the error stack $errors = imap_errors(); + if (substr ($e->getMessage (), 0, 35) === + "Can not authenticate to IMAP server") + throw new Exception ("IMAP error : ".$e->getMessage(), 401); throw new Exception ("IMAP error : ".$e->getMessage(), 500); } }