6.0.0-alpha14
7/3/25

[#8571] Only one e-Mail Address is synced with SIF-C (Funambol)
Summary Only one e-Mail Address is synced with SIF-C (Funambol)
Queue Synchronization
Type Enhancement
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester lst_hoe02 (at) kwsoft (dot) de
Created 09/11/2009 (5774 days ago)
Due
Updated 10/01/2009 (5754 days ago)
Assigned 09/21/2009 (5764 days ago)
Resolved 10/01/2009 (5754 days ago)
Milestone 3.3.6
Patch Yes

History
10/01/2009 10:26:34 AM CVS Commit Comment #8 Reply to this comment
Changes have been made in CVS for this ticket:

MFH: Map all email addresses to SIF-C (Request #8571).
http://cvs.horde.org/diff.php/framework/SyncML/SyncML/Device/Sync4j.php?rt=horde&r1=1.8.2.32&r2=1.8.2.33&ty=u
10/01/2009 10:16:12 AM Jan Schneider Comment #7
State ⇒ Resolved
Reply to this comment
Committed, thanks!
10/01/2009 10:14:49 AM CVS Commit Comment #6 Reply to this comment
Changes have been made in CVS for this ticket:

Map all email addresses to SIF-C (Request #8571).
http://cvs.horde.org/diff.php/framework/SyncML/SyncML/Device/Sync4j.php?rt=horde&r1=1.70&r2=1.71&ty=u
09/22/2009 01:39:23 PM lst_hoe02 (at) kwsoft (dot) de Comment #5
New Attachment: sif-c-email.zip Download
Reply to this comment
Here is the patch against Horde 3.3.5 which uses the Turba Driver.php 
Code with SIF-C Labels. It works as expected on my Test-Install.
09/21/2009 03:30:27 PM Jan Schneider Priority ⇒ 2. Medium
Milestone ⇒ 3.3.6
 
09/21/2009 03:30:01 PM Jan Schneider Comment #4
State ⇒ Assigned
Assigned to Jan Schneider
Reply to this comment
The original code doesn't work well either because the last
mailaddress wins.
This is only because of a typo. The if-test should check 
$hash['Email1Address'] instead of $hash['email'].
I suggest to use the code from Turba::Driver toHash
as it was originally done (see comment at top of function) and modify
it to match SIF.
That makes a lot of sense.
09/21/2009 03:20:44 PM lst_hoe02 (at) kwsoft (dot) de Comment #3 Reply to this comment
The original code doesn't work well either because the last 
mailaddress wins. I suggest to use the code from Turba::Driver toHash 
as it was originally done (see comment at top of function) and modify 
it to match SIF.

I don't want to spent to much work on it because SIF is phasing out 
anyway but we urgently need more than one mailadress until then.

Would this be acceptable??
09/18/2009 03:55:01 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Can you please upload the patch as an attachment? And while you're at 
it, please add "break;" statements to the vCard 3.0 section, so that 
an address is not accidentally mapped to several fields. Finally, 
please re-add the PREF/!isset() logic from the original code, so that 
either the first matching address, or the preferred address wins.
09/11/2009 07:22:10 AM lst_hoe02 (at) kwsoft (dot) de Comment #1
Patch ⇒ Yes
State ⇒ New
Milestone ⇒
Queue ⇒ Synchronization
Summary ⇒ Only one e-Mail Address is synced with SIF-C (Funambol)
Type ⇒ Enhancement
Priority ⇒ 1. Low
Reply to this comment
Outlook has 3 mail addresses and these are translatet to 
Email1Address, Email2Address, Email3Address in SIF-C. Newer Funambol 
clients map these to

EMAIL

EMAIL:HOME

EMAIL:WORK

The patch does this for vacrd->SIF and the otherway around to sync 
more than one address.



--- lib/SyncML/Device/Sync4j.php.orig        2009-08-14 
17:01:24.000000000 +0200

+++ lib/SyncML/Device/Sync4j.php.patch        2009-09-11 
09:10:36.000000000 +0200

@@ -253,8 +253,8 @@

              'OtherTelephoneNumber' => array('TEL'),

              'OtherFaxNumber' => array('TEL'),

              'Email1Address' => array('EMAIL'),

-            'Email2Address' => array('EMAIL'),

-            'Email3Address' => array('EMAIL'),

+            'Email2Address' => array('EMAIL', array('TYPE' => 'HOME')),

+            'Email3Address' => array('EMAIL', array('TYPE' => 'WORK')),

              'HomeLabel' => array('LABEL', array('TYPE' => 'HOME')),

              'BusinessLabel' => array('LABEL', array('TYPE' => 'WORK')),

              'OtherLabel' => array('LABEL'),

@@ -729,9 +729,34 @@

                  break;



              case 'EMAIL':

-                if (isset($item['params']['PREF']) || 
!isset($hash['email'])) {

-                    $hash['Email1Address'] = 
Horde_iCalendar_vcard::getBareEmail($item['value']);

-                    $hash['Email1AddressType'] = 'SMTP';

+                if (isset($item['params']['TYPE'])) {

+                    if (!is_array($item['params']['TYPE'])) {

+                        $item['params']['TYPE'] = 
array($item['params']['TYPE']);

+                    }

+                    // For vCard 3.0.

+                    foreach ($item['params']['TYPE'] as $mail) {

+                        if (String::upper($mail) == 'WORK') {

+                            $hash['Email3Address'] = 
Horde_iCalendar_vcard::getBareEmail($item['value']);

+                            $hash['Email3AddressType'] = 'SMTP';

+                        } elseif (String::upper($mail) == 'HOME') {

+                            $hash['Email2Address'] = 
Horde_iCalendar_vcard::getBareEmail($item['value']);

+                            $hash['Email2AddressType'] = 'SMTP';

+                        } else {

+                            $hash['Email1Address'] = 
Horde_iCalendar_vcard::getBareEmail($item['value']);

+                            $hash['Email1AddressType'] = 'SMTP';

+                        }

+                    }

+                } else {

+                    if (isset($item['params']['HOME'])) {

+                        $hash['Email2Address'] = 
Horde_iCalendar_vcard::getBareEmail($item['value']);

+                        $hash['Email2AddressType'] = 'SMTP';

+                    } elseif (isset($item['params']['WORK'])) {

+                        $hash['Email3Address'] = 
Horde_iCalendar_vcard::getBareEmail($item['value']);

+                        $hash['Email3AddressType'] = 'SMTP';

+                    } else {

+                        $hash['Email1Address'] = 
Horde_iCalendar_vcard::getBareEmail($item['value']);

+                        $hash['Email1AddressType'] = 'SMTP';

+                    }

                  }

                  break;

Saved Queries