Unable to have new contacts sync from outlook
-
CARDDAV_SUPPORTS_SYNC has nothing to do with two way sync.
It tells Z-Push whether it always has to check every contact in your CardDAV addressbook for changes or if your CardDAV server supports synctoken, which as far as I know radicale does.
With synctoken, Z-Push is able ask the CardDAV server if something has changed, without having to check every contact every time.It should work both ways with every client.
Is it possible, that your Outlook stores these contacts locally?
-
@bob4os
Thanks for your reply.It is currently storing them locally on outlook, however I had created/configured the outlook profile at the same time as the android’s one was configured.
I know that the downloaded contacts from the carddav server are landing in the same folder on outlook as the locally stored contact(s) are being saved.
Just not sure where to look on the Z-Push side to see if outlook is having issues pushing the contact up to the server.
Cheers
-
@dborg89
Is this your only account in this Outlook profile?
Do you have an IMAP account configured too?I have had this behaviour, when the Exchange ActiveSync account was not the first account configured in a fresh Outlook profile.
Outlook somehow defines weird defaults, if your first account is an IMAP account.
-
@dborg89
It does not matter if multiple devices are configured at the same time.
They are treated as separate devices with no overlap at all. -
@bob4os said in Unable to have new contacts sync from outlook:
Is this your only account in this Outlook profile?
Yes. I create a new profile in the mail app (in control panel).
Do you have an IMAP account configured too?
IMAP, Caldav and Carddav are configured. Z-push config is using combined and combined config can be seen here > https://pastebin.com/TZYLfxPu
I have had this behaviour, when the Exchange ActiveSync account was not the first account configured in a fresh Outlook profile.
I am using the “Exchange ActiveSync” (https://ibb.co/vPyHb5c) setup instead of the auto discover that the first page does (https://ibb.co/HtxNVYj).
Outlook somehow defines weird defaults, if your first account is an IMAP account.
I did try to recreate the profile again on Outlook, should I try again?
-
@dborg89
I meant, if you have setup another mailbox with IMAP in your Outlook, not the Z-Push BackendCombined.If you did start with a clean profile already, I don’t know if this will help.
You are doing it the right way.Do you know the Kopano Outlook Extension? (https://download.kopano.io/community/olextension%3A/)
It’s a Outlook plugin, which makes your live easier if you need a resync - but if you setup your account, there is a weird glitch, where Outlook changes it’s ID, the first time it is restarted after setup.
Outlook will look like it deleted everything.
(Read: https://forum.kopano.io/topic/99/outlook-with-roaming-profile-on-different-computers/1?_=1646949342390)You are able to check for your ID with “z-push-admin.php”. Just list your devices like this:
z-push-admin.php -a list -u <your username>
Maybe fixing the ID might work:
"HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Profiles\9375CFF0413111d3B88A00104B2A6676\00000002\EAS Device ID"
Or just use the plugin to sync again.
I have not had it loose its ID again afterwards. -
Doing some more digging and I have found an issue on the outlook contact add that doesn’t exist on the android one.
Below is the radicale output.[2022-03-10 19:21:23 -0500] [582878/Thread-108] [DEBUG] Request content: BEGIN:VCARD VERSION:3.0 PRODID:Z-Push FN:OLCL\, Testing N:OLCL;Testing EMAIL;PREF=1:test@123.com TEL;TYPE=WORK,VOICE:123456789 NOTE:^M\n UID:D5D32087-90ED09CE-D9126A6B END:VCARD [2022-03-10 19:21:23 -0500] [582878/Thread-108] [WARNING] Bad PUT request on '/outlook@domain.email/contacts/D5D32087-90ED09CE-D9126A6B.vcf': At line 17: Failed to parse line: \n Traceback (most recent call last): File "/srv/radicale/env/lib/python3.9/site-packages/radicale/app/put.py", line 144, in do_PUT vobject_items = radicale_item.read_components(content or "") File "/srv/radicale/env/lib/python3.9/site-packages/radicale/item/__init__.py", line 52, in read_components return list(vobject.readComponents(s)) File "/srv/radicale/env/lib/python3.9/site-packages/vobject/base.py", line 1101, in readComponents vline = textLineToContentLine(line, n) File "/srv/radicale/env/lib/python3.9/site-packages/vobject/base.py", line 925, in textLineToContentLine return ContentLine(*parseLine(text, n), **{'encoded': True, File "/srv/radicale/env/lib/python3.9/site-packages/vobject/base.py", line 813, in parseLine raise ParseError("Failed to parse line: {0!s}".format(line), lineNumber) vobject.base.ParseError: At line 17: Failed to parse line: \n [2022-03-10 19:21:23 -0500] [582878/Thread-108] [DEBUG] Response content: Bad Request```
-
@dborg89
I think it is the NOTE property. “^M\n” is a CRLF (carriage return + line feed)According to RFC6350 line breaks in a TEXT value have to be either “\n” or “\N”.
CRLF ("\r\n") is reserved for multi line values, followed by a whitespace.I think this is the issue.
BackendCardDAV is escaping or replacing those problematic characters already with the function escape() - but somehow this did not work…?Did you place a note into this new contact?
-
I think it is the NOTE property. “^M\n” is a CRLF (carriage return + line feed)
According to RFC6350 line breaks in a TEXT value have to be either “\n” or “\N”.
CRLF ("\r\n") is reserved for multi line values, followed by a whitespace.I think this is the issue.
Yeah spotted this too.
BackendCardDAV is escaping or replacing those problematic characters already with the function escape() - but somehow this did not work…?
Did you place a note into this new contact?
No but outlook adds it irrespective
I wonder if its worth adding a simple str replace on Z-Push’s end or a strip/replace on radicales end.
-
@dborg89
Look at backend/carddav/carddav.php line 1278:if ($k == 'body' && isset($message->asbody->data)) { $val = stream_get_contents($message->asbody->data); }
$message->body is only set in ActiveSync version 2.5.
Since ActiveSync version 12.0 the body is in $message->asbody->data and the content is not escaped here.Try this:
if ($k == 'body' && isset($message->asbody->data)) { $val = $this->escape(stream_get_contents($message->asbody->data)); }
There is also no check if the data is type “html” or “rtf” or “plain” - what a mess…
-
@bob4os
You are a legend!
This issue is now resolved for outlook PC.I have synced the acc across android and outlook (as well as my webmail client) and all 3 are syncing and able to add and retrieve new contacts.
Thank you very much :)
Might be worth including into your GH repo too.
-
@dborg89
I am glad I could help.I will add that with the missing body type information…
(Just gotta check specifications once again, what is necessary.)