* - Send mail
* - Save As Draft
*
- * @copyright © 1999-2005 The SquirrelMail Project Team
+ * @copyright © 1999-2006 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
define('SM_PATH','../');
/* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
+include_once(SM_PATH . 'include/validate.php');
require_once(SM_PATH . 'functions/global.php');
require_once(SM_PATH . 'functions/imap.php');
require_once(SM_PATH . 'functions/date.php');
exit();
}
unset($compose_messages[$session]);
-
+
/* if it is resumed draft, delete draft message */
if ( isset($delete_draft)) {
$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, false);
$username, $data_dir, $identity, $idents, $delete_draft,
$mailprio, $compose_new_win, $saved_draft, $mail_sent, $sig_first,
$username, $compose_messages, $composesession, $default_charset,
- $compose_onsubmit;
+ $compose_onsubmit, $oTemplate;
if (checkForJavascript()) {
$onfocus = ' onfocus="alreadyFocused=true;"';
// Plugins that use compose_form hook can add an array entry
// to the globally scoped $compose_onsubmit; we add them up
- // here and format the form tag's full onsubmit handler.
- // Each plugin should use "return false" if they need to
+ // here and format the form tag's full onsubmit handler.
+ // Each plugin should use "return false" if they need to
// stop form submission but otherwise should NOT use "return
// true" to give other plugins the chance to do what they need
// to do; SquirrelMail itself will add the final "return true".
// need to quote accordingly.
if (checkForJavascript()) {
$onsubmit_text = ' onsubmit="';
- if (empty($compose_onsubmit))
+ if (empty($compose_onsubmit))
$compose_onsubmit = array();
- else if (!is_array($compose_onsubmit))
+ else if (!is_array($compose_onsubmit))
$compose_onsubmit = array($compose_onsubmit);
foreach ($compose_onsubmit as $text) {
$text = trim($text);
- if (substr($text, -1) != ';' && substr($text, -1) != '}')
+ if (substr($text, -1) != ';' && substr($text, -1) != '}')
$text .= '; ';
$onsubmit_text .= $text;
}
echo $onsubmit_text . ' return true;"';
}
-
+
echo ">\n";
}
do_hook('compose_bottom');
- echo '</body></html>' . "\n";
+ $oTemplate->display('footer.tpl');
}
$smtpServerAddress, $smtpPort, $user, $pass, $authPop);
} elseif (!$draft) {
require_once(SM_PATH . 'class/deliver/Deliver_SendMail.class.php');
- global $sendmail_path;
- $deliver = new Deliver_SendMail();
+ global $sendmail_path, $sendmail_args;
+ $deliver = new Deliver_SendMail(array('sendmail_args'=>$sendmail_args));
$stream = $deliver->initStream($composeMessage,$sendmail_path);
} elseif ($draft) {
global $draft_folder;
$composeMessage->purgeAttachments();
return $length;
} else {
- $msg = '<br />'.sprintf(_("Error: Draft folder %s does not exist."), $draft_folder);
+ $msg = '<br />'.sprintf(_("Error: Draft folder %s does not exist."), htmlspecialchars($draft_folder));
plain_error_message($msg, $color);
return false;
}
$success = $deliver->finalizeStream($stream);
}
if (!$success) {
+ // $deliver->dlv_server_msg is not always server's reply
$msg = $deliver->dlv_msg . '<br />' .
_("Server replied:") . ' ' . $deliver->dlv_ret_nr . ' ' .
$deliver->dlv_server_msg;