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

Two accounts on one device #97

jfedyczak opened this Issue Sep 21, 2014 · 7 comments


None yet
6 participants

jfedyczak commented Sep 21, 2014

Hi, I'm trying to setup Z-Push-contrib with IMAP backed. Everything works perfectly until I add second account on one device. Only one account works correctly. I'm seeing following errors in log:

21/09/2014 14:59:03 [12550] [INFO] [some@account] StateNotFoundException: FileStateMachine->GetState(): Could not locate state '/home/www/zpush-state2/g/j/905avdfedl5tb3idt6r3cjgljg-bs-1411304185' - code: 0
21/09/2014 14:59:03 [12550] [WARN] [some@account] BackendIMAP->getImapIdFromFolderId('678de0d2') = not initialized!
21/09/2014 14:59:03 [12550] [INFO] [some@account] StatusException: Folderid not found in cache - code: 12

I found quick'n'dirty workaround:

if (isset($_GET['DeviceId']) && isset($_GET['User']))
    $_GET['DeviceId'] = sha1($_GET['DeviceId'].":".$_GET['User']);

Is there any "legit" way to fix this? Some config option, I am missing?


This comment has been minimized.


fmbiete commented Sep 21, 2014

Hi @jfedyczak

It's a known limitation and there isn't any good solutions for this at the moment.
When using 2 accounts in the same mobile you will found that the states will dissapear forcing a resync every few minutes.

Before touching z-push core to add the [user, device] as key for the states I was waiting to the z-push main developers to accept all the pending changes but they seem to have other priorities.


This comment has been minimized.

cacsa commented Mar 4, 2015

Hi all,

Where is that workaround code placed? Which file? I have been searching all over for a fix on this same exact issue.



This comment has been minimized.

jfedyczak commented Mar 4, 2015

@cacsa Just before closing ?> in config.php:

if (isset($_GET['DeviceId']) && isset($_GET['User']) && $_GET['DeviceId'] != "")
    $_GET['DeviceId'] = sha1($_GET['DeviceId'].":".$_GET['User']);

This comment has been minimized.

cacsa commented Mar 4, 2015

Perfect.. Thank you so much @jfedyczak !!


This comment has been minimized.

rastikw commented Apr 27, 2015

Excellent patch, thank you.


This comment has been minimized.

alexhass commented Jul 21, 2017

Can you guys move this case to a bugfix, please? Manual patching is not really fun and that you may have an info and your user account on a mobile should be more than common.


This comment has been minimized.

soundguy06 commented Dec 4, 2017

@jfedyczak and others, which exact file under z-push did you place the edit in? I have several config.php under /usr/local/lib/z-push/, some with a ?> and some without. I am on the newest version of MIAB and I have issues with having more than one account on an iphone at a time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment