File: 1.04.2a/server/test/imap.sh (View as HTML)

  1: #!/usr/bin/php -q
  2: <?php
  3: require("../base/tests.inc.php");
  4: if ($argc<4)
  5:  {
  6:  echo "Usage: imap.sh host user pass [protocol] [port] [ssl]\n";
  7:  exit();
  8:  }
  9: 
 10: $prot="imap";
 11: $port=143;
 12: $ssl=false;
 13: 
 14: if ($argc>4) $prot=$argv[4];
 15: if ($argc>5) $port=$argv[5];
 16: if ($argc>6) $ssl=true;
 17: 
 18: echo "Host: ".$argv[1]."\n";
 19: echo "User: ".$argv[2]."\n";
 20: echo "Prot: ".$prot."\n";
 21: echo "Port: ".$port."\n";
 22: echo "SSL : ";
 23: if ($ssl) echo "Yes";
 24: else echo "No";
 25: echo "\n\nConnection Test\n";
 26: 
 27: $r=imap_test_connect($argv[1],$argv[2],$argv[3],10,$prot,$port,$ssl,true);
 28: 
 29: echo "Result: ".$r."\n";
 30: 
 31: echo "\nConnection Timer\n";
 32: 
 33: $r=imap_test_time($argv[1],$argv[2],$argv[3],10,$prot,$port,$ssl,true);
 34: 
 35: echo "Result: ".$r."\n";
 36: ?>
 37: