Page 9 of 106 FirstFirst ... 78910111959 ... LastLast
Results 81 to 90 of 1054

Thread: Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

  1. #81
    jonallport's Avatar
    jonallport is offline Special Member
    Join Date
    Jul 2008
    Location
    UK
    Posts
    171
    Rep Power
    7

    Default

    Just by way of an update:

    I've solved the problem I had with Nokia Mail for Exchange (MfE). MfE appears to be intollerant of folder hierarchy. I had an 'Old' folder in 'Sent' containing the imported sent items form the previous platform. Once I moved this to another parent folder, everything sync'd and now seems to be working fine now.

  2. #82
    liverpoolfcfan's Avatar
    liverpoolfcfan is offline Outstanding Member
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    6

    Default Fix for "Mail for Exchange" sender name

    I have fixed the "Mail for Exchange" sender name issue with this Zimbra backend.

    It took me a long time to figure out how to extract information from the SoapResponse as I have never used the Soap API before, and I am sure I have not done this in the most efficient manner - so if the OP or anyone else here can help to streamline the calls to Zimbra - please chime in.

    The basics -
    Add a new key to config.php -
    Code:
    define('ZIMBRA_NOKIA_MFE_FIX',true);
    Then add the following code to the SendMail function in zimbra.php, at the very top. So ...

    Code:
        /* Sends a message which is passed as rfc822.
         */
        function SendMail($rfc822, $forward = false, $reply = false, $parent = false) {
            debugLog('START SendMail { rfc822 = (see next line); forward = ' . $forward . '; reply = ' . $reply . '; parent = ' . $parent . ' }');
    
            $temp_file = tempnam(BASE_PATH . STATE_DIR . "/", "ZIMBRA_MSG_");
            $handle = fopen($temp_file, "w");
    becomes ...

    Code:
        /* Sends a message which is passed as rfc822.
         */
        function SendMail($rfc822, $forward = false, $reply = false, $parent = false) {
            debugLog('START SendMail { rfc822 = (see next line); forward = ' . $forward . '; reply = ' . $reply . '; parent = ' . $parent . ' }');
    
            // Nokia Mail for Exchange has a habit of sending "Mail for Exchange" instead of the sender's name
            // Searches on the internet blame this behaviour on individual phones, MFE versions, or the weather (kidding)
            // The following code block will check for the presense of a key in the config.php file - 'ZIMBRA_NOKIA_MFE_FIX'
            // If found, and set to true - the code will perform a SOAP GetInfoRequest to Zimbra 
            // The Response is searched for  
            if (defined('ZIMBRA_NOKIA_MFE_FIX')) {
              if (ZIMBRA_NOKIA_MFE_FIX == true) {
    
                debugLog( 'NokiaMFEFix is defined & true' );
                $useragent =  $GLOBALS['useragent'];
                debugLog("User-Agent " . $useragent);
    
                $MFE = "MailforExchange";
                $found = stripos($useragent, $MFE);
                if ($found !== false) {
    
                  debugLog( 'User-Agent contains MailforExchange' );
                
                  debugLog( 'rfc822: ' . $rfc822 );
        
                  $MFE = '"Mail for Exchange" ';
      
                  $soap ='<GetInfoRequest xmlns="urn:zimbraAccount"/>';
                      
                  $response = $this->SoapRequest($soap);
                  
                  if ($response) {
        
                    $array = $this->MakeXMLTree($response);
        
                    // First Choice: search prefs for 'zimbraPrefFromDisplay'
      
                    $items = $array['soap:Envelope'][0]['soap:Body'][0]['GetInfoResponse'][0]['prefs'][0]['pref_attribute_name'];
                    $total = sizeof($items);
                    for ($i=0;$i<$total;$i++) {
                      if ( $items[$i] == 'zimbraPrefFromDisplay' ) {
                        debugLog( 'Got : ' . $items[$i] );
                        $displayName = $array['soap:Envelope'][0]['soap:Body'][0]['GetInfoResponse'][0]['prefs'][0]['pref'][$i];
                        break;
                      }
                    }
                    
                    if ( $i == $total ) {
                      debugLog( 'Found No zimbraPrefFromDisplay'  );
                      
                      // if 'zimbraPrefFromDisplay' was not found
                      // Second Choice: search attrs for 'displayName' or 'cn'
                      //$displayName = "";
                      //$cn = "";
                      
                      $items = $array['soap:Envelope'][0]['soap:Body'][0]['GetInfoResponse'][0]['attrs'][0]['attr_attribute_name'];
                      $total = sizeof($items);
                      for ($i=0;$i<$total;$i++) {
                        if ( $items[$i] == 'displayName' ) {
                          debugLog( 'Got : ' . $items[$i] );
                          $displayName = $array['soap:Envelope'][0]['soap:Body'][0]['GetInfoResponse'][0]['attrs'][0]['attr'][$i];
                        }
                        if ( $items[$i] == 'cn' ) {
                          debugLog( 'Got : ' . $items[$i] );
                          $cn = $array['soap:Envelope'][0]['soap:Body'][0]['GetInfoResponse'][0]['attrs'][0]['attr'][$i];
                        }
                      }
      
                      if ( !$displayName ) {
                        debugLog( 'Found No displayName '  );
                        if ( !$cn ) {
                          // Third Choice: display nothing rather than "Mail for Exchange"
      
                          debugLog( 'Found No cn : Clearing "Mail for Exchange"'  );
                        }
                        else {
                          debugLog( 'Using cn as FROM ADDRESS'  );
                          $displayName = $cn; 
                        }                                  
                      }
      
                      // Format $display_name as ["Display Name" ] including quotes and trailing space
                      if (!$displayName) {
                        $displayName = "";
                      }
                      else {
                        $displayName = '"' . $displayName . '" ';
                      }
                      
                      debugLog( 'displayName [' . $displayName . ']'  );
                      
                    }
        
                    debugLog( 'Got [' . $displayName . ']' );
                  }
                  else {
                    debugLog( 'Got No SOAP Response' );
                    $displayName = ""; //default to nothing - better than "Mail for Exchange"
                  }        
      
                  $rfc822  = str_replace( $MFE, $displayName, $rfc822 );
                  
                  debugLog( 'rfc822: ' . $rfc822 );
                }
                else {
                  debugLog( 'User-Agent does not contain MailforExchange' );
    
                }
      
              }
              else {
                debugLog( 'NokiaMFEFix is set to FALSE' );
              }
            }
    
    
            $temp_file = tempnam(BASE_PATH . STATE_DIR . "/", "ZIMBRA_MSG_");
            $handle = fopen($temp_file, "w");
    The code will replace "Mail for Exchange" with the contents of the first one of the following it finds

    zimbraPrefFromDisplay
    displayName
    cn

    and, if for some strange reason you have none of these set on your account it will simple remove the "Mail for Exchange" and leave the email address without a "Text" label.

    UPDATED: 2010-04-09 - Added User-Agent test to identify only Nokia phones
    Last edited by liverpoolfcfan; 04-09-2010 at 04:13 AM. Reason: Added check for User-Agent containing MailforExchange

  3. #83
    andywhy's Avatar
    andywhy is offline Intermediate Member
    Join Date
    Mar 2010
    Location
    /Earth/Europe/Germany/Lower\ Saxony/Hannover
    Posts
    22
    Rep Power
    5

    Default Small bug in appointments

    Hi there first of all i want just say thanks to the developers for their great work, almost everything is working fine with the WM6 mobiles attached to our Zimbra. But we found a small Bug in rev. 27 of the zimbra backend. If you create a recurring appointment and add some extra information (notes) in the textfield of the appointment or add attendees (which in case implies adding additional text in the appointment), the recurrence is not synced to the cellphone. If you delete the additional appointment information or the attendees, recurrence is synced again.

    Many greetings from germany,
    Andreas

  4. #84
    powrrrplay is offline Special Member
    Join Date
    Nov 2008
    Posts
    119
    Rep Power
    6

    Default

    I have had to go back to revision25 as revision 27 breaks my palm pre active sync for contacts and calendars.

    revision27 breaks the calendar and contact sync that was working from the PC to the phone under revision25.

    email sync continues to work although that is messed up. Under revision27 tje zimbra backend does not push the email when an email arrives on the zimbra server. If I manually sync my phone I get the email.
    Guest Ubuntu 12.04LTS x64 and Zimbra 8.0.5
    Host CentOS 6.4 x64 :: KVM :: LVM :: Hardware RAID

  5. #85
    carnold is offline Advanced Member
    Join Date
    Jul 2007
    Posts
    227
    Rep Power
    8

    Default

    Hate to ask such a novice question but...how exactly do you configure a new email account on iphone? I have tried both exchange and other and both of those with with the http://domain.here/Microsoft-Server-ActiveSync address to no avail. I can go to that same address on my iphone using safari and login and see the zimbra.php file from sourceforge but cant get an account configured.

    From the log:
    [Tue Mar 30 21:38:08 2010] [error] [client 166.137.9.113] PHP Notice: Use of undefined constant \xe2\x80\x98ZIMBRA_SYNC_CONTACT_PICTURES\xe2\x80\x 99 - assumed '\xe2\x80\x98ZIMBRA_SYNC_CONTACT_PICTURES\xe2\x80\ x99' in /srv/www/htdocs/sites/z-push/config.php on line 90
    [Tue Mar 30 21:38:08 2010] [error] [client 166.137.9.113] PHP Notice: Use of undefined constant \xe2\x80\x98ZIMBRA_VIRTUAL_CONTACTS\xe2\x80\x99 - assumed '\xe2\x80\x98ZIMBRA_VIRTUAL_CONTACTS\xe2\x80\x99' in /srv/www/htdocs/sites/z-push/config.php on line 91
    [Tue Mar 30 21:38:08 2010] [error] [client 166.137.9.113] PHP Notice: Use of undefined constant \xe2\x80\x98ZIMBRA_VIRTUAL_APPOINTMENTS\xe2\x80\x9 9 - assumed '\xe2\x80\x98ZIMBRA_VIRTUAL_APPOINTMENTS\xe2\x80\x 99' in /srv/www/htdocs/sites/z-push/config.php on line 92
    [Tue Mar 30 21:38:08 2010] [error] [client 166.137.9.113] PHP Notice: Use of undefined constant \xe2\x80\x98ZIMBRA_VIRTUAL_TASKS\xe2\x80\x99 - assumed '\xe2\x80\x98ZIMBRA_VIRTUAL_TASKS\xe2\x80\x99' in /srv/www/htdocs/sites/z-push/config.php on line 93
    [Tue Mar 30 21:38:08 2010] [error] [client 166.137.9.113] PHP Notice: Use of undefined constant \xe2\x80\x98ZIMBRA_IGNORE_EMAILED_CONTACTS\xe2\x80 \x99 - assumed '\xe2\x80\x98ZIMBRA_IGNORE_EMAILED_CONTACTS\xe2\x8 0\x99' in /srv/www/htdocs/sites/z-push/config.php on line 94
    [Tue Mar 30 21:38:08 2010] [error] [client 166.137.9.113] PHP Notice: Use of undefined constant \xe2\x80\x98ZIMBRA_HTML\xe2\x80\x99 - assumed '\xe2\x80\x98ZIMBRA_HTML\xe2\x80\x99' in /srv/www/htdocs/sites/z-push/config.php on line 95
    [Tue Mar 30 21:38:08 2010] [error] [client 166.137.9.113] PHP Fatal error: Class 'BackendZimbra' not found in /srv/www/htdocs/sites/z-push/index.php on line 125

    Also, we do not use a standard port for our zimbra mail. So when i put in the zimbra url in the config.php file, we get this in the log:
    PHP Parse error: syntax error, unexpected ':' in /srv/www/htdocs/sites/z-push/config.php on line 89.
    When i change this from http://domain.here: port to domain.here, i can then login using the microsoft-server-activesync address and the above error goes away. So can you use a "non-standard" port in the config.php?

    Here is the config.php config:
    define(‘ZIMBRA_URL’, ‘domain.here’);
    define(‘ZIMBRA_SYNC_CONTACT_PICTURES’, true);
    define(‘ZIMBRA_VIRTUAL_CONTACTS’,true);
    define(‘ZIMBRA_VIRTUAL_APPOINTMENTS’,true);
    define(‘ZIMBRA_VIRTUAL_TASKS’,true);
    define(‘ZIMBRA_IGNORE_EMAILED_CONTACTS’,true);
    define(‘ZIMBRA_HTML’,true);
    Last edited by carnold; 03-30-2010 at 07:23 PM.

  6. #86
    carlsan is offline Intermediate Member
    Join Date
    Mar 2010
    Posts
    20
    Rep Power
    5

    Default

    Quote Originally Posted by liverpoolfcfan View Post
    I have fixed the "Mail for Exchange" sender name issue with this Zimbra backend.
    Thanks a lot, that fix works for me!
    Don't ask me why but for me he did not send mails with "Mail for Exchange" as sender. He used the name of my old imap-Account I used before I switched to MfE.
    In case that fix goes into the standard it would be nice if the string that has to be replaced by that script would be configurable in config.php like

    Code:
    define('ZIMBRA_NOKIA_MFE_REPLACE','<string-to-replace>');
    //carl

  7. #87
    carlsan is offline Intermediate Member
    Join Date
    Mar 2010
    Posts
    20
    Rep Power
    5

    Default

    Quote Originally Posted by carnold View Post
    Here is the config.php config:
    define(‘ZIMBRA_URL’, ‘domain.here’);
    define(‘ZIMBRA_SYNC_CONTACT_PICTURES’, true);
    define(‘ZIMBRA_VIRTUAL_CONTACTS’,true);
    define(‘ZIMBRA_VIRTUAL_APPOINTMENTS’,true);
    define(‘ZIMBRA_VIRTUAL_TASKS’,true);
    define(‘ZIMBRA_IGNORE_EMAILED_CONTACTS’,true);
    define(‘ZIMBRA_HTML’,true);
    I only had a look on these lines. I think you copied that from Push email, contacts and calendar with Zimbra 6 Opensource & Z-Push – ActiveSync | slashdevslashnull.com

    If you copy and paste from this site you don't get the right sticks.
    Please compare to the first lines in zimbra.php:

    Code:
    define('ZIMBRA_URL', '<zimbra url>');
    define('ZIMBRA_SYNC_CONTACT_PICTURES', true);
    define('ZIMBRA_VIRTUAL_CONTACTS',true);
    [...]

  8. #88
    carnold is offline Advanced Member
    Join Date
    Jul 2007
    Posts
    227
    Rep Power
    8

    Default

    OK, found and corrected that, thanks. I still can not get a working config on my iphone. For the account setting i have:
    Name: Name
    Address: user@domain.here
    Description: Description

    Incoming
    Host name: domain.here/Microsoft-Server-ActiveSync
    User name: Username
    Password: Password

    Outgoing
    Host name: domain.here
    Username: Username

    Incoming settings
    No SSL (tried with and without)
    Auth: Password
    IMAP prefix: /
    Port: imap port

    And when i try to add an email using exchange, it just hangs at verfying exchange account info. We are suppose to be using the exchange option to setup email using z-push, right?

  9. #89
    carlsan is offline Intermediate Member
    Join Date
    Mar 2010
    Posts
    20
    Rep Power
    5

    Default

    Sorry, but please define what you want to do:
    - Zimbra <-> imap <-> Iphone (Mails only --> no z-push/zimbrabackend necessary)
    or
    - Zimbra <-> z-push with zimbrabackend <-> Iphone (Pushmail, PIM sync --> you have to choose "ExchangeAccount" in your Iphone)

  10. #90
    liverpoolfcfan's Avatar
    liverpoolfcfan is offline Outstanding Member
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    6

    Default

    Quote Originally Posted by carlsan View Post
    Thanks a lot, that fix works for me!
    Don't ask me why but for me he did not send mails with "Mail for Exchange" as sender. He used the name of my old imap-Account I used before I switched to MfE.
    Wow - that is even more bizarre than the original issue.

    Happy the fix worked for you.

    In case that fix goes into the standard it would be nice if the string that has to be replaced by that script would be configurable in config.php like

    Code:
    define('ZIMBRA_NOKIA_MFE_REPLACE','<string-to-replace>');
    Good suggestion.

    Though if the behaviour is unpredictable - maybe a better solution would be to just replace anything that is there - regardless of what it was ??

Page 9 of 106 FirstFirst ... 78910111959 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. z-push and zimbra backend problem
    By ben1967 in forum Mobility
    Replies: 9
    Last Post: 11-14-2012, 11:29 PM
  2. z-push and zimbra backend problem
    By ben1967 in forum Administrators
    Replies: 0
    Last Post: 11-11-2012, 02:11 PM
  3. [SOLVED] Z-push Zimbra backend workaround
    By Inchoate in forum Mobility
    Replies: 6
    Last Post: 01-19-2012, 04:22 AM
  4. [SOLVED] Z-push Zimbra backend workaround
    By Inchoate in forum Administrators
    Replies: 0
    Last Post: 10-31-2010, 07:06 AM
  5. Replies: 348
    Last Post: 10-11-2010, 05:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •