* eMail: now supporting umlautdomains on send; using prefs for preset font size/face on compose for reply/forward and messages with preset signature; changes regarding the targetwindow of links in HTML mails; better separation of former mail text to reply text section when forcing reply to HTML, and Source is text only; improved reply header layout on forced conversion

This commit is contained in:
Klaus Leithoff 2013-01-17 11:22:24 +00:00
parent eb29921b3f
commit dd750f217e
5 changed files with 105 additions and 53 deletions

View File

@ -182,11 +182,11 @@
function generateRFC822Address($_addressObject)
{
if(!empty($_addressObject->personal) && !empty($_addressObject->mailbox) && !empty($_addressObject->host)) {
return sprintf('"%s" <%s@%s>', $this->bofelamimail->decode_header($_addressObject->personal), $_addressObject->mailbox, $_addressObject->host);
return sprintf('"%s" <%s@%s>', $this->bofelamimail->decode_header($_addressObject->personal), $_addressObject->mailbox, $this->bofelamimail->decode_header($_addressObject->host,'FORCE'));
} elseif(!empty($_addressObject->mailbox) && !empty($_addressObject->host)) {
return sprintf("%s@%s", $_addressObject->mailbox, $_addressObject->host);
return sprintf("%s@%s", $_addressObject->mailbox, $this->bofelamimail->decode_header($_addressObject->host,'FORCE'));
} else {
return $_addressObject->mailbox;
return $this->bofelamimail->decode_header($_addressObject->mailbox,true);
}
}
@ -251,7 +251,7 @@
if(!$foundAddresses[$val['EMAIL']]) {
$address = $val['PERSONAL_NAME'] != 'NIL' ? $val['RFC822_EMAIL'] : $val['EMAIL'];
$address = $this->bofelamimail->decode_header($address);
$address = $this->bofelamimail->decode_header($address,true);
$this->sessionData['cc'][] = $address;
$foundAddresses[$val['EMAIL']] = true;
}
@ -268,7 +268,7 @@
if(!$foundAddresses[$val['EMAIL']]) {
$address = $val['PERSONAL_NAME'] != 'NIL' ? $val['RFC822_EMAIL'] : $val['EMAIL'];
$address = $this->bofelamimail->decode_header($address);
$address = $this->bofelamimail->decode_header($address,true);
$this->sessionData['to'][] = $address;
$foundAddresses[$val['EMAIL']] = true;
}
@ -285,7 +285,7 @@
if(!$foundAddresses[$val['EMAIL']]) {
$address = $val['PERSONAL_NAME'] != 'NIL' ? $val['RFC822_EMAIL'] : $val['EMAIL'];
$address = $this->bofelamimail->decode_header($address);
$address = $this->bofelamimail->decode_header($address,true);
$this->sessionData['replyto'][] = $address;
$foundAddresses[$val['EMAIL']] = true;
}
@ -302,7 +302,7 @@
if(!$foundAddresses[$val['EMAIL']]) {
$address = $val['PERSONAL_NAME'] != 'NIL' ? $val['RFC822_EMAIL'] : $val['EMAIL'];
$address = $this->bofelamimail->decode_header($address);
$address = $this->bofelamimail->decode_header($address,true);
$this->sessionData['bcc'][] = $address;
$foundAddresses[$val['EMAIL']] = true;
}
@ -474,7 +474,7 @@
if(!$foundAddresses[$val['EMAIL']]) {
$address = $val['PERSONAL_NAME'] != 'NIL' ? $val['RFC822_EMAIL'] : $val['EMAIL'];
$address = $this->bofelamimail->decode_header($address);
$address = $this->bofelamimail->decode_header($address,true);
$oldTo[] = $address;
$foundAddresses[$val['EMAIL']] = true;
}
@ -487,7 +487,7 @@
}
if(!$foundAddresses[$val['EMAIL']]) {
$address = $val['PERSONAL_NAME'] != 'NIL' ? $val['RFC822_EMAIL'] : $val['EMAIL'];
$address = $this->bofelamimail->decode_header($address);
$address = $this->bofelamimail->decode_header($address,true);
$oldTo[] = $address;
$foundAddresses[$val['EMAIL']] = true;
}
@ -513,7 +513,7 @@
if(!$foundAddresses[$val['EMAIL']]) {
$address = $val['PERSONAL_NAME'] != 'NIL' ? $val['RFC822_EMAIL'] : $val['EMAIL'];
$address = $this->bofelamimail->decode_header($address);
$address = $this->bofelamimail->decode_header($address,true);
$this->sessionData['cc'][] = $address;
$foundAddresses[$val['EMAIL']] = true;
}
@ -533,7 +533,7 @@
if(!$foundAddresses[$val['EMAIL']]) {
$address = $val['PERSONAL_NAME'] != 'NIL' ? $val['RFC822_EMAIL'] : $val['EMAIL'];
$address = $this->bofelamimail->decode_header($address);
$address = $this->bofelamimail->decode_header($address,true);
$this->sessionData['to'][] = $address;
$foundAddresses[$val['EMAIL']] = true;
}
@ -552,7 +552,7 @@
if(!$foundAddresses[$val['EMAIL']]) {
$address = $val['PERSONAL_NAME'] != 'NIL' ? $val['RFC822_EMAIL'] : $val['EMAIL'];
$address = $this->bofelamimail->decode_header($address);
$address = $this->bofelamimail->decode_header($address,true);
$this->sessionData['to'][] = $address;
$foundAddresses[$val['EMAIL']] = true;
}
@ -572,34 +572,34 @@
$bodyParts = $bofelamimail->getMessageBody($_uid, ($this->preferencesArray['htmlOptions']?$this->preferencesArray['htmlOptions']:''), $_partID);
//_debug_array($bodyParts);
$fromAddress = felamimail_bo::htmlspecialchars($bofelamimail->decode_header(($headers['FROM'][0]['PERSONAL_NAME'] != 'NIL') ? str_replace(array('<','>'),array('[',']'),$headers['FROM'][0]['RFC822_EMAIL']) : $headers['FROM'][0]['EMAIL']));
$fromAddress = felamimail_bo::htmlspecialchars((($headers['FROM'][0]['PERSONAL_NAME'] != 'NIL') ? str_replace(array('<','>'),array('[',']'),$bofelamimail->decode_header($headers['FROM'][0]['RFC822_EMAIL'],true)) : $bofelamimail->decode_header($headers['FROM'][0]['EMAIL'],true)));
$toAddressA = array();
$toAddress = '';
foreach ($headers['TO'] as $mailheader) {
$toAddressA[] = ($mailheader['PERSONAL_NAME'] != 'NIL') ? $mailheader['RFC822_EMAIL'] : $mailheader['EMAIL'];
$toAddressA[] = trim($bofelamimail->decode_header((($mailheader['PERSONAL_NAME'] != 'NIL') ? $mailheader['RFC822_EMAIL'] : $mailheader['EMAIL']),true));
}
if (count($toAddressA)>0)
{
$toAddress = felamimail_bo::htmlspecialchars($bofelamimail->decode_header(implode(', ', str_replace(array('<','>'),array('[',']'),$toAddressA))));
$toAddress = @htmlspecialchars(lang("to")).": ".$toAddress.($bodyParts['0']['mimeType'] == 'text/html'?"\r\n<br>":"\r\n");;
$toAddress = felamimail_bo::htmlspecialchars(implode(', ', str_replace(array('<','>'),array('[',']'),$toAddressA)));
$toAddress = @htmlspecialchars(lang("to")).": ".$toAddress.($bodyParts['0']['mimeType'] == 'text/html'?"<br>":"\r\n");
}
$ccAddressA = array();
$ccAddress = '';
foreach ($headers['CC'] as $mailheader) {
$ccAddressA[] = ($mailheader['PERSONAL_NAME'] != 'NIL') ? $mailheader['RFC822_EMAIL'] : $mailheader['EMAIL'];
$ccAddressA[] = trim($bofelamimail->decode_header((($mailheader['PERSONAL_NAME'] != 'NIL') ? $mailheader['RFC822_EMAIL'] : $mailheader['EMAIL']),true));
}
if (count($ccAddressA)>0)
{
$ccAddress = felamimail_bo::htmlspecialchars($bofelamimail->decode_header(implode(', ', str_replace(array('<','>'),array('[',']'),$ccAddressA))));
$ccAddress = @htmlspecialchars(lang("cc")).": ".$ccAddress.($bodyParts['0']['mimeType'] == 'text/html'?"\r\n<br>":"\r\n");
$ccAddress = felamimail_bo::htmlspecialchars(implode(', ', str_replace(array('<','>'),array('[',']'),$ccAddressA)));
$ccAddress = @htmlspecialchars(lang("cc")).": ".$ccAddress.($bodyParts['0']['mimeType'] == 'text/html'?"<br>":"\r\n");
}
if($bodyParts['0']['mimeType'] == 'text/html') {
$this->sessionData['body'] = "<br>&nbsp;\r\n<p>".'----------------'.lang("original message").'-----------------'."\r\n".'<br>'.
@htmlspecialchars(lang("from")).": ".$fromAddress."\r\n<br>".
$this->sessionData['body'] = /*"<br>".*/"&nbsp;"."<div>".'----------------'.lang("original message").'-----------------'."".'<br>'.
@htmlspecialchars(lang("from")).": ".$fromAddress."<br>".
$toAddress.$ccAddress.
@htmlspecialchars(lang("date").": ".$headers['DATE'],ENT_QUOTES | ENT_IGNORE,felamimail_bo::$displayCharset, false)."\r\n<br>".
'----------------------------------------------------------'."\r\n</p>";
@htmlspecialchars(lang("date").": ".$headers['DATE'],ENT_QUOTES | ENT_IGNORE,felamimail_bo::$displayCharset, false)."<br>".
'----------------------------------------------------------'."</div>";
$this->sessionData['mimeType'] = 'html';
$this->sessionData['body'] .= '<blockquote type="cite">';
@ -615,18 +615,17 @@
$this->sessionData['body'] .= "<br>".self::_getCleanHTML(translation::convert($bodyParts[$i]['body'], $bodyParts[$i]['charSet']));
#error_log( "GetReplyData (HTML) CharSet:".mb_detect_encoding($bodyParts[$i]['body'] . 'a' , strtoupper($bodyParts[$i]['charSet']).','.strtoupper($this->displayCharset).',UTF-8, ISO-8859-1'));
}
$this->sessionData['body'] .= '</blockquote><br>';
} else {
#$this->sessionData['body'] = @htmlspecialchars(lang("on")." ".$headers['DATE']." ".$bofelamimail->decode_header($fromAddress), ENT_QUOTES) . " ".lang("wrote").":\r\n";
//$this->sessionData['body'] = @htmlspecialchars(lang("on")." ".$headers['DATE']." ".$bofelamimail->decode_header($fromAddress), ENT_QUOTES) . " ".lang("wrote").":\r\n";
// take care the way the ReplyHeader is created here, is used later on in uicompose::compose, in case you force replys to be HTML (prefs)
$this->sessionData['body'] = " \r\n \r\n".'----------------'.lang("original message").'-----------------'."\r\n".
@htmlspecialchars(lang("from")).": ".$fromAddress."\r\n".
$toAddress.$ccAddress.
@htmlspecialchars(lang("date").": ".$headers['DATE'], ENT_QUOTES | ENT_IGNORE,felamimail_bo::$displayCharset, false)."\r\n".
'-------------------------------------------------'."\r\n \r\n ";
$this->sessionData['mimeType'] = 'plain';
for($i=0; $i<count($bodyParts); $i++) {
@ -740,10 +739,11 @@
$address_array = imap_rfc822_parse_adrlist((get_magic_quotes_gpc()?stripslashes($address):$address), '');
foreach((array)$address_array as $addressObject) {
if ($addressObject->host == '.SYNTAX-ERROR.') continue;
$emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$addressObject->host : '');
$_emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$addressObject->host : '');
$emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$bofelamimail->idna2->encode($addressObject->host) : '');
#$emailName = $bofelamimail->encodeHeader($addressObject->personal, 'q');
#$_mailObject->AddAddress($emailAddress, $emailName);
$_mailObject->AddAddress($emailAddress, str_replace(array('@'),' ',($addressObject->personal?$addressObject->personal:$emailAddress)));
$_mailObject->AddAddress($emailAddress, str_replace(array('@'),' ',($addressObject->personal?$addressObject->personal:$_emailAddress)));
}
}
@ -751,10 +751,11 @@
$address_array = imap_rfc822_parse_adrlist((get_magic_quotes_gpc()?stripslashes($address):$address),'');
foreach((array)$address_array as $addressObject) {
if ($addressObject->host == '.SYNTAX-ERROR.') continue;
$emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$addressObject->host : '');
$_emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$addressObject->host : '');
$emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$bofelamimail->idna2->encode($addressObject->host) : '');
#$emailName = $bofelamimail->encodeHeader($addressObject->personal, 'q');
#$_mailObject->AddCC($emailAddress, $emailName);
$_mailObject->AddCC($emailAddress, str_replace(array('@'),' ',($addressObject->personal?$addressObject->personal:$emailAddress)));
$_mailObject->AddCC($emailAddress, str_replace(array('@'),' ',($addressObject->personal?$addressObject->personal:$_emailAddress)));
}
}
@ -762,10 +763,11 @@
$address_array = imap_rfc822_parse_adrlist((get_magic_quotes_gpc()?stripslashes($address):$address),'');
foreach((array)$address_array as $addressObject) {
if ($addressObject->host == '.SYNTAX-ERROR.') continue;
$emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$addressObject->host : '');
$_emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$addressObject->host : '');
$emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$bofelamimail->idna2->encode($addressObject->host) : '');
#$emailName = $bofelamimail->encodeHeader($addressObject->personal, 'q');
#$_mailObject->AddBCC($emailAddress, $emailName);
$_mailObject->AddBCC($emailAddress, str_replace(array('@'),' ',($addressObject->personal?$addressObject->personal:$emailAddress)));
$_mailObject->AddBCC($emailAddress, str_replace(array('@'),' ',($addressObject->personal?$addressObject->personal:$_emailAddress)));
}
}
@ -773,10 +775,11 @@
$address_array = imap_rfc822_parse_adrlist((get_magic_quotes_gpc()?stripslashes($address):$address),'');
foreach((array)$address_array as $addressObject) {
if ($addressObject->host == '.SYNTAX-ERROR.') continue;
$_emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$addressObject->host : '');
$emailAddress = $addressObject->mailbox. (!empty($addressObject->host) ? '@'.$addressObject->host : '');
#$emailName = $bofelamimail->encodeHeader($addressObject->personal, 'q');
#$_mailObject->AddBCC($emailAddress, $emailName);
$_mailObject->AddReplyto($emailAddress, str_replace(array('@'),' ',($addressObject->personal?$addressObject->personal:$emailAddress)));
$_mailObject->AddReplyto($emailAddress, str_replace(array('@'),' ',($addressObject->personal?$addressObject->personal:$_emailAddress)));
}
}

