Z-Hub / Z-Push

Home of Z-Push
https://z-push.org
GNU Affero General Public License v3.0
97 stars 47 forks source link

Error when searching mail on iphone #23

Closed mschering closed 3 weeks ago

mschering commented 1 year ago

Hi,

Thanks for restarting z-push!

I have an issue with the iphone when searching e-mail. It uses a Find cmd which is not supported by z-push. Is there anyway it can be fixed so it will fallback to the older AS version?

Here's a snippet from the z-push debug log:

20/07/2023 16:52:17 [ 644] [ INFO] [admin] cmd='Find' memory='1.87 MiB/4.00 MiB' time='0.10s' devType='iPhone' devId='' getUser='admin' from='172.29.0.1' idle='0s' version='2.6.1' method='POST' httpcode='500' 20/07/2023 16:52:17 [ 644] [DEBUG] [admin] -------- End 20/07/2023 16:52:17 [ 537] [DEBUG] [admin] -------- Start 20/07/2023 16:52:17 [ 537] [DEBUG] [admin] cmd='Find' devType='iPhone' devId='' getUser='admin' from='172.29.0.1' version='2.6.1' method='POST' 20/07/2023 16:52:17 [ 537] [DEBUG] [admin] Used timezone 'Europe/Amsterdam' 20/07/2023 16:52:17 [ 537] [DEBUG] [admin] Request::ProcessHeaders() ASVersion: 14.0 20/07/2023 16:52:17 [ 537] [FATAL] [admin] FatalException: Requested the Z-Push URL without the required GET parameters - code: 0 - file: /usr/local/share/src/www/modules/z-push/vendor/z-push/index.php:71 20/07/2023 16:52:17 [ 537] [ INFO] [admin] User-agent: 'Apple-iPhone14C2/2006.75' 20/07/2023 16:52:17 [ 537] [FATAL] [admin] Exception: (FatalException) - Requested the Z-Push URL without the required GET parameters 20/07/2023 16:52:17 [ 537] [DEBUG] [admin] ZPush::PrintZPushLegal() 20/07/2023 16:52:17 [ 537] [DEBUG] [admin] InterProcessData:__construct type: '27fvov7b2l61b94tkth98kpeis' 20/07/2023 16:52:17 [ 537] [DEBUG] [admin] TopCollector(): Initialized. 20/07/2023 16:52:17 [ 537] [DEBUG] [admin] TopCollector initialised with IPC provider 'IpcSharedMemoryProvider' with type '20'

Thanks!

Best regards, Merijn

matidau commented 1 year ago

Hey Merijn,

Is this recent behaviour on the iPhone you are testing with?

The only solution from the Z-Push side may be to implement AS 16.1

Taggng #15

mschering commented 1 year ago

It might be since iOS 16. I actually implemented just this find command of the as16 spec and now it works again! If you’re interested I can create a pull request.

matidau commented 1 year ago

I am interested, but not sure that I want it in the current dev branch. Might create a new AS16 one for this.

If anyone else is experiencing this please feel free to drop a comment here.

matidau commented 1 year ago

@mschering if you can do a Pull Request against the branch AS16.1 it would be greatly appreciated.

matidau commented 1 year ago

I've also been informed that a Z-Push fork has implemented AS16.1 https://github.com/grommunio/grommunio-sync

Which I didn't make the connection from this post

https://github.com/Z-Hub/Z-Push/issues/15#issue-1751513557

For cool things that are now possible with recent ActiveSync versions you can check: https://grommunio.com/de/neuigkeiten/integration-von-exchange-activesync-16/

Parts of this can likely be re-used as well to jump start out AS16.1 efforts.

mschering commented 1 year ago

Thanks, I’ll look into it. I can create a pull request if you like but I am on holiday for 2 more weeks so it will be after that.

liverpoolfc-fan commented 1 year ago

@mschering Which backend are you using?

The backend (assuming it extends diffbackend) should implement the function GetSupportedASVersion - Provided that function returns something lower than ASV_16 the iPhone should not try to use ActiveSync 16 features. For example, the Zimbra Backend supports up to ActiveSync 14.1 - so it returns ASV_141

/**
 * Indicates which AS version is supported by the backend.
 * By default AS version 2.5 (ASV_25) is returned (Z-Push 1 standard).
 * Subclasses can overwrite this method to set another AS version
 *
 * @access public
 * @return string       AS version constant
 */
public function GetSupportedASVersion() {
    return ZPush::ASV_141; 
}
mschering commented 1 year ago

Yes I know it should not do that. I return ZPush::ASV_141 but my iphone with ios 16 still uses Find.

liverpoolfc-fan commented 1 year ago

How are you triggering the scenario?

I have an iPhone with iOS 16.6 on it. I can try to replicate it

mschering commented 1 year ago

Just search in a mail folder. It first searches on the device. But if you continue searching it will trigger the find.

liverpoolfc-fan commented 1 year ago

Interesting. I have never seen that before. I would say that is a bug in the iPhone client implementation. They should not try to perform a request that the server cannot handle.

aboferas commented 1 year ago

Thanks, I’ll look into it. I can create a pull request if you like but I am on holiday for 2 more weeks so it will be after that.

Hello I appreciate your support. We are looking for Find command support. Have you managed to create pull request?

mschering commented 7 months ago

Sorry, I finally was able to create and test it. I hope this will be incorporated.

matidau commented 7 months ago

Thank you, appreciate the effort.

@liverpoolfc-fan & @aboferas are either of you able to test the PR and confirm that this resolves the issue on iPhone?

aboferas commented 7 months ago

@matidau It didn't work with me. I got the following error: [ERROR] [user] Please check your logs for this PID and errors like PHP-Fatals or Apache segmentation faults and report your results to the Z-Push dev team. [ERROR] [user] LoopDetection->ProcessLoopDetectionPreviousConnectionFailed(): Command '' at 17/04/2024 10:26:46 with pid '69' terminated unexpectedly or is still running.

mschering commented 7 months ago

Are there any errors in the webserver error log?

aboferas commented 7 months ago

@mschering Those are the only errors in web server

matidau commented 5 months ago

If someone is able to test the PR #60 with an iPhone and the Imap backend, it would be greatly appreciated.

matidau commented 4 months ago

I've got an iPhone now and the develop branch + imap backend doesn't have this issue any longer for AS 14 (or AS 16).

matidau commented 3 weeks ago

Closing this as it is fixed