summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Froehlich <bernhard@cacert.org>2019-03-01 22:30:14 +0000
committerBernhard Froehlich <bernhard@cacert.org>2019-03-01 22:30:14 +0000
commit9a4df7b2ba306d76dccc2dcf4aa0c57ec5039d0c (patch)
tree1d6f8951ae1002f3f7ded94136e15837a55cef8b
parentc921f7c56626b003650cf965ac7d1e1d120b8e93 (diff)
downloadcacert-devel-9a4df7b2ba306d76dccc2dcf4aa0c57ec5039d0c.tar.gz
cacert-devel-9a4df7b2ba306d76dccc2dcf4aa0c57ec5039d0c.tar.xz
cacert-devel-9a4df7b2ba306d76dccc2dcf4aa0c57ec5039d0c.zip
(Temporary?) improved error reporting in checkEmail --> bug-1460
-rw-r--r--includes/general.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/includes/general.php b/includes/general.php
index 252981d..4728c78 100644
--- a/includes/general.php
+++ b/includes/general.php
@@ -628,6 +628,7 @@
$line = fgets($fp, 4096);
} while(substr($line, 0, 4) == "220-");
if(substr($line, 0, 3) != "220") {
+ $line = $line . " when talking to $domain";
fclose($fp);
continue;
}
@@ -638,6 +639,7 @@
$has_starttls |= substr(trim($line),4) == "STARTTLS";
} while(substr($line, 0, 4) == "250-");
if(substr($line, 0, 3) != "250") {
+ $line = $line . " when talking to $domain";
fclose($fp);
continue;
}
@@ -648,6 +650,7 @@
$line = fgets($fp, 4096);
} while(substr($line, 0, 4) == "220-");
if(substr($line, 0, 3) != "220") {
+ $line = $line . " when talking to $domain";
fclose($fp);
continue;
}
@@ -659,6 +662,7 @@
$line = fgets($fp, 4096);
} while(substr($line, 0, 4) == "250-");
if(substr($line, 0, 3) != "250") {
+ $line = $line . " when talking to $domain";
fclose($fp);
continue;
}
@@ -669,6 +673,7 @@
$line = fgets($fp, 4096);
} while(substr($line, 0, 4) == "250-");
if(substr($line, 0, 3) != "250") {
+ $line = $line . " when talking to $domain";
fclose($fp);
continue;
}
@@ -678,8 +683,7 @@
$line = fgets($fp, 4096);
} while(substr($line, 0, 4) == "250-");
if(substr($line, 0, 3) != "250") {
- fclose($fp);
- continue;
+ $line = $line . " when talking to $domain";
}
fputs($fp, "QUIT\r\n");
@@ -700,7 +704,11 @@
$query = "insert into `pinglog` set `when`=NOW(), `uid`='".intval($_SESSION['profile']['id'])."',
`email`='$myemail', `result`='Failed to make a connection to the mail server'";
mysqli_query($_SESSION['mconn'], $query);
- return _("Failed to make a connection to the mail server");
+ if ($line) {
+ return $line;
+ } else {
+ return _("Failed to make a connection to the mail server");
+ }
}
function waitForResult($table, $certid, $id = 0, $show = 1)