View File

@ -785,21 +785,35 @@ class felamimail_bo
* decode header (or envelope information)
* if array given, note that only values will be converted
* @param mixed $_string input to be converted, if array call decode_header recursively on each value
* @param mixed/boolean $_tryIDNConversion (true/false AND FORCE): try IDN Conversion on domainparts of emailADRESSES
* @return mixed - based on the input type
*/
static function decode_header($_string)
static function decode_header($_string, $_tryIDNConversion=false)
{
if (is_array($_string))
{
foreach($_string as $k=>$v)
{
$_string[$k] = self::decode_header($v);
$_string[$k] = self::decode_header($v, $_tryIDNConversion);
}
return $_string;
}
else
{
return translation::decodeMailHeader($_string,self::$displayCharset);
$_string = translation::decodeMailHeader($_string,self::$displayCharset);
if ($_tryIDNConversion===true && stripos($_string,'@')!==false)
{
$rfcAddr = imap_rfc822_parse_adrlist($_string,'');
if (!isset(self::$idna2)) self::$idna2 = new egw_idna;
//$_string = str_replace($rfcAddr[0]->host,self::$idna2->decode($rfcAddr[0]->host),$_string);
$_string = imap_rfc822_write_address($rfcAddr[0]->mailbox,self::$idna2->decode($rfcAddr[0]->host),$rfcAddr[0]->personal);
}
if ($_tryIDNConversion==='FORCE')
{
//error_log(__METHOD__.__LINE__.'->'.$_string.'='.self::$idna2->decode($_string));
$_string = self::$idna2->decode($_string);
}
return $_string;
}
}
@ -2735,7 +2749,7 @@ class felamimail_bo
return false;
}
//if ($decode) _debug_array($envelope[0]);
return ($decode ? self::decode_header($envelope[0]): $envelope[0]);
return ($decode ? self::decode_header($envelope[0],true): $envelope[0]);
} else {
if( PEAR::isError($headers = $this->icServer->getParsedHeaders($_uid, true, $_partID, true)) ) {
return false;
@ -2750,7 +2764,7 @@ class felamimail_bo
$recepientList = array('FROM', 'TO', 'CC', 'BCC', 'SENDER', 'REPLY_TO');
foreach($recepientList as $recepientType) {
if(isset($headers[$recepientType])) {
if ($decode) $headers[$recepientType] = self::decode_header($headers[$recepientType]);
if ($decode) $headers[$recepientType] = self::decode_header($headers[$recepientType],true);
$addresses = imap_rfc822_parse_adrlist($headers[$recepientType], '');
foreach($addresses as $singleAddress) {
$addressData = array(
@ -2959,9 +2973,9 @@ class felamimail_bo
}
if(is_array($headerObject['FROM']) && is_array($headerObject['FROM'][0])) {
if($headerObject['FROM'][0]['HOST_NAME'] != 'NIL') {
$retValue['header'][$sortOrder[$uid]]['sender_address'] = self::decode_header($headerObject['FROM'][0]['EMAIL']);
$retValue['header'][$sortOrder[$uid]]['sender_address'] = self::decode_header($headerObject['FROM'][0]['EMAIL'],true);
} else {
$retValue['header'][$sortOrder[$uid]]['sender_address'] = self::decode_header($headerObject['FROM'][0]['MAILBOX_NAME']);
$retValue['header'][$sortOrder[$uid]]['sender_address'] = self::decode_header($headerObject['FROM'][0]['MAILBOX_NAME'],true);
}
if($headerObject['FROM'][0]['PERSONAL_NAME'] != 'NIL') {
$retValue['header'][$sortOrder[$uid]]['sender_name'] = self::decode_header($headerObject['FROM'][0]['PERSONAL_NAME']);
@ -2971,9 +2985,9 @@ class felamimail_bo
if(is_array($headerObject['TO']) && is_array($headerObject['TO'][0])) {
if($headerObject['TO'][0]['HOST_NAME'] != 'NIL') {
$retValue['header'][$sortOrder[$uid]]['to_address'] = self::decode_header($headerObject['TO'][0]['EMAIL']);
$retValue['header'][$sortOrder[$uid]]['to_address'] = self::decode_header($headerObject['TO'][0]['EMAIL'],true);
} else {
$retValue['header'][$sortOrder[$uid]]['to_address'] = self::decode_header($headerObject['TO'][0]['MAILBOX_NAME']);
$retValue['header'][$sortOrder[$uid]]['to_address'] = self::decode_header($headerObject['TO'][0]['MAILBOX_NAME'],true);
}
if($headerObject['TO'][0]['PERSONAL_NAME'] != 'NIL') {
$retValue['header'][$sortOrder[$uid]]['to_name'] = self::decode_header($headerObject['TO'][0]['PERSONAL_NAME']);
@ -2987,11 +3001,11 @@ class felamimail_bo
//error_log(__METHOD__.__LINE__."-> $k:".array2string($add));
if($add['HOST_NAME'] != 'NIL')
{
$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]['address'] = self::decode_header($add['EMAIL']);
$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]['address'] = self::decode_header($add['EMAIL'],true);
}
else
{
$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]['address'] = self::decode_header($add['MAILBOX_NAME']);
$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]['address'] = self::decode_header($add['MAILBOX_NAME'],true);
}
if($headerObject['TO'][$k]['PERSONAL_NAME'] != 'NIL')
{
@ -3856,7 +3870,7 @@ class felamimail_bo
if ( PEAR::isError($tretval) ) $isError[$_icServerID] = $tretval->message;
//error_log(__METHOD__." using existing Connection ProfileID:".$_icServerID.' Status:'.print_r($this->icServer->_connected,true));
} else {
//error_log( "-------------------------->open connection for Server with profileID:".$_icServerID.function_backtrace());
//error_log(__METHOD__.__LINE__."->open connection for Server with profileID:".$_icServerID.function_backtrace());
$timeout = felamimail_bo::getTimeOut();
$tretval = $this->icServer->openConnection($_adminConnection,$timeout);
if ( PEAR::isError($tretval) || $tretval===false)

View File

@ -231,6 +231,7 @@
function compose($_focusElement='to',$suppressSigOnTop=false, $isReply=false)
{
//error_log(__METHOD__.__LINE__.array2string($_REQUEST));
if (isset($_GET['reply_id'])) $replyID = $_GET['reply_id'];
// read the data from session
// all values are empty for a new compose window
$insertSigOnTop = false;
@ -399,6 +400,8 @@
{
$sessionData['mimeType'] = 'html';
$sessionData['body'] = "<pre>".$sessionData['body']."</pre>";
// take care this assumption is made on the creation of the reply header in bocompose::getReplyData
if (strpos($sessionData['body'],"<pre> \r\n \r\n---")===0) $sessionData['body'] = substr_replace($sessionData['body']," <br>\r\n<pre>---",0,strlen("<pre> \r\n \r\n---")-1);
}
}
}
@ -636,7 +639,16 @@
{
$disableRuler = true;
}
$font_span ='';
if($sessionData['mimeType'] == 'html' /*&& trim($sessionData['body'])==''*/) {
// User preferences for style
$font = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font'];
$font_size = $GLOBALS['egw_info']['user']['preferences']['common']['rte_font_size'];
$font_span = '<span '.($font?'style="font-family:'.$font.'; ':'').';'.($font_size?'font-size:'.$font_size.'; ':'').'">';
if (empty($font) && empty($font_size)) $font_span = '';
}
//remove possible html header stuff
if (stripos($sessionData['body'],'<html><head></head><body>')!==false) $sessionData['body'] = str_ireplace(array('<html><head></head><body>','</body></html>'),array('',''),$sessionData['body']);
//error_log(__METHOD__.__LINE__.array2string($this->bocompose->preferencesArray));
if (isset($this->bocompose->preferencesArray['insertSignatureAtTopOfMessage']) &&
$this->bocompose->preferencesArray['insertSignatureAtTopOfMessage'] &&
@ -647,6 +659,7 @@
if($sessionData['mimeType'] == 'html') {
$before = ($disableRuler ?'&nbsp;<br>':'&nbsp;<br><hr style="border:1px dotted silver; width:90%;">');
$inbetween = '&nbsp;<br>';
if (!empty($font_span) && !($insertSigOnTop === 'below')) $before = $font_span.$before.'</span>';
} else {
$before = ($disableRuler ?"\r\n\r\n":"\r\n\r\n-- \r\n");
$inbetween = "\r\n";
@ -656,13 +669,18 @@
if ($insertSigOnTop === 'below')
{
$sessionData['body'] = $sessionData['body'].$before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText));
$sessionData['body'] = $font_span.($font_span?'&#8203;</span>':'').$sessionData['body'].$before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText));
}
else
{
$sessionData['body'] = $before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText)).$inbetween.$sessionData['body'];
}
}
else
{
$sessionData['body'] = $font_span.($font_span?($insertSigOnTop?'&#8203;':($isReply||isset($replyID)||empty($sessionData['body'])?'&nbsp;':'')).'</span>':'').$sessionData['body'];
}
//error_log(__METHOD__.__LINE__.$sessionData['body']);
// prepare body
// in a way, this tests if we are having real utf-8 (the displayCharset) by now; we should if charsets reported (or detected) are correct
if (strtoupper($this->displayCharset) == 'UTF-8')

