till
2008-02-25 f0cc628bdbde05c149527eb00ff4e8a0504e4c61
* bugfix: wouldn't take supplied user/pass from check.php to send smtp email
* removed tabs (DO NOT USE THEM!!!)
* bugfix: $send_headers was not set at all
* decrypt_passwd() shouldn't be necessary anymore (because we "inject" the form params into $CONFIG)



1 files modified
35 ■■■■■ changed files
check.php-dist 35 ●●●●● patch | view | raw | blame | history
check.php-dist
@@ -373,12 +373,8 @@
    ?>
<table border="0">
    <tr>
        <th>
        <h4>SMTP Settings</h4>
        </th>
        <th>
        <h4>IMAP Settings</h4>
        </th>
<th><h4>SMTP Settings</h4></th>
<th><h4>IMAP Settings</h4></th>
    </tr>
    <tr>
        <td valign="top"><?php
@@ -400,7 +396,8 @@
            echo 'pass: <i>not set</i><br/>';
        }
        ?></td>
        <td valign="top"><?php
<td valign="top">
<?php
        echo 'IMAP: ' . CHECK_OK . '<br />';
        if (isset($rctest_config['default_host']) && is_array($rctest_config['default_host'])) {
            echo 'server: '.var_export($rctest_config['default_host'], true).'<br/>';
@@ -426,8 +423,9 @@
?> Recipient:<br />
<?php echo $rctest_config['from']; ?><br />
<br />
<input type="hidden" name="action" value="smtp" /> <input type="submit"
    value="send an email" /></form>
<input type="hidden" name="action" value="smtp" />
<input type="submit" value="send an email" />
</form>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['action'] == 'smtp') {
@@ -436,9 +434,15 @@
        echo CHECK_NOK . '<br />';
        echo '<i>Please edit $rctest_config in ' . basename(__FILE__) . '</i><br />';
    } else {
        $data   = $_POST['smtp_test'];
        $data   = null;
        $CONFIG = $rctest_config;
        if (isset($_POST['smtp_test'])) {
            $data = $_POST['smtp_test'];
            // inject into config array
            $CONFIG['smtp_user'] = $data['user'];
            $CONFIG['smtp_pass'] = $data['pass'];
        }
        require_once 'lib/rc_mail_mime.inc';
        require_once 'include/rcube_smtp.inc';
@@ -452,10 +456,15 @@
        $body = 'This is a test to confirm that RoundCube can send email.';
        $mail_object = new rc_mail_mime();
        $mail_object->headers($headers);
        $send_headers = $mail_object->headers($headers);
        $smtp_response = array();
        if (smtp_mail($rctest_config['from'], $recipients, ($foo = $mail_object->txtHeaders($send_headers)), $body, $smtp_response)) {
        $status = smtp_mail($rctest_config['from'], $recipients,
            ($foo = $mail_object->txtHeaders($send_headers)),
            $body, $smtp_response);
        if ($status) {
            echo CHECK_OK . '<br />';
        } else {
            echo CHECK_NOK;