0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 01:52:15 +02:00

See what's happening in the shell

This commit is contained in:
Synchro 2015-11-24 19:04:12 +01:00
parent a7aa1491ef
commit 2074c8e5ab
2 changed files with 11 additions and 4 deletions

View File

@ -1961,13 +1961,15 @@ EOT;
public function testPopBeforeSmtpGood()
{
//Start a fake POP server
// $cmd = 'nohup ' .
// escapeshellcmd($this->INCLUDE_DIR . '/test/runfakepopserver.sh') .
// ' >/dev/null 2>/dev/null & printf "%u" $!';
$cmd = 'nohup ' .
escapeshellcmd($this->INCLUDE_DIR . '/test/runfakepopserver.sh') .
' >/dev/null 2>/dev/null & printf "%u" $!';
' & printf "%u" $!';
$pid = shell_exec($cmd);
echo "Running POP3 server $cmd\nPID = $pid\n";
$this->pids[] = $pid;
shell_exec('ps -f --pid ' . escapeshellarg($pid));
sleep(2);
//Test a known-good login
@ -1988,13 +1990,16 @@ EOT;
{
//Start a fake POP server on a different port
//so we don't inadvertently connect to the previous instance
// $cmd = 'nohup ' .
// escapeshellcmd($this->INCLUDE_DIR . '/test/runfakepopserver.sh') .
// ' 1101 >/dev/null 2>/dev/null & printf "%u" $!';
$cmd = 'nohup ' .
escapeshellcmd($this->INCLUDE_DIR . '/test/runfakepopserver.sh') .
' 1101 >/dev/null 2>/dev/null & printf "%u" $!';
' 1101 & printf "%u" $!';
$pid = shell_exec($cmd);
echo "Running POP3 server $cmd\nPID = $pid\n";
$this->pids[] = $pid;
shell_exec('ps -f --pid ' . escapeshellarg($pid));
shell_exec('ps -f -p ' . escapeshellarg($pid));
sleep(2);
//Test a known-bad login

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -xv
# Run the fake pop server from bash
# Idea from http://blog.ale-re.net/2007/09/ipersimple-remote-shell-with-netcat.html
# Defaults to port 1100 so it can be run by unpriv users and not clash with a real server