| | |
| | | * @license http://www.opensource.org/licenses/bsd-license.php The BSD License |
| | | * @version CVS: $Id$ |
| | | * @link https://svn.roundcube.net/trunk |
| | | * @todo Check IMAP settings. |
| | | * @todo Check SMTP settings. |
| | | * @todo HTML/CSS to make it pretty. |
| | | * @todo In devel-next, use bootstrap. |
| | | * @todo Refactor to use RoundCube classes. |
| | | */ |
| | | |
| | | $rctest_config = array(); |
| | | |
| | | /** |
| | | * @var string Please edit this to an email address, such as yourname@example.org. |
| | | * This email address serves as from and to for the test emails. |
| | | */ |
| | | $rctest_config['from'] = '_yourfrom_'; |
| | | |
| | | /* |
| | |
| | | ******************************************** |
| | | ******************************************** |
| | | */ |
| | | |
| | | error_reporting(E_ALL ^E_NOTICE); |
| | | |
| | | $include_path = dirname(__FILE__) . '/program/lib/'; |
| | | $include_path .= PATH_SEPARATOR; |
| | |
| | | From correctly set: |
| | | <?php |
| | | if ($rctest_config['from'] == '_yourfrom_') { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | } else { |
| | | echo $rctest_config['from'] . '<br /><br />'; |
| | | echo '<i>We do not check if this is a <b>valid</b> email address. Since this serves as from & to, make sure it is correct!</i>'; |
| | |
| | | foreach ($writable_dirs AS $dir) { |
| | | echo "Directory $dir: "; |
| | | if (!is_writable($path . $dir)) { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | } else { |
| | | echo '<span class="success">OK</span>'; |
| | | } |
| | |
| | | if (file_exists($path . $file) && is_readable($path . $file)) { |
| | | echo '<span class="success">OK</span>'; |
| | | } else { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | } |
| | | echo '<br />'; |
| | | } |
| | |
| | | $db->disconnect(); |
| | | $db_working = true; |
| | | } else { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | } |
| | | echo '<br />'; |
| | | } else { |
| | |
| | | $tz_diff = $tz_local - $tz_db; |
| | | |
| | | if ($tz_db != $tz_local) { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | } else { |
| | | echo '<span class="success">OK</span>'; |
| | | } |
| | |
| | | echo '<h4>session.auto_start = 0</h4>'; |
| | | echo 'status: '; |
| | | if ($auto_start == 1) { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | } else { |
| | | echo '<span class="success">OK</span>'; |
| | | } |
| | |
| | | if ($file_uploads == 1) { |
| | | echo '<span class="success">OK</span>'; |
| | | } else { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | } |
| | | |
| | | /* |
| | |
| | | echo 'status: '; |
| | | $save_path = ini_get('session.save_path'); |
| | | if (empty($save_path)) { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | } else { |
| | | echo "<span class="success">OK</span>: $save_path"; |
| | | if (!file_exists($save_path)) { |
| | |
| | | if ($rcmail_config['smtp_user'] == '%u'): |
| | | ?> |
| | | <label>Username:</label><input type="text" name="smtp_test[user]" /> |
| | | <label>Passwort:</label><input type="text" name="smtp_test[pass]" /><br /> |
| | | <label>Password:</label><input type="text" name="smtp_test[pass]" /><br /> |
| | | <?php |
| | | endif; |
| | | endif; |
| | | ?> |
| | | Recipient:<br /> |
| | | <?php echo $rctest_config['from']; ?><br /><br /> |
| | | <input type="hidden" name="action" value="smtp" /> |
| | | <input type="submit" value="send an email" /> |
| | | </form> |
| | | <?php |
| | | if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
| | | if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['action'] == 'smtp') { |
| | | |
| | | echo 'Trying to send email: '; |
| | | if ($rctest_config['from'] == '_yourfrom_') { |
| | | echo '<span class="fail">NOT OK</span></span><br />'; |
| | | echo '<span class="fail">NOT OK</span><br />'; |
| | | echo '<i>Please edit $rctest_config in ' . basename(__FILE__) . '</i><br />'; |
| | | } else { |
| | | |
| | | $data = $_POST['smtp_test']; |
| | | $data = $_POST['smtp_test']; |
| | | $CONFIG = $rcmail_config; |
| | | |
| | | require_once 'Mail.php'; |
| | | require_once 'lib/rc_mail_mime.inc'; |
| | | require_once 'include/rcube_smtp.inc'; |
| | | |
| | | $recipients = $rctest_config['from']; |
| | | |
| | |
| | | |
| | | $body = 'This is a test to confirm that RoundCube can send email.'; |
| | | |
| | | $params = array(); |
| | | $mail_driver = ''; |
| | | |
| | | if ($rcmail_config['smtp_server'] != '') { |
| | | $mail_driver = 'smtp'; |
| | | |
| | | if (isset($data['user'])) { |
| | | $params['username'] = $data['user']; |
| | | $params['password'] = $data['pass']; |
| | | $params['auth'] = true; |
| | | } |
| | | |
| | | $params['host'] = $rcmail_config['smtp_server']; |
| | | $params['port'] = $rcmail_config['smtp_port']; |
| | | |
| | | } else { |
| | | $mail_driver = 'mail'; |
| | | } |
| | | |
| | | $mail_object =& Mail::factory($mail_driver, $params); |
| | | $status = $mail_object->send($recipients, $headers, $body); |
| | | if (!PEAR::isError($status)) { |
| | | $mail_object = new rc_mail_mime(); |
| | | $mail_object->headers($headers); |
| | | |
| | | $smtp_response = array(); |
| | | if (smtp_mail($rctest_config['from'], $recipients, ($foo = $mail_object->txtHeaders($send_headers)), $body, $smtp_response)) { |
| | | echo '<span class="success">OK</span><br />'; |
| | | } else { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<br />' . $status->getMessage(); |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | echo '<br />' . join('<br />', $smtp_response); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | echo '<span class="fail">NOT OK</span></span>'; |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | } |
| | | ?> |
| | | <h3>Test IMAP settings</h3> |
| | | <?php |
| | | if ($rcmail_config['default_host'] == '') { |
| | | echo '<span class="fail">We cannot test, default_host is not set in config/main.inc.php.</span>'; |
| | | } else { |
| | | ?> |
| | | <form action="check.php" method="post"> |
| | | <label>Username:</label><input type="text" name="imap_test[user]" /> |
| | | <label>Password:</label><input type="text" name="imap_test[pass]" /><br /><br /> |
| | | <input type="hidden" name="action" value="imap" /> |
| | | <input type="submit" value="check email" /> |
| | | </form><br /><br /> |
| | | <?php |
| | | if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['action'] == 'imap') { |
| | | |
| | | echo 'Testing IMAP connect: '; |
| | | |
| | | $data = $_POST['imap_test']; |
| | | |
| | | require_once 'imap.inc'; |
| | | global $iil_error, $ICL_PORT; |
| | | |
| | | $ICL_PORT = $rcmail_config['default_port']; |
| | | $result = iil_Connect($rcmail_config['default_host'], |
| | | $data['user'], $data['pass']); |
| | | |
| | | if ($result != true) { |
| | | echo '<span class="fail">NOT OK</span>'; |
| | | echo '<br />' . $iil_error; |
| | | } else { |
| | | echo '<span class="success">OK</span>'; |
| | | } |
| | | echo '<br />'; |
| | | } |
| | | } |
| | | ?> |
| | | </body> |