Projects
Kolab:3.4:Updates
kolab-syncroton
kolab-syncroton-2.2.5-fix-from-header.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kolab-syncroton-2.2.5-fix-from-header.patch of Package kolab-syncroton (Revision 53)
Currently displaying revision
53
,
Show latest
commit b2c0912d038584ef92267023045b7c72f74f5517 Author: Aleksander Machniak <alec@alec.pl> Date: Mon Feb 3 12:49:22 2014 +0100 Added option (activesync_fix_from) to enables adding sender name into the From: header of send email when a device uses email address only (e.g. iOS devices) $config['activesync_fix_from'] = false diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist index 2ebe75d..c792377 100644 --- a/config/main.inc.php.dist +++ b/config/main.inc.php.dist @@ -79,3 +79,7 @@ $config['activesync_quiet_time'] = 180; // 16 - all subscribed folders in shared namespace // 32 - all folders in shared namespace $config['activesync_init_subscriptions'] = 0; + +// Enables adding sender name in the From: header of send email +// when a device uses email address only (e.g. iOS devices) +$config['activesync_fix_from'] = false; diff --git a/lib/kolab_sync_message.php b/lib/kolab_sync_message.php index 026d557..c8b0a47 100644 --- a/lib/kolab_sync_message.php +++ b/lib/kolab_sync_message.php @@ -169,6 +169,22 @@ class kolab_sync_message if (empty($headers['From'])) { $headers['From'] = $this->get_identity(); } + // make sure there's sender name in From: + else if ($rcube->config->get('activesync_fix_from') + && preg_match('/^<?((\S+|("[^"]+"))@\S+)>?$/', trim($headers['From']), $m) + ) { + $identities = kolab_sync::get_instance()->user->list_identities(); + $email = $m[1]; + + foreach ((array) $identities as $ident) { + if ($ident['email'] == $email) { + if ($ident['name']) { + $headers['From'] = format_email_recipient($email, $ident['name']); + } + break; + } + } + } if (empty($headers['Message-ID'])) { $headers['Message-ID'] = $rcube->gen_message_id();
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.