Page 38 of 105 FirstFirst ... 2836373839404888 ... LastLast
Results 371 to 380 of 1049

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

  1. #371
    liverpoolfcfan's Avatar
    liverpoolfcfan is offline Outstanding Member
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    708
    Rep Power
    6

    Default

    Quote Originally Posted by kongregate View Post
    Yes, those fixes are in the index.php. I would suggest that for zimbra-push we're branching the zpush trunk OR we just submit the to zpush
    The goal of the backend is to work with a standard z-push install - so I would prefer not to be messing with index.php


    In any case, I just took a quick look through index.php again. Correct me if I am wrong but, it looks like the only place it outputs a header with Content-type is where there has been an issue with the backend not being able to handle the request.

    In this case, the entire error page is generated from the index.php script. So it hardly matters if it is utf-8 encoded or not.

    If the request has been handled, then the Content-type should already have come from the backend.

  2. #372
    kongregate is offline Junior Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    4

    Default

    Quote Originally Posted by liverpoolfcfan View Post
    If the request has been handled, then the Content-type should already have come from the backend.
    I see, you are right. I've just checked, the content-type is manually set to octet-stream when streaming a binary attachment. If it's just XML markup the content-type is set to "application/vnd.ms-sync.wbxml" in startWBXML. Anyways, I've corrected the content-type for the error/auth pages.

  3. #373
    Sajuuk is offline Member
    Join Date
    Nov 2010
    Posts
    14
    Rep Power
    4

    Smile

    Quote Originally Posted by kongregate View Post
    I have nailed the issue, it is indeed a bug in the Zimbra backend.
    Apparently there is some type of double encoding going on:

    In GetBodyRecursive (zimbra.php) the function iconv( in, out, string) converts the string from "in" format to the "out" format.

    Code:
    $oldEncoding = $parameters["charset"];
    $body .= iconv( $oldEncoding, "UTF-8//IGNORE//TRANSLIT", $message->body);
    This does look alright, however $parameters["charset"] is "ISO-8859-1" even though the contents are "UTF-8". This results in garbage characters in the email.

    Here is a version of the function that properly detects the string encoding and uses this as a base, not the supplied values. This produces 100% correct emails in all tested languages (german, french etc.). If you're moving this back into the repo, please keep the attrib!

    Code:
    /** 	GetBodyRecursive
    *	Get all parts in the message with specified type and concatenate them together, unless the
    *  	Content-Disposition is 'attachment', in which case the text is apparently an attachment
    *  
    * 	2011-11-14: encoding fixed, comments added and beautified by kongregate/dwc <dwckongregate_x_googlemail.com>
    */
    function GetBodyRecursive($message, $subtype, &$body) 
    {
    	if (!isset($message->ctype_primary)) 
    	{
    		return;
    	}
    
    	// is this object a text message, then grab the message body
    	if (strcasecmp($message->ctype_primary,"text") == 0 && 
    		strcasecmp($message->ctype_secondary,$subtype) == 0 && 
    		isset($message->body)) 
    	{
    		if (isset($message->ctype_parameters)) 
    		{
    			$parameters = $message->ctype_parameters;				
    			$sourceEncoding = mb_detect_encoding($message->body, "auto"); // get encoding from body
    		
    			// if encoding is not UTF-8 encode it properly
    			// FIXME: why do we need subtype plain?
    			if ($sourceEncoding != "UTF-8" && $subtype == "plain")  
    			{
    				$body .= iconv( $sourceEncoding, "UTF-8//IGNORE//TRANSLIT", $message->body);
    			} 
    			else 
    			{
    				$body .= $message->body;
    			}
    		} 
    		else 
    		{
    			$body .= $message->body;
    		}
    	}
    
    	// is this a multipart email and there are multiple parts in this object then also grab the contents
    	if(strcasecmp($message->ctype_primary,"multipart") == 0 && 
    		isset($message->parts) && 
    		is_array($message->parts)) 
    	{
    		// iterate through message parts
    		foreach($message->parts as $part) 
    		{
    			// if the part is not a binary attachement
    			if(!isset($part->disposition) || strcasecmp($part->disposition,"attachment"))  
    			{
    				// grab the contents!
    				$this->GetBodyRecursive($part, $subtype, $body);
    			}
    		}
    	}
    } // end GetBodyRecursive
    Guess this will make some international users happy
    Also, don't forget the Content-Type fix I have posted earlier if you want to run a happy system.

    Thanks again for your work on this backend. Cheers!
    Wooowww, thank you a lot!!!
    Your encoding patch worked like a charm with Croatian language.

    YOU ARE THE MAN!!!

  4. #374
    kongregate is offline Junior Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    4

    Default

    Quote Originally Posted by Sajuuk View Post
    Wooowww, thank you a lot!!!
    Your encoding patch worked like a charm with Croatian language.

    YOU ARE THE MAN!!!
    Thanks, glad I could contribute a little to the opensource community However I only use the ActiveSync backend for contacts and calendar because of the lack of HTML emails.

  5. #375
    liverpoolfcfan's Avatar
    liverpoolfcfan is offline Outstanding Member
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    708
    Rep Power
    6

    Default

    Quote Originally Posted by jonallport View Post
    I'm having this problem:
    https://bugzilla.zimbra.com/show_bug.cgi?id=42947

    Is this a quick fix (fake Outbox folder) or should I send these E72s back?

    TIA

    Update:
    Thanks to Vincent (LiverpoolFCFan) who's looking into this (via SourceForge).
    Looks like we have managed to get a workaround for this problem. Jonathan testing for me as I don't have access to an E72, and the E71 never had this issue.

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

    Default

    Quote Originally Posted by Sajuuk View Post
    Wooowww, thank you a lot!!!
    Your encoding patch worked like a charm with Croatian language.

    YOU ARE THE MAN!!!
    Can you please do me a favour.

    Add the line

    debugLog( 'MB Detect Order ['.print_r(mb_detect_order(), true).']' );

    as the first line in the function GetBodyRecursive, and post back the output of this log message from your debug.log

    Thanks

  7. #377
    kongregate is offline Junior Member
    Join Date
    Nov 2010
    Posts
    7
    Rep Power
    4

    Default

    Quote Originally Posted by liverpoolfcfan View Post
    Can you please do me a favour.

    Add the line

    debugLog( 'MB Detect Order ['.print_r(mb_detect_order(), true).']' );

    as the first line in the function GetBodyRecursive, and post back the output of this log message from your debug.log

    Thanks
    The encoding on the system should not matter here. I'm not a PHP expert, but I assume PHP just writes the string in it's encoding to the stream.
    Non-php:
    As long as the client interprets the stream as UTF8 and the server's string is UTF8 you should be fine. However, this could be easily tested (if php acts this way as it should). Create two strings both with language specific special characters ():
    - one UTF8 and
    - one ISO8859-1
    write both to the stream and interpret the resulting document on the client in UTF8. now switch to ISO encoding and depending on the client encoding both should be fully interpretable in the stream.

    The garbage characters are the result of a double encoding in the original code due to a wrong specification of the source-encoding (passed over from zimbra(?)) on the backend.

  8. #378
    Sajuuk is offline Member
    Join Date
    Nov 2010
    Posts
    14
    Rep Power
    4

    Default iPhone calendar loop

    I have a problem with calendar sync on iPhone.
    I can send invitation without any problem, but when I get acceptance from one of invities, calendar is syncing it like a calendar event and like invitation, so I have lets say: Meeting, and after acceptance i have two entries in calendar on phone: Meeting, Aceppted: Meeting.
    But I should only have one entry.

  9. #379
    liverpoolfcfan's Avatar
    liverpoolfcfan is offline Outstanding Member
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    708
    Rep Power
    6

    Default

    Quote Originally Posted by Sajuuk View Post
    I have a problem with calendar sync on iPhone.
    I can send invitation without any problem, but when I get acceptance from one of invities, calendar is syncing it like a calendar event and like invitation, so I have lets say: Meeting, and after acceptance i have two entries in calendar on phone: Meeting, Aceppted: Meeting.
    But I should only have one entry.
    What is showing up on the zimbra Web client ?

    Can you please give a step by step list of instructions to reproduce the problem.

  10. #380
    Sajuuk is offline Member
    Join Date
    Nov 2010
    Posts
    14
    Rep Power
    4

    Default

    On Zimbra web client I can see my appointment normaly. There is only one appointment with details who accepted and who declined meeting request.
    Procedure for reproducing the problem:
    Create meeting on your phone (in my case iPhone)
    Add invitees to the meeting (meeting request are send through mail server), for test I have used gmail account
    On my gmail account, accept meeting request
    Sync your calendar on phone, and you should receive new meeting request (from gmail acceptance)

    The problem is that in Zimbra web I have recieved mail that my meeting request is accepted and on calendar is written that.
    On iPhone, I recieve the mail, but instead update on my meeting, I receive new meeting request (from gmail account).

    It looks complicated, so I hope that you understand what have I wrote.

Page 38 of 105 FirstFirst ... 2836373839404888 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. fatal: parameter "smtpd_recipient_restrictions"
    By Robin in forum Administrators
    Replies: 8
    Last Post: 12-22-2010, 05:48 AM
  2. Replies: 12
    Last Post: 02-25-2008, 07:28 PM
  3. /tmp filling
    By Nutz in forum Administrators
    Replies: 8
    Last Post: 02-22-2008, 02:00 AM
  4. Replies: 22
    Last Post: 12-02-2007, 05:05 PM
  5. zmtlsctl give LDAP error
    By sourcehound in forum Administrators
    Replies: 5
    Last Post: 03-11-2007, 03:48 PM

Posting Permissions

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