View File

@ -179,6 +179,8 @@
function parseHREF (&$body) {
#echo __METHOD__."called<br>";
$webserverURL = $GLOBALS['egw_info']['server']['webserver_url'];
$fullWebServerUrl = (substr(trim($webserverURL),0,1) == '/'?($GLOBALS['egw_info']['server']['enforce_ssl'] || $_SERVER['HTTPS'] ? 'https://' : 'http://').
($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']):$webserverURL);
$alnum = 'a-z0-9';
#$domain = "(http(s?):\/\/)*";
#$domain .= "([$alnum]([-$alnum]*[$alnum]+)?)";
@ -208,10 +210,17 @@
if (empty($link)) continue;
if ($llink == $link) next($addresses);
#echo $text."#<br>";
#echo $link."#<br>\n";
//error_log(__METHOD__.__LINE__."#". $link."#".$webserverURL."#");
$link = str_replace("\n","",$link);
//$comp_uri = "<a href=\"$webserverURL/redirect.php?go=".$link;
$comp_uri = "<a target=\"_blank\" href=\"".$link;
if (stripos($link,$webserverURL) !== false || stripos($link,$fullWebServerUrl) !== false || substr(trim($link),0,1) == '/')
{
//$comp_uri = "<a href=\"$webserverURL/redirect.php?go=".$link;
$comp_uri = "<a target=\"_top\" href=\"".$link;
}
else
{
$comp_uri = "<a target=\"_blank\" href=\"".$link;
}
$body = str_replace('<a href="'.$link, $comp_uri, $body);
$llink=$link;
}
@ -1170,7 +1179,7 @@ blockquote[type=cite] {
{
$newSenderAddress = felamimail_bo::decode_header($newSenderAddressORG);
$decodedPersonalName = felamimail_bo::decode_header($decodedPersonalName);
$addressData['EMAIL'] = felamimail_bo::decode_header($addressData['EMAIL']);
$addressData['EMAIL'] = felamimail_bo::decode_header($addressData['EMAIL'],true);
}
$realName = $decodedPersonalName;
// add mailaddress
@ -1232,7 +1241,7 @@ blockquote[type=cite] {
}
} else {
$addrEMailORG = $addrEMail = $addressData['EMAIL'];
if ($decode) $addrEMail = felamimail_bo::decode_header($addrEMail);
if ($decode) $addrEMail = felamimail_bo::decode_header($addrEMail,true);
$linkData = array (
'menuaction' => 'felamimail.uicompose.compose',
'send_to' => base64_encode($addressData['EMAIL'])
@ -1608,7 +1617,6 @@ blockquote[type=cite] {
function image_callback($matches)
{
static $cache = array(); // some caching, if mails containing the same image multiple times
$linkData = array (
'menuaction' => 'felamimail.uidisplay.displayImage',
'uid' => $this->uid,

View File

@ -204,9 +204,18 @@ class uifelamimail
self::$icServerID = $GLOBALS['egw_info']['user']['preferences']['felamimail']['ActiveProfileID'] = $imapServer->ImapServerId;
}
echo "<h2>".lang('Test Connection and display basic information about the selected profile')."</h2>";
_debug_array('Connection Reset triggered:'.$connectionReset.' for Profile with ID:'.self::$icServerID);
emailadmin_bo::unsetCachedObjects(self::$icServerID);
if (felamimail_bo::$idna2)
{
_debug_array('Umlautdomains supported (see Example below)');
$dom = 'füßler.com';
$encDom = felamimail_bo::$idna2->encode($dom);
_debug_array(array('source'=>$dom,'result'=>array('encoded'=>$encDom,'decoded'=>felamimail_bo::$idna2->decode($encDom))));
}
if ($preferences->preferences['prefcontroltestconnection'] == 'reset') exit;
echo "<hr /><h3 style='color:red'>".lang('IMAP Server')."</h3>";