Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when searching mail on iphone #23

Open
mschering opened this issue Jul 20, 2023 · 19 comments
Open

Error when searching mail on iphone #23

mschering opened this issue Jul 20, 2023 · 19 comments

Comments

@mschering
Copy link
Contributor

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
Copy link
Collaborator

matidau commented Aug 3, 2023

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
Copy link
Contributor Author

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
Copy link
Collaborator

matidau commented Aug 3, 2023

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
Copy link
Collaborator

matidau commented Aug 4, 2023

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

@matidau
Copy link
Collaborator

matidau commented Aug 4, 2023

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

#15 (comment)

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
Copy link
Contributor Author

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
Copy link
Contributor

@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
Copy link
Contributor Author

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

@liverpoolfc-fan
Copy link
Contributor

How are you triggering the scenario?

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

@mschering
Copy link
Contributor Author

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

@liverpoolfc-fan
Copy link
Contributor

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
Copy link

aboferas commented Sep 20, 2023

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
Copy link
Contributor Author

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

@matidau
Copy link
Collaborator

matidau commented Apr 7, 2024

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
Copy link

@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
Copy link
Contributor Author

Are there any errors in the webserver error log?

@aboferas
Copy link

@mschering
Those are the only errors in web server

@matidau
Copy link
Collaborator

matidau commented Jun 12, 2024

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

@matidau
Copy link
Collaborator

matidau commented Aug 1, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants