mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 00:43:20 +01:00
* eMail: introduce config option to define the display of your chosen identity, the list of identities in send and derived from this, the information actively sent within the mailheader regarding the identity used
This commit is contained in:
parent
9be692d00f
commit
f4eca63984
@ -50,6 +50,7 @@
|
||||
} else {
|
||||
$this->preferencesArray['message_forwarding'] = 'asmail';
|
||||
}
|
||||
if (is_null(felamimail_bo::$felamimailConfig)) felamimail_bo::$felamimailConfig = config::read('felamimail');
|
||||
// check if there is a composeid set, and restore the session, if so
|
||||
if (!empty($_composeID))
|
||||
{
|
||||
@ -683,13 +684,6 @@
|
||||
return $this->sessionData;
|
||||
}
|
||||
|
||||
// get the user name, will will use for the FROM field
|
||||
function getUserName()
|
||||
{
|
||||
$retData = sprintf("%s <%s>",$this->preferences['realname'],$this->preferences['emailAddress']);
|
||||
return $retData;
|
||||
}
|
||||
|
||||
function removeAttachment($_attachmentID) {
|
||||
if (parse_url($this->sessionData['attachments'][$_attachmentID]['file'],PHP_URL_SCHEME) != 'vfs') {
|
||||
unlink($this->sessionData['attachments'][$_attachmentID]['file']);
|
||||
@ -720,7 +714,7 @@
|
||||
if ($_identity->id != $activeMailProfile->id && strtolower($activeMailProfile->emailAddress) != strtolower($_identity->emailAddress)) error_log(__METHOD__.__LINE__.' Faking From/SenderInfo for '.$activeMailProfile->emailAddress.' with ID:'.$activeMailProfile->id.'. Identitiy to use for sending:'.array2string($_identity));
|
||||
$_mailObject->Sender = ($_identity->id<0 && $activeMailProfile->id < 0 ? $_identity->emailAddress : $activeMailProfile->emailAddress);
|
||||
$_mailObject->From = $_identity->emailAddress;
|
||||
$_mailObject->FromName = $_mailObject->EncodeHeader($_identity->realName);
|
||||
$_mailObject->FromName = $_mailObject->EncodeHeader(felamimail_bo::generateIdentityString($_identity,false));
|
||||
$_mailObject->Priority = $_formData['priority'];
|
||||
$_mailObject->Encoding = 'quoted-printable';
|
||||
$_mailObject->AddCustomHeader('X-Mailer: FeLaMiMail');
|
||||
@ -730,7 +724,7 @@
|
||||
if($_formData['disposition']) {
|
||||
$_mailObject->AddCustomHeader('Disposition-Notification-To: '. $_identity->emailAddress);
|
||||
}
|
||||
if(!empty($_identity->organization)) {
|
||||
if(!empty($_identity->organization) && (felamimail_bo::$felamimailConfig['how2displayIdentities'] == '' || felamimail_bo::$felamimailConfig['how2displayIdentities'] == 'orgNemail')) {
|
||||
#$_mailObject->AddCustomHeader('Organization: '. $bofelamimail->encodeHeader($_identity->organization, 'q'));
|
||||
$_mailObject->AddCustomHeader('Organization: '. $_identity->organization);
|
||||
}
|
||||
@ -1043,8 +1037,8 @@
|
||||
#error_log(print_r($this->preferences,true));
|
||||
$identity = $this->preferences->getIdentity((int)$this->sessionData['identity']);
|
||||
$signature = $this->bosignatures->getSignature((int)$this->sessionData['signatureID']);
|
||||
#error_log($this->sessionData['identity']);
|
||||
#error_log(print_r($identity,true));
|
||||
//error_log($this->sessionData['identity']);
|
||||
//error_log(print_r($identity,true));
|
||||
// create the messages
|
||||
$this->createMessage($mail, $_formData, $identity, $signature, true);
|
||||
// remember the identity
|
||||
|
@ -94,6 +94,13 @@ class felamimail_bo
|
||||
* @var array
|
||||
*/
|
||||
var $mailPreferences;
|
||||
|
||||
/**
|
||||
* static used to hold the felamimail Config values
|
||||
* @array
|
||||
*/
|
||||
static $felamimailConfig;
|
||||
|
||||
// set to true, if php is compiled with multi byte string support
|
||||
var $mbAvailable = FALSE;
|
||||
|
||||
@ -244,6 +251,7 @@ class felamimail_bo
|
||||
self::$instances[$_profileID]->profileID = $_profileID;
|
||||
if (!isset(self::$instances[$_profileID]->idna2)) self::$instances[$_profileID]->idna2 = new egw_idna;
|
||||
//if ($_profileID==0); error_log(__METHOD__.__LINE__.' RestoreSession:'.$_restoreSession.' ProfileId:'.$_profileID);
|
||||
if (is_null(self::$felamimailConfig)) self::$felamimailConfig = config::read('felamimail');
|
||||
return self::$instances[$_profileID];
|
||||
}
|
||||
|
||||
@ -433,6 +441,7 @@ class felamimail_bo
|
||||
if (function_exists('mb_convert_encoding')) {
|
||||
$this->mbAvailable = TRUE;
|
||||
}
|
||||
if (is_null(self::$felamimailConfig)) self::$felamimailConfig = config::read('felamimail');
|
||||
if (!isset(self::$idna2)) self::$idna2 = new egw_idna;
|
||||
|
||||
}
|
||||
@ -1652,21 +1661,6 @@ class felamimail_bo
|
||||
return $selectedID;
|
||||
}
|
||||
|
||||
function getEMailProfile()
|
||||
{
|
||||
$config = CreateObject('phpgwapi.config','felamimail');
|
||||
$config->read_repository();
|
||||
$felamimailConfig = $config->config_data;
|
||||
|
||||
#_debug_array($felamimailConfig);
|
||||
|
||||
if(!isset($felamimailConfig['profileID'])){
|
||||
return -1;
|
||||
} else {
|
||||
return intval($felamimailConfig['profileID']);
|
||||
}
|
||||
}
|
||||
|
||||
function getErrorMessage()
|
||||
{
|
||||
$rv =$this->icServer->_connectionErrorObject->message;
|
||||
@ -4069,14 +4063,6 @@ class felamimail_bo
|
||||
$this->saveSessionData();
|
||||
}
|
||||
|
||||
function setEMailProfile($_profileID)
|
||||
{
|
||||
$config = CreateObject('phpgwapi.config','felamimail');
|
||||
$config->read_repository();
|
||||
$config->value('profileID',$_profileID);
|
||||
$config->save_repository();
|
||||
}
|
||||
|
||||
function subscribe($_folderName, $_status)
|
||||
{
|
||||
if (self::$debug) error_log("felamimail_bo::".($_status?"":"un")."subscribe:".$_folderName);
|
||||
@ -4328,6 +4314,35 @@ class felamimail_bo
|
||||
return $rv;
|
||||
}
|
||||
|
||||
/**
|
||||
* generateIdentityString
|
||||
* construct the string representing an Identity passed by $identity
|
||||
* @var array/object $identity, identity object that holds realname, organization, emailaddress and signatureid
|
||||
* @var boolean $fullString full or false=NamePart only is returned
|
||||
* @return string - constructed of identity object data as defined in felamimailConfig
|
||||
*/
|
||||
static function generateIdentityString($identity, $fullString=true)
|
||||
{
|
||||
if (is_null(self::$felamimailConfig)) self::$felamimailConfig = config::read('felamimail');
|
||||
// not set? -> use default, means full display of all available data
|
||||
if (!isset(self::$felamimailConfig['how2displayIdentities'])) self::$felamimailConfig['how2displayIdentities']='';
|
||||
switch (self::$felamimailConfig['how2displayIdentities'])
|
||||
{
|
||||
case 'email';
|
||||
$retData = str_replace('@',' ',$identity->emailAddress).($fullString===true?' <'.$identity->emailAddress.'>':'');
|
||||
break;
|
||||
case 'nameNemail';
|
||||
$retData = (!empty($identity->realName)?$identity->realName:substr_replace($identity->emailAddress,'',strpos($identity->emailAddress,'@'))).($fullString===true?' <'.$identity->emailAddress.'>':'');
|
||||
break;
|
||||
case 'orgNemail';
|
||||
$retData = (!empty($identity->organization)?$identity->organization:substr_replace($identity->emailAddress,'',0,strpos($identity->emailAddress,'@')+1)).($fullString===true?' <'.$identity->emailAddress.'>':'');
|
||||
break;
|
||||
default:
|
||||
$retData = $identity->realName.(!empty($identity->organization)?' '.$identity->organization:'').($fullString===true?' <'.$identity->emailAddress.'>':'');
|
||||
}
|
||||
return $retData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges a given content with contact data
|
||||
*
|
||||
@ -5140,7 +5155,7 @@ class felamimail_bo
|
||||
//error_log(__METHOD__.__LINE__.array2string($activeMailProfile));
|
||||
$mailObject->From = $activeMailProfile->emailAddress;
|
||||
//$mailObject->From = $_identity->emailAddress;
|
||||
$mailObject->FromName = $mailObject->EncodeHeader($activeMailProfile->realName);
|
||||
$mailObject->FromName = $mailObject->EncodeHeader(self::generateIdentityString($activeMailProfile,false));
|
||||
|
||||
$mailObject->MessageID = '';
|
||||
$mailObject->ClearAllRecipients();
|
||||
|
@ -521,20 +521,24 @@
|
||||
|
||||
// header
|
||||
$allIdentities = $this->mailPreferences->getIdentity();
|
||||
unset($allIdentities[0]);
|
||||
//_debug_array($allIdentities);
|
||||
$defaultIdentity = 0;
|
||||
$identities = array();
|
||||
foreach($allIdentities as $key => $singleIdentity) {
|
||||
#$identities[$singleIdentity->id] = $singleIdentity->realName.' <'.$singleIdentity->emailAddress.'>';
|
||||
if (array_search($singleIdentity->realName.' <'.$singleIdentity->emailAddress.'>',$identities)==false) $identities[$key] = $singleIdentity->realName.' <'.$singleIdentity->emailAddress.'>';
|
||||
if(!empty($singleIdentity->default))
|
||||
//$identities[$singleIdentity->id] = $singleIdentity->realName.' <'.$singleIdentity->emailAddress.'>';
|
||||
$iS = felamimail_bo::generateIdentityString($singleIdentity);
|
||||
//error_log(__METHOD__.__LINE__.':'.$presetId.'->'.$key.'('.$singleIdentity->id.')'.'#'.$iS.'#');
|
||||
if (array_search('('.$singleIdentity->id.') '.$iS,$identities)===false) $identities[$singleIdentity->id] = '('.$singleIdentity->id.') '.$iS;
|
||||
if(!empty($singleIdentity->default) && $singleIdentity->default==1 && $defaultIdentity==0)
|
||||
{
|
||||
#$defaultIdentity = $singleIdentity->id;
|
||||
$defaultIdentity = $key;
|
||||
//_debug_array($singleIdentity);
|
||||
$defaultIdentity = $singleIdentity->id;
|
||||
//$defaultIdentity = $key;
|
||||
$sessionData['signatureID'] = (!empty($singleIdentity->signature) ? $singleIdentity->signature : $sessionData['signatureID']);
|
||||
}
|
||||
}
|
||||
$selectFrom = html::select('identity', ($presetId ? $presetId : $defaultIdentity), $identities, true, "style='width:100%;' onchange='changeIdentity(this);'");
|
||||
$selectFrom = html::select('identity', (!empty($presetId) ? $presetId : $defaultIdentity), $identities, true, "style='width:100%;' onchange='changeIdentity(this);'");
|
||||
$this->t->set_var('select_from', $selectFrom);
|
||||
//error_log(__METHOD__.__LINE__.' DefaultIdentity:'.array2string($identities[($presetId ? $presetId : $defaultIdentity)]));
|
||||
// navbar(, kind of)
|
||||
|
@ -26,7 +26,6 @@ class uifelamimail
|
||||
'importMessage' => True,
|
||||
'importMessageFromVFS2DraftAndDisplay' => True,
|
||||
'importMessageFromVFS2DraftAndEdit' => True,
|
||||
'hookAdmin' => True,
|
||||
'toggleFilter' => True,
|
||||
'viewMainScreen' => True,
|
||||
'redirectToConfig' => True,
|
||||
@ -136,8 +135,7 @@ class uifelamimail
|
||||
// this need to fixed
|
||||
// this does not belong to here
|
||||
|
||||
if($_GET['menuaction'] != 'felamimail.uifelamimail.hookAdmin' &&
|
||||
$_GET['menuaction'] != 'felamimail.uifelamimail.changeFolder') {
|
||||
if($_GET['menuaction'] != 'felamimail.uifelamimail.changeFolder') {
|
||||
$this->connectionStatus = $this->bofelamimail->openConnection(self::$icServerID);
|
||||
}
|
||||
|
||||
@ -779,79 +777,6 @@ class uifelamimail
|
||||
echo $GLOBALS['egw']->framework->navbar();
|
||||
}
|
||||
|
||||
function hookAdmin()
|
||||
{
|
||||
if(!$GLOBALS['egw']->acl->check('run',1,'admin'))
|
||||
{
|
||||
$GLOBALS['egw']->common->egw_header();
|
||||
echo $GLOBALS['egw']->framework->navbar();
|
||||
echo lang('access not permitted');
|
||||
$GLOBALS['egw']->log->message('F-Abort, Unauthorized access to felamimail.uifelamimail.hookAdmin');
|
||||
$GLOBALS['egw']->log->commit();
|
||||
$GLOBALS['egw']->common->egw_exit();
|
||||
}
|
||||
|
||||
if(!empty($_POST['profileID']) && is_int(intval($_POST['profileID'])))
|
||||
{
|
||||
$profileID = intval($_POST['profileID']);
|
||||
$this->bofelamimail->setEMailProfile($profileID);
|
||||
}
|
||||
|
||||
$boemailadmin = new emailadmin_bo();
|
||||
|
||||
$profileList = $boemailadmin->getProfileList();
|
||||
$profileID = $this->bofelamimail->getEMailProfile();
|
||||
|
||||
$this->display_app_header();
|
||||
|
||||
$this->t->set_file(array("body" => "selectprofile.tpl"));
|
||||
$this->t->set_block('body','main');
|
||||
$this->t->set_block('body','select_option');
|
||||
|
||||
$this->t->set_var('lang_select_email_profile',lang('select emailprofile'));
|
||||
$this->t->set_var('lang_site_configuration',lang('site configuration'));
|
||||
$this->t->set_var('lang_save',lang('save'));
|
||||
$this->t->set_var('lang_back',lang('back'));
|
||||
|
||||
$linkData = array
|
||||
(
|
||||
'menuaction' => 'felamimail.uifelamimail.hookAdmin'
|
||||
);
|
||||
$this->t->set_var('action_url',$GLOBALS['egw']->link('/index.php',$linkData));
|
||||
|
||||
$linkData = array
|
||||
(
|
||||
'menuaction' => 'emailadmin.emailadmin_ui.listProfiles'
|
||||
);
|
||||
$this->t->set_var('lang_go_emailadmin', lang('use <a href="%1">EmailAdmin</a> to create profiles', $GLOBALS['egw']->link('/index.php',$linkData)));
|
||||
|
||||
$this->t->set_var('back_url',$GLOBALS['egw']->link('/admin/index.php'));
|
||||
|
||||
if(isset($profileList) && is_array($profileList))
|
||||
{
|
||||
foreach($profileList as $key => $value)
|
||||
{
|
||||
#print "$key => $value<br>";
|
||||
#_debug_array($value);
|
||||
$this->t->set_var('profileID',$value['profileID']);
|
||||
$this->t->set_var('description',$value['description']);
|
||||
if(is_int($profileID) && $profileID == $value['profileID'])
|
||||
{
|
||||
$this->t->set_var('selected','selected');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->t->set_var('selected','');
|
||||
}
|
||||
$this->t->parse('select_options','select_option',True);
|
||||
}
|
||||
}
|
||||
|
||||
$this->t->parse("out","main");
|
||||
print $this->t->get('out','main');
|
||||
|
||||
}
|
||||
|
||||
function viewMainScreen()
|
||||
{
|
||||
if (!$GLOBALS['egw']->hooks->hook_exists('session_creation','felamimail')) $GLOBALS['egw']->hooks->register_single_app_hook('felamimail','session_creation');
|
||||
|
@ -27,6 +27,7 @@ address book search felamimail de Adressbuch durchsuchen
|
||||
administer the mailbox (change the mailbox's acl). felamimail de Administrieren der Mailbox (Berechtigung bzw. ACL der Mailbox)
|
||||
after message body felamimail de nach dem Editorfenster
|
||||
all address books felamimail de Alle Adressbücher
|
||||
all available info felamimail de Alle verfügbaren Informationen
|
||||
all folders felamimail de Alle Ordner
|
||||
all messages in folder felamimail de Alle Nachrichten im Ordner
|
||||
all of felamimail de mit allen
|
||||
@ -130,6 +131,7 @@ display mail subject in notification felamimail de Anzeigen des Betreffs der E-M
|
||||
display message in new window felamimail de Nachricht in neuem Fenster anzeigen
|
||||
display messages in multiple windows felamimail de Nachrichten in mehreren Fenstern anzeigen
|
||||
display of html emails felamimail de HTML-E-Mails anzeigen
|
||||
display of identities felamimail de Anzeigeformat der verfügbaren Identitätsinformationen
|
||||
display only when no plain text is available felamimail de nur anzeigen wenn kein Plain Text vorhanden ist
|
||||
display preferences felamimail de Anzeige Einstellungen
|
||||
displaying html messages is disabled felamimail de Die Anzeige von HTML-E-Mails ist deaktiviert.
|
||||
@ -174,7 +176,7 @@ edit rule felamimail de Regel bearbeiten
|
||||
edit selected felamimail de Ausgewählte bearbeiten
|
||||
edit vacation settings felamimail de Abwesenheitsnotiz bearbeiten
|
||||
editor type felamimail de Editortyp
|
||||
effective only if server supports acl at all admin de Wird nur angewendet, wenn Ihr Server diese Methode unterstützt
|
||||
effective only if server supports acl at all felamimail de Wird nur angewendet, wenn Ihr Server diese Methode unterstützt
|
||||
email address felamimail de E-Mail-Adresse
|
||||
email forwarding address felamimail de Zieladresse
|
||||
email notification felamimail de E-Mail Benachrichtigung
|
||||
@ -256,6 +258,7 @@ have a look at <a href="http://www.felamimail.org" target="_new">www.felamimail.
|
||||
header lines felamimail de Kopfzeilen
|
||||
hide header felamimail de Kopfzeilen verbergen
|
||||
hostname / address felamimail de Servername / Adresse
|
||||
how should the available information on identities be displayed felamimail de Hier legen Sie fest wie die verfügbaren Informationen Ihrer Identitäten in ausgehenden Mails angezeigt wird
|
||||
how to forward messages felamimail de Wie wollen Sie Nachrichten weiterleiten?
|
||||
html felamimail de HTML
|
||||
icons and text felamimail de Icons und Text
|
||||
|
@ -27,6 +27,7 @@ address book search felamimail en Address Book search
|
||||
administer the mailbox (change the mailbox's acl). felamimail en Administer the mailbox (change the mailbox's ACL).
|
||||
after message body felamimail en After message body
|
||||
all address books felamimail en All address books
|
||||
all available info felamimail en All available info
|
||||
all folders felamimail en All folders
|
||||
all messages in folder felamimail en All messages in folder
|
||||
all of felamimail en All of
|
||||
@ -130,6 +131,7 @@ display mail subject in notification felamimail en Display mail subject in notif
|
||||
display message in new window felamimail en Display message in new window
|
||||
display messages in multiple windows felamimail en Display messages in multiple windows
|
||||
display of html emails felamimail en Display HTML emails
|
||||
display of identities felamimail en Display of Identities
|
||||
display only when no plain text is available felamimail en Display only when no plain text is available
|
||||
display preferences felamimail en Display preferences
|
||||
displaying html messages is disabled felamimail en Displaying HTML messages is disabled.
|
||||
@ -174,7 +176,7 @@ edit rule felamimail en Edit rule
|
||||
edit selected felamimail en Edit selected
|
||||
edit vacation settings felamimail en Edit vacation settings
|
||||
editor type felamimail en Editor type
|
||||
effective only if server supports acl at all admin en effective only if server supports ACL at all
|
||||
effective only if server supports acl at all felamimail en effective only if server supports ACL at all
|
||||
email address felamimail en Email address
|
||||
email forwarding address felamimail en Email forwarding address
|
||||
email notification felamimail en email notification
|
||||
@ -256,6 +258,7 @@ have a look at <a href="http://www.felamimail.org" target="_new">www.felamimail.
|
||||
header lines felamimail en Header lines
|
||||
hide header felamimail en Hide header
|
||||
hostname / address felamimail en Hostname / address
|
||||
how should the available information on identities be displayed felamimail en How should the available information on identities be displayed
|
||||
how to forward messages felamimail en How to forward messages
|
||||
html felamimail en HTML
|
||||
icons and text felamimail en Icons and text
|
||||
|
@ -13,6 +13,20 @@
|
||||
<tr class="th">
|
||||
<td colspan="2"> <b>{lang_felamimail}</b> - {lang_acl}</td>
|
||||
</tr>
|
||||
<tr class="row_on">
|
||||
<td> {lang_display_of_identities}:</td>
|
||||
<td>
|
||||
<select name="newsettings[how2displayIdentities]">
|
||||
<option value=""{selected_how2displayIdentities_full}>{lang_all_available_info}</option>
|
||||
<option value="email"{selected_how2displayIdentities_email}>{lang_emailaddress}</option>
|
||||
<option value="nameNemail"{selected_how2displayIdentities_nameNemail}>{lang_name} & {lang_emailaddress}</option>
|
||||
<option value="orgNemail"{selected_how2displayIdentities_orgNemail}>{lang_organisation} & {lang_emailaddress}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row_off">
|
||||
<td colspan="2"> {lang_how_should_the_available_information_on_identities_be_displayed}</td>
|
||||
</tr>
|
||||
<tr class="row_on">
|
||||
<td> {lang_restrict_acl_management}:</td>
|
||||
<td>
|
||||
|
Loading…
Reference in New Issue
Block a user