Skip to content

Add iphone compatible NOTES support to IMAP backend#69

Open
JorisHansMeijer wants to merge 1 commit intoZ-Hub:developfrom
JorisHansMeijer:develop
Open

Add iphone compatible NOTES support to IMAP backend#69
JorisHansMeijer wants to merge 1 commit intoZ-Hub:developfrom
JorisHansMeijer:develop

Conversation

@JorisHansMeijer
Copy link
Copy Markdown

Released under the GNU Affero General Public License (AGPL), version 3

What does this implement/fix? Explain your changes.

This code adds support for NOTES on IMAP backup (compatible with Iphone)

Does this close any currently open issues?

...

Any relevant logs, error output, etc?

...

Where has this been tested?

Server (please complete the following information):

  • OS: [e.g. iOS]
  • PHP Version: [e.g. 8.2]
  • Backend for: [e.g. Kopano, Zimbra, Mail-in-a-Box]
  • and Version: [e.g. git, 9.0, v61.1]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Mail App [e.g. GMail, Apple Mail]
  • Version [e.g. 22]

@matidau
Copy link
Copy Markdown
Collaborator

matidau commented Jun 12, 2024

Thanks @JorisHansMeijer for the PR.

I'm guessing the stickynotes backend doesn't meet your purpose, and I could guess at the reasons, but do you mind explaining why?

I prefer to have this as an optional that can be turned on in the imap config.php. Are you able to comment out this define('IMAP_FOLDER_NOTE', 'NOTES'); and ensure that this doesn't break on the iPhone?

And last there are some changes to the $folderid that while probably are correct make it a bit hard to review as these don't strictly look like they are needed for the Notes functionality. Would prefer these to get split out in to separate commits, if you are able to.

@matidau
Copy link
Copy Markdown
Collaborator

matidau commented Aug 1, 2024

Just to follow up on this, I've now tested your branch and the following is produced.

01/08/2024 16:35:18 [1245470] [FATAL] [mail@xxx.id.au] Fatal error: /usr/local/lib/z-push/backend/imap/imap.php:1208 - Uncaught Error: Undefined constant "IMAP_FOLDER_NOTE" in /usr/local/lib/z-push/backend/imap/imap.php:1208
Stack trace:
#0 /usr/local/lib/z-push/lib/default/diffbackend/exportchangesdiff.php(160): BackendIMAP->GetMessage()
#1 /usr/local/lib/z-push/lib/request/sync.php(1205): ExportChangesDiff->Synchronize()
#2 /usr/local/lib/z-push/lib/request/sync.php(962): Sync->syncFolder()
#3 /usr/local/lib/z-push/lib/request/requestprocessor.php(116): Sync->Handle()
#4 /usr/local/lib/z-push/index.php(107): RequestProcessor::HandleRequest()
#5 {main}
  thrown (1)

Do you mind reviewing?

@JorisHansMeijer
Copy link
Copy Markdown
Author

Sorry about my late reaction. Been busy with other things. The config.php in the imap folder should contain the define (like below line with IMAP_FOLDER_NOTE):

// Draft folder name (case doesn't matter)
define('IMAP_FOLDER_DRAFT', 'DRAFTS');

// Trash folder name (case doesn't matter)
define('IMAP_FOLDER_TRASH', 'TRASH');

// Trash folder name (case doesn't matter)
define('IMAP_FOLDER_NOTE', 'NOTES');

@iredmail
Copy link
Copy Markdown
Contributor

Really need to sync notes to iPhone. :)

@JorisHansMeijer
Copy link
Copy Markdown
Author

This diff should do that :) I can't think of any reason for the problem above. The only reason I can think of is that the IMAP_FOLDER_NOTE define was not added to the config.php when testing.

@JorisHansMeijer
Copy link
Copy Markdown
Author

For me iphone notes is syncing, I am using a synology nas with php 7.4.33

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants