Engine/SyncFolderMode

Purpose

With Email, some MUAs are hard to configure not to announce incoming messages in Inbox to the user. Therefore, there is this application level protocol to decide whether a subfolder must be used instead.

Wether or not such a subfolder exist is an attribute of each account.

If the folder exists it is not only used for pEp sync but for all auto generated messages coming from messageToSend().

Name

If such a subfolder exists its name must be `pEpAutoMessages’ (without quotes). It is a folder in Inbox and not a subfolder of another folder in Inbox.

Creation

An application may create pEpAutoMessages as subfolder to the Inbox of one or more accounts. By doing so, it is announcing to use the subfolder instead of the Inbox for this account.

An application may only create pEpAutoMessages if two conditions match:

  1. the application is a plugin, which is not able to suppress user notification about incoming auto generated messages
  2. the application can make sure that creation of the subfolder will not risk any other functionality

Detection and startup of pEp sync

An application must detect on startup whether and for which accounts pEpAutoMessages subfolders are existing. The detection must run before pEp Sync is started.

An application must detect while runtime wether a new pEpAutoMessages subfolder in an Inbox of an account was created, where there was no such subfolder before. If the detection is successful the application must stop pEp sync, configure the account to use the pEpAutoMessages subfolder and restart pEp sync.

Usage

messageToSend()

For all accounts where a pEpAutoMessages subfolder exists in Inbox the application must send all messages from messageToSend() to this subfolder instead of to the Inbox.

readpEpAutoMessages()

For all accounts where a pEpAutoMessages subfolder exists in Inbox the application must decrypt all messages in this subfolder when they appear, exactly like they would appear in Inbox directly.

Auto generated messages in a pEpAutoMessages subfolder must be deleted when they expire following exactly the same rules as when they appear in the Inbox directly.

This behaviour must be implemented in addition to the same behaviour for the Inbox directly. It does not replace the behaviour for the Inbox. There may be still auto generated messages coming through the Inbox, which must be processed as before. There may be still pEp sync messages being attached to user messages, which must be processed as before, too.

Misc

The inventor of the first version of this protocol is Patrick Meier.