* the resulting emails in the right frame.
*
* $Id$
+ * @package squirrelmail
*/
-/* Path for SquirrelMail required files. */
+/** Path for SquirrelMail required files. */
define('SM_PATH','../');
/* SquirrelMail required files. */
require_once(SM_PATH . 'functions/html.php');
require_once(SM_PATH . 'functions/global.php');
require_once(SM_PATH . 'functions/identity.php');
+require_once(SM_PATH . 'functions/mailbox_display.php');
/**
* Given an IMAP message id number, this will look it up in the cached
$rfc822_header->to[] = $header->dnt;
$rfc822_header->subject = _("Read:") . ' ' . encodeHeader($header->subject);
+ // Patch #793504 Return Receipt Failing with <@> from Tim Craig (burny_md)
+ // This merely comes from compose.php and only happens when there is no
+ // email_addr specified in user's identity (which is the startup config)
+ if (ereg("^([^@%/]+)[@%/](.+)$", $username, $usernamedata)) {
+ $popuser = $usernamedata[1];
+ $domain = $usernamedata[2];
+ unset($usernamedata);
+ } else {
+ $popuser = $username;
+ }
$reply_to = '';
$ident = get_identities();
$from_addr = '"'.$full_name.'" <'.$from_mail.'>';
$reply_to = $ident[$identity]['reply_to'];
- if (!$from_addr) {
- $from_addr = "$popuser@$domain";
- $from_mail = $from_addr;
+ if (!$from_mail) {
+ $from_mail = "$popuser@$domain";
+ $from_addr = $from_mail;
}
$rfc822_header->from = $rfc822_header->parseAddress($from_addr,true);
if ($reply_to) {
$header = $message->rfc822_header;
$env = array();
- $env[_("Subject")] = decodeHeader($header->subject);
+ $env[_("Subject")] = str_replace(" "," ",decodeHeader($header->subject));
+
$from_name = $header->getAddr_s('from');
- if (!$from_name) {
+ if (!$from_name)
$from_name = $header->getAddr_s('sender');
- if (!$from_name) {
- $from_name = _("Unknown sender");
- }
- }
- $env[_("From")] = decodeHeader($from_name);
+ if (!$from_name)
+ $env[_("From")] = _("Unknown sender");
+ else
+ $env[_("From")] = decodeHeader($from_name);
$env[_("Date")] = getLongDateString($header->date);
$env[_("To")] = formatRecipientString($header->to, "to");
$env[_("Cc")] = formatRecipientString($header->cc, "cc");
if ($mdn_user_support) {
if ($header->dnt) {
if ($message->is_mdnsent) {
- $env[_("Read receipt")] = _("send");
+ $env[_("Read receipt")] = _("sent");
} else {
$env[_("Read receipt")] = _("requested");
if (!(handleAsSent($mailbox) ||
}
}
echo '<TABLE BGCOLOR="'.$color[9].'" WIDTH="100%" CELLPADDING="1"'.
- ' CELLSPACING="0" BORDER="0" ALIIGN="center">'."\n";
+ ' CELLSPACING="0" BORDER="0" ALIGN="center">'."\n";
echo '<TR><TD HEIGHT="5" COLSPAN="2" BGCOLOR="'.
$color[4].'"></TD></TR><TR><TD align=center>'."\n";
echo $s;
if (isset($sendreceipt)) {
if ( !$message->is_mdnsent ) {
- if (isset($identity) ) {
- $final_recipient = getPref($data_dir, $username, 'email_address' . '0', '' );
- } else {
- $final_recipient = getPref($data_dir, $username, 'email_address', '' );
- }
-
- $final_recipient = trim($final_recipient);
- if ($final_recipient == '' ) {
- $final_recipient = getPref($data_dir, $username, 'email_address', '' );
- }
+ $final_recipient = '';
+ if ((isset($identity)) && ($identity != 0)) //Main identity
+ $final_recipient = trim(getPref($data_dir, $username, 'email_address' . $identity, '' ));
+ if ($final_recipient == '' )
+ $final_recipient = trim(getPref($data_dir, $username, 'email_address', '' ));
$supportMDN = ServerMDNSupport($mbx_response["PERMANENTFLAGS"]);
if ( SendMDN( $mailbox, $passed_id, $final_recipient, $message, $imapConnection ) > 0 && $supportMDN ) {
ToggleMDNflag( true, $imapConnection, $mailbox, $passed_id, $uid_support);