/usr/share/syncevolution/xml/datatypes/server/44email-nokia9500.xml is in syncevolution-common 1.5.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | <datatype name="email_nokia9500" basetype="text">
<use profile="rfc2822_email"/>
<typestring>message/x-rfc822</typestring> <!-- this is Nokia 9500/9300-like -->
<versionstring>1.0</versionstring>
<initscript><![CDATA[
INTEGER ITEMLIMIT;
// default limit is limit of session
ITEMLIMIT = SIZELIMIT();
]]></initscript>
<processitemscript><![CDATA[
INTEGER n;
// For Nokia Email, we must derive folder ID from source LocURI
// which has form "./somestrangenumber/folder/itemid"
// where folder can be "Inbox" or "Outbox"
if (FIND(REMOTEID(),"Inbox",0)!=UNASSIGNED) {
FOLDER="INBOX";
}
else if (FIND(REMOTEID(),"Outbox",0)!=UNASSIGNED) {
FOLDER="OUTBOX";
}
// pre-process item
if (UPPERCASE(FOLDER)=="INBOX") {
// In any case, prevent adding to inbox (delete remote items instead)
PREVENTADD();
// server always wins for inbox
CONFLICTSTRATEGY("server-wins");
if (SLOWSYNC()) {
// also prevent modifications in server
IGNOREUPDATE();
}
else {
// normal sync items going to inbox from client need special treatment
if (SYNCOP()=="add" || SYNCOP()=="replace") {
// make sure that existing server item will conflict with this item
if (LIMIT!=EMPTY && (LIMIT<0 || LIMIT>SIZELIMIT())) {
// force conflict only if this is a reload
FORCECONFLICT();
}
// make sure we never overwrite a body in the inbox
BODY = UNASSIGNED;
// delete always wins over replace in inbox (to avoid adds to inbox)
DELETEWINS();
}
}
}
else if (UPPERCASE(FOLDER)=="OUTBOX") {
// never try to change something in outbox
IGNOREUPDATE();
if (SYNCOP()!="delete") {
// - date of mail is NOW, set it such that a correct date is written to the DB
MAILDATE = DBNOW();
// MAILDATE = (INTEGER)DBNOW() - TIMEUNITS(120); // %%% backdate it 2 mins to make sure it does not get retransmitted
// - echo item as delete (this causes that it is moved to the "sent" folder in the 9500)
ECHOITEM("delete");
}
CONFLICTSTRATEGY("client-wins");
}
else {
// Other folder
// - silently discard incoming item for other folder than the above
// except if it is a delete
if (SYNCOP()!="delete")
REJECTITEM(0);
}
]]></processitemscript>
<mergescript><![CDATA[
// pre-process item
if (UPPERCASE(LOOSING.FOLDER)!="OUTBOX") {
// non-outbox (especially inbox) needs special merge to accomplish reload feature
// - loosing item is client's, winning is server's
if (LOOSING.LIMIT!=EMPTY) {
// loosing (remote) item specifies a new limit, override winning's default
WINNING.LIMIT=LOOSING.LIMIT;
SETWINNINGCHANGED(TRUE);
}
// make sure winning has right folder
WINNING.FOLDER=LOOSING.FOLDER;
// make sure a set read-flag gets propagated to server
if (LOOSING.ISREAD=="true") WINNING.ISREAD="true";
// merge other fields normally
MERGEFIELDS();
// make sure body does not get re-written to local DB even if merge would cause local update
LOOSING.BODY=UNASSIGNED;
}
else {
// normal merging in other folders
MERGEFIELDS();
}
]]></mergescript>
<outgoingscript><![CDATA[
// we can only send to inbox or outbox
// - If we have no remote ID (=add command) prepare special Target item ID
// containing target folder.
if (REMOTEID()==EMPTY) {
if (UPPERCASE(FOLDER)=="INBOX") {
SETREMOTEID(REMOTEDBNAME()+"/Inbox/");
}
else if (UPPERCASE(FOLDER)=="OUTBOX") {
SETREMOTEID(REMOTEDBNAME()+"/Outbox/");
}
}
]]></outgoingscript>
<filterinitscript><![CDATA[
// check if we need to filter
INTEGER NEEDFILTER;
NEEDFILTER =
!DBHANDLESOPTS() && // only if DB cannot handle it
(STARTDATE()!=EMPTY); // and only if a start date is set (end date not needed as there are never future emails today)
SETFILTERALL(NEEDFILTER);
RETURN NEEDFILTER;
]]></filterinitscript>
<filterscript><![CDATA[
INTEGER PASSES;
// check if item passes filter
PASSES=FALSE;
// Filter out anything not for Inbox or Outbox
if (UPPERCASE(FOLDER)!="INBOX" && UPPERCASE(FOLDER)!="OUTBOX") RETURN FALSE;
// Emails pass if they have a MAILDATE on or later than start date
PASSES = MAILDATE>=STARTDATE();
RETURN PASSES;
]]></filterscript>
</datatype>
|