<?xml version="1.0"?>
<!-- SYNTHESIS SYNC SERVER Version 3.4 Configuration file -->

<sysync_config version="1.0">

  <!-- this string is output to every session debug logfile to identify the config in use -->
  <configidstring>Synthesis SyncML Server Engine 3.4 sample config</configidstring>

  <debug>
    <!-- path where logfiles are stored -->
    <!-- <logpath platform="linux">/your/log/directory</logpath> -->
    <logflushmode>buffered</logflushmode> <!-- buffered is fastest mode, but may loose data on process abort. Other options: "flush" (after every line) or "openclose" (safest, slowest, like in 2.x server) -->
    <!-- per session log -->
    <sessionlogs>yes</sessionlogs> <!-- by default, create a session log file for every sync session (might be disabled for special users/devices in scripts) -->
    <!-- debug format options -->
    <logformat>html</logformat> <!-- html is nicely colored and easily viewable with a web browser. Other options: "xml", "text" -->
    <folding>auto</folding> <!-- dynamic folding of blocks enabled, automatically expanded or collapsed default. Other options: "none", "expanded", "collapsed" -->
    <timestamp>yes</timestamp> <!-- show timestamps for structure elements in log -->
    <timestampall>no</timestampall> <!-- don't show timestamp for every log line -->
    <timedsessionlognames>yes</timedsessionlognames> <!-- session logs also have the session start timestamp in the filename - makes them more easily sortable -->
    <!-- thread logging mode -->
    <subthreadmode>separate</subthreadmode> <!-- write log info from subthreads into separate log files. Other options: "suppress" -->
    <!-- basic debug level selection -->
    <enable option="extended"/> <!-- "extended" is a good choice for start testing. For production, use "normal" or "minimal" -->
    <!-- <enable option="normal"/> --> <!-- "normal" provides rich debug info, but still in reasonable size  -->
    <!-- <enable option="minimal"/> --> <!-- "minimal" just shows basic flow and error. Not suitable for debugging -->
    <!-- <enable option="maximal"/> --> <!-- "maximal" can create VERY LARGE logs and cause HEAVY SLOWDOWN. Only for detail debugging  -->
    <!-- <enable option="all"/> --> <!-- "all" shows EVERYTHING possible, and way too much for any normal situation. For hardcore debugging ONLY! -->
    <!-- additional debug info switches -->
    <enable option="userdata"/> <!-- Make this <disable ...> if you don't want user data in the logs -->
    <disable option="scripts"/> <!-- Make this <enable ...> to show script execution in logs  -->
    <disable option="match"/> <!-- Make this <enable ...> to show slow sync matching. CAN PRODUCE ENORMOUS LOGS and HEAVILY IMPACT PERFORMANCE for large slow syncs - use with care!  -->
    <disable option="exotic"/> <!-- Make this <enable ...> to include very in-detail info. CAN PRODUCE ENORMOUS LOGS and HEAVILY IMPACT PERFORMANCE for large slow syncs - use with care!  -->
    <!-- see manual for more debug info switches -->
    <!-- global log options -->
    <globallogs>no</globallogs> <!-- by default, do not log global session dispatching, creation etc. (not useful in multi-user operation) -->
    <singlegloballog>no</singlegloballog> <!-- a new global log will be started for every start of the server/application -->
    <!-- SyncML message dumping options -->
    <msgdump>no</msgdump> <!-- do not dump syncml traffic 1:1 to files -->
    <xmltranslate>no</xmltranslate> <!-- do not try to translate syncml traffic into XML (DO NOT SET THIS OPTION IN PRODUCTIVE SERVERS!) -->

  </debug>


  <scripting>
    <function><![CDATA[
      // create a UID
      string newuid() {
        return "syuid" + NUMFORMAT(RANDOM(1000000),6,"0") + "." + (string)MILLISECONDS(NOW());
      }
    ]]></function>


    <!-- define script macros for scripts that are used by both vCalendar 1.0 and iCalendar 2.0 -->

    <macro name="VCALENDAR_INCOMING_SCRIPT"><![CDATA[
      STRING MATCHES[];
      STRING CAT,CN,EM;
      INTEGER i;
      TIMESTAMP ts;
      // make sure we have all trailing and leading spaces eliminated
      DESCRIPTION=NORMALIZED(DESCRIPTION);
      SUMMARY=NORMALIZED(SUMMARY);
      // eliminate description that is the same as summary
      if (DESCRIPTION==SUMMARY) DESCRIPTION=EMPTY;
      // calendar or todo
      if (ISEVENT) {
        // VEVENT
        // - handle duration cases
        if (ISDURATION(DURATION)) {
          if (DTEND==EMPTY) DTEND = DTSTART + DURATION;
          if (DTSTART==EMPTY) DTSTART = DTEND - DURATION;
        }
        // - detect alldays in vCalendar 1.0 (0:00-0:00 or 23:59 localtime)
        i = ALLDAYCOUNT(DTSTART,DTEND,TRUE);
        if (ITEMDATATYPE()=="vCalendar10" && i>0) {
          // DTSTART and DTEND represent allday event, make them date-only values
          // - convert start to user zone (or floating) so it represents midnight
          DTSTART = CONVERTTOUSERZONE(DTSTART);
          MAKEALLDAY(DTSTART,DTEND,i);
        }
        else {
          // iCalendar 2.0 - only if DTSTART is a date-only value this really is an allday
          if (ISDATEONLY(DTSTART)) {
            // reshape to make sure we don't have invalid zero-duration alldays (old OCS 9 servers)
            MAKEALLDAY(DTSTART,DTEND,i);
          }
        }
        // - shape attendees (and make sure ATTENDEES[] is assigned even for empty email addresses)
        i=0;
        while(i<SIZE(ATTENDEES) || i<SIZE(ATTENDEE_CNS)) {
          PARSEEMAILSPEC(ATTENDEES[i], CN, EM);
          ATTENDEES[i] = EM; // pure email address
          // in case we have no specific common name, use the one extracted from the email
          // This catches the vCalendar 1.0 case and eventually ill-formed iCalendar 2.0 as well
          if (ATTENDEE_CNS[i]==EMPTY)
            ATTENDEE_CNS[i]=CN;
          // default participation status to needs-action
          if (ATTENDEE_PARTSTATS[i]==EMPTY)
            ATTENDEE_PARTSTATS[i]=1; // 1=needs action
          i=i+1;
        }
        // - shape organizer
        PARSEEMAILSPEC(ORGANIZER, CN, EM);
        ORGANIZER = EM; // pure email address
        if (ORGANIZER_CN==EMPTY)
          ORGANIZER_CN=CN;
      }
      else {
        // VTODO
        // - make sure we have at least a summary
        if (SUMMARY==EMPTY) SUMMARY=DESCRIPTION; // use description if we don't have a summary
        if (SUMMARY==EMPTY) SUMMARY="unnamed"; // set dummy summary if we still don't have one
        // due shaping for non-iCalendar 2.0
        if (ITEMDATATYPE()=="vCalendar10" && ALLDAYCOUNT(DUE,DUE,TRUE,TRUE)>0) {
          DUE = DATEONLY(DUE);
        }
      }
      // Common alarm handling
      // - handle relative alarm time (as possible with VALARM TRIGGER)
      if (ISDURATION(ALARM_TIME)) {
        if (ALARM_REL==2)
          ts = DTEND; // relative to end
        else {
          if (ISEVENT)
            ts = DTSTART; // relative to start for events
          else
            ts = DUE; // relative to due for todos
        }
        // for now, make ALARM user(=system) zone in all cases
        ALARM_TIME = CONVERTTOUSERZONE(POINTINTIME(ts),TRUE) + ALARM_TIME;
      }
    ]]></macro>


    <macro name="VCALENDAR_OUTGOING_SCRIPT"><![CDATA[
      // set UTC time of generation for iCalendar 2.0 DTSTAMP
      DGENERATED = NOW();
      // make sure we have all trailing and leading spaces eliminated
      DESCRIPTION=NORMALIZED(DESCRIPTION);
      SUMMARY=NORMALIZED(SUMMARY);
      if (ISEVENT) {
        // VEVENT
        // - combine attendee email address and common name into single string for vCalendar 1.0
        if (ITEMDATATYPE()=="vCalendar10") {
          i=0;
          while(i<SIZE(ATTENDEES)) {
            ATTENDEES[i] = MAKEEMAILSPEC(ATTENDEE_CNS[i], ATTENDEES[i]);
            i=i+1;
          }
          ORGANIZER = MAKEEMAILSPEC(ORGANIZER_CN, ORGANIZER);
        }
      }
      else {
        // VTODO
        // - Nothing special so far
      }
      // make sure we have at least a summary
      if (SUMMARY==EMPTY) SUMMARY=SUBSTR(DESCRIPTION,0,32); // derive from description
      if (SUMMARY==EMPTY) SUMMARY="unnamed"; // in case description is empty as well
      // do NOT send duration (some servers crash when doing so)
      DURATION = UNASSIGNED;
      // shape alarm
      if (ALARM_TIME!=EMPTY) {
        if (ITEMDATATYPE()=="iCalendar20") {
          if (ALARM_ACTION==EMPTY) ALARM_ACTION = "AUDIO";
          ALARM_TIME = CONVERTTOUSERZONE(ALARM_TIME,TRUE); // unfloat into user (system) zone, in case it is floating
          ALARM_TIME = CONVERTTOZONE(ALARM_TIME,"UTC"); // must always be UTC by iCalendar 2.0 specs
          // send as duration if we have non-empty non-date DTSTART
          if (DTSTART!=EMPTY && !ISDATEONLY(DTSTART)) {
            // make a duration (unfloat DTSTART into system zone in case it is floating first!)
            ALARM_TIME = ALARM_TIME-CONVERTTOZONE(CONVERTTOUSERZONE(DTSTART,TRUE),"UTC");
            ALARM_REL = 1; // relative to start
          }
        }
        else {
          if (ALARM_MSG==EMPTY) ALARM_MSG="alarm";
        }
      }
    ]]></macro>
    <!-- The following email handling scripts are defined as script MACROS because they
         are used in multiple <datatype> definitions below. This avoids duplicating these
         script's source code in the config file -->

    <macro name="EMAIL_INIT_SCRIPT"><![CDATA[
      INTEGER ITEMLIMIT;
      // default limit is limit of session
      ITEMLIMIT = SIZELIMIT();
    ]]></macro>


    <macro name="EMAIL_PROCESSITEM_SCRIPT"><![CDATA[
      // 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 replace (to force-move it to the sent folder)
          ECHOITEM("replace");
        }
        CONFLICTSTRATEGY("client-wins");
      }
      else if (UPPERCASE(FOLDER)=="SENT") {
        // never try to change something in sent folder
        IGNOREUPDATE();
        // Server has precedence in case of conflicts
        CONFLICTSTRATEGY("server-wins");
        // Implement reload capability for sent items as well
        if (SLOWSYNC()) {
          // do not add new sent items to the server in slowsync
          PREVENTADD(); // causes extra sent items on the client to be deleted
        }
        else {
          // make sure that existing server item will conflict with this item
          if (SYNCOP()=="replace") {
            if (LIMIT!=EMPTY && (LIMIT<0 || LIMIT>SIZELIMIT())) {
              // force conflict only if this is a reload
              FORCECONFLICT();
              REJECTITEM(200); // but do not process the item further
            }
            else {
              // silently ignore other types of changes
              REJECTITEM(200);
            }
            // make sure we never overwrite a body in the sent folder
            BODY = UNASSIGNED;
          }
        }
      }
      else {
        // Other folder
        // - silently discard incoming item for other folder than the above
        //   except if it is a delete
        if (SYNCOP()!="delete")
          REJECTITEM(0);
      }
    ]]></macro>


    <macro name="EMAIL_MERGE_SCRIPT"><![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();
      }
    ]]></macro>

    <macro name="EMAIL_OUTGOING_SCRIPT"><![CDATA[
      // pre-process item
      if (UPPERCASE(FOLDER)=="OUTBOX") {
        // writing to outbox is always the ECHOITEM
        // - cause item to move into "sent" folder
        FOLDER = "sent";
        if (!SESSIONVAR("retransfer_body")) {
          // - prevent body retransfer, but not for dumb P800/P900/M600/P990 clients
          BODY = UNASSIGNED; // prevent body transfer
          ATT_COUNT = 0; // prevent attachment transfer
          ATT_CONTENTS = UNASSIGNED;
          // basically, this item is not limited (already complete on the client)
          // even if contents are not sent
          LIMIT = -1;
          SETSIZELIMIT(-1);
        }
      }
      else {
        // outgoing item to any folder of of remote (inbox, sent...)
        // - limit body to what is set in the LIMIT field
        // %%% probably obsolete, as textitem will handle limit field automatically for >=V1.0.8.21
        IF (LIMIT==EMPTY)
          LIMIT = SIZELIMIT(); // if none set already, use default for this item (=default of datastore, if not SETSIZELIMIT() called before for this item generation)
      }
      // set limit for item generator
      if (LIMIT!=EMPTY)
        SETSIZELIMIT(LIMIT);
    ]]></macro>


    <macro name="EMAIL_FILTERINIT_SCRIPT"><![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;
    ]]></macro>


    <macro name="EMAIL_FILTER_SCRIPT"><![CDATA[
      INTEGER PASSES;

      // check if item passes filter
      PASSES=FALSE;
      // Emails pass if they have a MAILDATE on or later than start date
      PASSES = MAILDATE>=STARTDATE();
      RETURN PASSES;
    ]]></macro>

  </scripting>


  <datatypes>
    <!-- list of internal fields representing vCard data -->
    <fieldlist name="contacts">
      <field name="SYNCLVL" type="integer" compare="never"/>
      <field name="REV" type="timestamp" compare="never" age="yes"/>

      <!-- Name elements -->
      <field name="N_LAST" type="string" compare="always"/>
      <field name="N_FIRST" type="string" compare="always"/>
      <field name="N_MIDDLE" type="string" compare="always"/>
      <field name="N_PREFIX" type="string" compare="conflict"/>
      <field name="N_SUFFIX" type="string" compare="conflict"/>
      <field name="NICKNAME" type="string" compare="conflict"/>
      <field name="TITLE" type="string" compare="conflict" merge="fillempty"/>

      <field name="FN" type="string" compare="conflict" merge="fillempty"/>

      <!-- categories and classification -->
      <field name="CATEGORIES" array="yes" type="string" compare="conflict"/>

      <!-- organisation -->
      <field name="ORG_NAME" type="string" compare="slowsync" merge="fillempty"/>
      <field name="ORG_DIVISION" type="string" compare="conflict" merge="fillempty"/>

      <!-- birthday -->
      <field name="BDAY" type="date" compare="conflict" merge="fillempty"/>

      <!-- telephone numbers -->
      <field name="TEL"         array="yes" type="telephone" compare="conflict"/>
      <field name="TEL_FLAGS"   array="yes" type="integer"   compare="conflict"/> <!-- offset 0 -->
      <field name="TEL_LABEL"   array="yes" type="string"    compare="conflict"/> <!-- offset 1 -->
      <field name="TEL_ID"      array="yes" type="integer"   compare="conflict"/> <!-- offset 2 -->

      <!-- emails -->
      <field name="EMAIL"       array="yes" type="multiline" compare="conflict"/>
      <field name="EMAIL_FLAGS" array="yes" type="integer"   compare="conflict"/> <!-- offset 0 -->
      <field name="EMAIL_LABEL" array="yes" type="string"    compare="conflict"/> <!-- offset 1 -->
      <field name="EMAIL_ID"    array="yes" type="integer"   compare="conflict"/> <!-- offset 2 -->

      <!-- web addresses -->
      <field name="WEB"         array="yes" type="url" compare="conflict"/>
      <field name="WEB_FLAGS"   array="yes" type="integer"   compare="conflict"/> <!-- offset 0 -->
      <field name="WEB_LABEL"   array="yes" type="string"    compare="conflict"/> <!-- offset 1 -->
      <field name="WEB_ID"      array="yes" type="integer"   compare="conflict"/> <!-- offset 2 -->

      <!-- home address -->
      <field name="ADR_STREET"        array="yes" type="multiline" compare="conflict"/>
      <field name="ADR_ADDTL"         array="yes" type="multiline" compare="conflict"/>
      <field name="ADR_STREET_FLAGS"  array="yes" type="integer"   compare="conflict"/> <!-- offset 0 (from ADR_STREET_FLAGS) -->
      <field name="ADR_STREET_LABEL"  array="yes" type="string"    compare="conflict"/> <!-- offset 1 -->
      <field name="ADR_STREET_ID"     array="yes" type="integer"   compare="conflict"/> <!-- offset 2 -->
      <field name="ADR_POBOX"         array="yes" type="multiline" compare="conflict"/>
      <field name="ADR_CITY"          array="yes" type="multiline" compare="conflict"/>
      <field name="ADR_REG"           array="yes" type="multiline" compare="conflict"/>
      <field name="ADR_ZIP"           array="yes" type="multiline" compare="conflict"/>
      <field name="ADR_COUNTRY"       array="yes" type="multiline" compare="conflict"/>

      <!-- Note -->
      <field name="NOTE" type="multiline" compare="conflict" merge="lines"/>

      <!-- Photo -->
      <field name="PHOTO" type="blob" compare="never" merge="fillempty"/>
      <field name="PHOTO_TYPE" type="integer" compare="never" merge="fillempty"/>

    </fieldlist>
    <!-- vCard profile -->
    <mimeprofile name="vCard" fieldlist="contacts">

      <profile name="VCARD" nummandatory="0"> <!-- we allow records without "N" as Address book can store them -->
        <property name="VERSION">
          <value conversion="version"/>
        </property>

        <property onlyformode="standard" name="PRODID" mandatory="no">
          <value conversion="prodid"/>
        </property>

        <property name="REV">
          <value field="REV"/>
        </property>

        <property name="N" values="5" mandatory="yes"> <!-- Note: makes N parse and generate even if not in remote's CTCap -->
          <value index="0" field="N_LAST"/>
          <value index="1" field="N_FIRST"/>
          <value index="2" field="N_MIDDLE"/>
          <value index="3" field="N_PREFIX"/>
          <value index="4" field="N_SUFFIX"/>
        </property>

        <property name="FN">
          <value field="FN"/>
        </property>

        <property name="NICKNAME" onlyformode="standard">
          <value field="NICKNAME"/>
        </property>

        <property name="TITLE">
          <value field="TITLE"/>
        </property>

        <property name="CATEGORIES" values="list" valueseparator="," altvalueseparator=";" > <!-- non-standard, but 1:1 as in vCard 3.0 (NOT like in vCalendar 1.0, where separator is ";") -->
          <value field="CATEGORIES"/>
          <position field="CATEGORIES" repeat="array" increment="1" minshow="0"/>
        </property>

        <property name="ORG" values="2">
          <value index="0" field="ORG_NAME"/>
          <value index="1" field="ORG_DIVISION"/>
        </property>

        <property name="TEL">
          <value field="TEL"/>
          <position field="TEL" repeat="array" increment="1" minshow="1"/>
          <parameter name="TYPE" default="yes" positional="no" show="yes">
            <value field="TEL_FLAGS" conversion="multimix" combine=",">
              <enum name="HOME"     value="B0"/>
              <enum name="WORK"     value="B1"/>
              <enum mode="ignore"   value="B2"/> <!-- OTHER -->
              <enum name="VOICE"    value="B3"/>
              <enum name="CELL"     value="B4"/>
              <enum name="FAX"      value="B5"/>
              <enum name="PAGER"    value="B6"/>
              <enum name="PREF"     value="B7"/>

              <enum mode="prefix" name="X-CustomLabel-" value="1.L"/>
              <enum mode="prefix" name="X-Synthesis-Ref" value="2.L"/>
            </value>
          </parameter>
        </property>

        <property name="EMAIL">
          <value field="EMAIL"/>
          <position field="EMAIL" repeat="array" increment="1" minshow="1"/>
          <parameter name="TYPE" default="yes" positional="no" show="yes">
            <value field="EMAIL_FLAGS" conversion="multimix" combine=",">
              <enum name="HOME"     value="B0"/>
              <enum name="WORK"     value="B1"/>
              <enum mode="ignore"   value="B2"/> <!-- OTHER -->
              <enum name="INTERNET" value="B3"/>

              <enum mode="prefix" name="X-CustomLabel-" value="1.L"/>
              <enum mode="prefix" name="X-Synthesis-Ref" value="2.L"/>
            </value>
          </parameter>
        </property>

        <property name="URL">
          <value field="WEB"/>
          <position field="WEB" repeat="array" increment="1" minshow="1"/>
          <parameter name="TYPE" default="yes" positional="no" show="yes">
            <value field="WEB_FLAGS" conversion="multimix" combine=",">
              <enum name="HOME"     value="B0"/>
              <enum name="WORK"     value="B1"/>
              <enum mode="ignore"   value="B2"/> <!-- OTHER -->
              <enum name="PREF"     value="B3"/>

              <enum mode="prefix" name="X-CustomLabel-" value="1.L"/>
              <enum mode="prefix" name="X-Synthesis-Ref" value="2.L"/>
            </value>
          </parameter>
        </property>

        <property name="ADR" values="7">
          <value index="0" field="ADR_POBOX"/>
          <value index="1" field="ADR_ADDTL"/>
          <value index="2" field="ADR_STREET"/>
          <value index="3" field="ADR_CITY"/>
          <value index="4" field="ADR_REG"/>
          <value index="5" field="ADR_ZIP"/>
          <value index="6" field="ADR_COUNTRY"/>
          <position field="ADR_POBOX" repeat="array" increment="1" minshow="1"/>
          <parameter name="TYPE" default="yes" positional="no" show="yes">
            <value field="ADR_STREET_FLAGS" conversion="multimix" combine=",">
              <enum name="HOME"     value="B0"/>
              <enum name="WORK"     value="B1"/>
              <enum mode="ignore"   value="B2"/> <!-- OTHER -->

              <enum mode="prefix" name="X-CustomLabel-" value="1.L"/>
              <enum mode="prefix" name="X-Synthesis-Ref" value="2.L"/>
            </value>
          </parameter>
        </property>

        <property name="BDAY">
          <value field="BDAY"/>
        </property>

        <property name="NOTE" filter="no">
          <value field="NOTE"/>
        </property>

        <property name="PHOTO" filter="no">
          <value field="PHOTO" conversion="BLOB_B64"/>
          <parameter name="TYPE" default="no" show="yes">
            <value field="PHOTO_TYPE">
              <enum name="JPEG" value="0"/>
            </value>
          </parameter>
        </property>

      </profile>
    </mimeprofile>


    <!-- vCard 2.1 datatype, using vCard profile defined above -->
    <datatype name="vCard21" basetype="vcard">
      <version>2.1</version>
      <use mimeprofile="vCard"/>
    </datatype>

    <!-- vCard 3.0 datatype, using vCard profile defined above -->
    <datatype name="vCard30" basetype="vcard">
      <version>3.0</version>
      <use mimeprofile="vCard"/>
    </datatype>
    <!-- common field list for events and todos (both represented by vCalendar/iCalendar) -->
    <fieldlist name="calendar">
      <field name="SYNCLVL" type="integer" compare="never"/>
      <field name="ISEVENT" type="integer" compare="always"/>

      <field name="DMODIFIED" type="timestamp" compare="never" age="yes"/>
      <field name="DCREATED" type="timestamp" compare="never"/>

      <field name="DGENERATED" type="timestamp" compare="never"/>

      <field name="UID" type="string" compare="never"/>

      <field name="CATEGORIES" array="yes" type="string" compare="conflict" merge="fillempty"/>
      <field name="CLASS" type="integer" compare="conflict" merge="fillempty"/>
      <field name="TRANSP" type="integer" compare="conflict" merge="fillempty"/>

      <field name="SUMMARY" type="multiline" compare="always"/>
      <field name="DESCRIPTION" type="multiline" compare="slowsync" merge="lines"/>
      <field name="LOCATION" type="multiline" compare="slowsync" merge="lines"/>

      <!-- recurrence rule block, fields must be in that order, including
           DTSTART as last field !! -->
      <field name="RR_FREQ" type="string" compare="conflict"/>
      <field name="RR_INTERVAL" type="integer" compare="conflict"/>
      <field name="RR_FMASK" type="integer" compare="conflict"/>
      <field name="RR_LMASK" type="integer" compare="conflict"/>
      <field name="RR_END" type="timestamp" compare="conflict"/>

      <!-- Note: DTSTART/DTEND are compared in the <comparescript>,
                 therefore compare is set no "never" here -->
      <field name="DTSTART" type="timestamp" compare="never"/>
      <field name="DTEND" type="timestamp" compare="never"/>
      <field name="DURATION" type="timestamp" compare="never"/>
      <field name="COMPLETED" type="timestamp" compare="never"/>
      <field name="DUE" type="timestamp" compare="never"/>

      <field name="GEO_LAT" type="string" compare="never"/>
      <field name="GEO_LONG" type="string" compare="never"/>

      <field name="PRIORITY" type="integer" compare="conflict"/>
      <field name="STATUS" type="integer" compare="conflict" merge="fillempty"/>

      <field name="ALARM_TIME" type="timestamp" compare="conflict"/>
      <field name="ALARM_SNOOZE" type="string" compare="conflict"/>
      <field name="ALARM_REPEAT" type="string" compare="conflict"/>
      <field name="ALARM_MSG" type="string" compare="conflict"/>
      <field name="ALARM_ACTION" type="string" compare="conflict"/>
      <field name="ALARM_REL" type="integer" compare="never"/>

      <!-- non-standard -->
      <field name="PARENT_UID" type="string" compare="never"/>

      <!-- for events -->
      <field name="EXDATES" array="yes" type="timestamp" compare="never"/>

      <field name="ORIGSTART" array="no" type="timestamp" compare="never"/>
      <field name="SEQNO" array="no" type="integer" compare="never"/>

      <field name="ATTENDEES" array="yes" type="string" compare="never"/>
      <field name="ATTENDEE_CNS" array="yes" type="string" compare="never"/>
      <field name="ATTENDEE_PARTSTATS" array="yes" type="integer" compare="never"/>
      <field name="ORGANIZER" array="no" type="string" compare="never"/>
      <field name="ORGANIZER_CN" array="no" type="string" compare="never"/>

    </fieldlist>
    <!-- vCalendar with VTODO and VEVENT variants -->
    <mimeprofile name="vCalendar" fieldlist="calendar">

      <vtimezonegenmode>current</vtimezonegenmode>
      <tzidgenmode>olson</tzidgenmode>

      <profile name="VCALENDAR" nummandatory="1">

        <property name="VERSION" mandatory="yes">
          <value conversion="version"/>
        </property>

        <property onlyformode="standard" name="PRODID" mandatory="no">
          <value conversion="prodid"/>
        </property>

        <property onlyformode="old" name="TZ" filter="false" suppressempty="yes">
          <value field="DTSTART" conversion="tz"/>
        </property>

        <property onlyformode="old" name="DAYLIGHT" mode="daylight" filter="false" suppressempty="yes">
          <value field="DTSTART" conversion="daylight"/>
        </property>

        <property name="GEO" values="2" suppressempty="yes" onlyformode="old" valueseparator=",">
          <!-- LON,LAT in vCalendar 1.0 -->
          <value index="0" field="GEO_LAT"/>
          <value index="1" field="GEO_LONG"/>
        </property>

        <subprofile onlyformode="standard" name="VTIMEZONE" mode="vtimezones"/>

        <!-- sub-profile for tasks -->
        <subprofile name="VTODO" nummandatory="1" showifselectedonly="yes" field="ISEVENT" value="0">

          <property name="LAST-MODIFIED">
            <value field="DMODIFIED"/>
          </property>

          <property name="DTSTAMP" suppressempty="yes" onlyformode="standard">
            <value field="DGENERATED"/>
          </property>

          <property name="DCREATED" suppressempty="yes" onlyformode="old">
            <value field="DCREATED"/>
          </property>
          <property name="CREATED" suppressempty="yes" onlyformode="standard">
            <value field="DCREATED"/>
          </property>

          <property name="UID" suppressempty="yes">
            <value field="UID"/>
          </property>

          <property name="SEQUENCE" suppressempty="yes">
            <value field="SEQNO"/>
          </property>

          <property name="GEO" values="2" suppressempty="yes" onlyformode="standard" valueseparator=";">
            <!-- LAT;LON in iCalendar 2.0 -->
            <value index="0" field="GEO_LONG"/>
            <value index="1" field="GEO_LAT"/>
          </property>

          <property onlyformode="standard" name="CATEGORIES" values="list" valueseparator="," suppressempty="yes">
            <value field="CATEGORIES" />
            <position field="CATEGORIES" repeat="array" minshow="0"/>
          </property>

          <property onlyformode="old" name="CATEGORIES" values="list" valueseparator=";" altvalueseparator="," suppressempty="yes">
            <value field="CATEGORIES" />
            <position field="CATEGORIES" repeat="array" minshow="0"/>
          </property>

          <property name="CLASS" suppressempty="yes">
            <value field="CLASS">
              <enum name="PUBLIC"       value="0"/>
              <enum name="PRIVATE"      value="1"/>
              <enum name="CONFIDENTIAL" value="2"/>
            </value>
          </property>

          <property name="SUMMARY" mandatory="yes">
            <value field="SUMMARY"/>
          </property>

          <property name="DESCRIPTION" mandatory="yes">
            <value field="DESCRIPTION"/>
          </property>

          <property name="LOCATION" mandatory="no">
            <value field="LOCATION"/>
          </property>

          <property name="DTSTART" suppressempty="yes" delayedparsing="1">
            <value field="DTSTART" conversion="autodate"/>
            <parameter onlyformode="standard" name="TZID" default="no" show="yes">
              <value field="DTSTART" conversion="TZID"/>
            </parameter>
            <parameter onlyformode="standard" name="VALUE" default="no" show="yes">
              <value field="DTSTART" conversion="VALUETYPE"/>
            </parameter>
          </property>

          <property name="COMPLETED" suppressempty="yes" delayedparsing="1">
            <value field="COMPLETED" conversion="autoenddate"/>
            <parameter onlyformode="standard" name="TZID" default="no" show="yes">
              <value field="COMPLETED" conversion="TZID"/>
            </parameter>
            <parameter onlyformode="standard" name="VALUE" default="no" show="yes">
              <value field="COMPLETED" conversion="VALUETYPE"/>
            </parameter>
          </property>

          <property name="DUE" suppressempty="yes" delayedparsing="1">
            <value field="DUE" conversion="autodate"/>
            <parameter onlyformode="standard" name="TZID" default="no" show="yes">
              <value field="DUE" conversion="TZID"/>
            </parameter>
            <parameter onlyformode="standard" name="VALUE" default="no" show="yes">
              <value field="DUE" conversion="VALUETYPE"/>
            </parameter>
          </property>

          <property name="PRIORITY" suppressempty="yes">
            <value field="PRIORITY"/>
          </property>

          <property name="STATUS" onlyformode="standard" suppressempty="yes">
            <value field="STATUS" conversion="emptyonly">
              <enum name="COMPLETED"      value="0"/>
              <enum name="NEEDS-ACTION"   value="1"/>
              <enum name="IN-PROCESS"     value="2"/>
              <enum name="CANCELLED"      value="3"/>
              <enum name="ACCEPTED"       value="4"/>
              <enum name="TENTATIVE"      value="5"/>
              <enum name="DELEGATED"      value="6"/>
              <enum name="DECLINED"       value="7"/>
              <enum name="SENT"           value="8"/>
              <enum name="CONFIRMED"      value="9"/>
              <enum name="DRAFT"          value="10"/>
              <enum name="FINAL"          value="11"/>
            </value>
          </property>

          <property name="STATUS" onlyformode="old" suppressempty="yes">
            <value field="STATUS" conversion="emptyonly">
              <enum name="COMPLETED"      value="0"/>
              <enum name="NEEDS ACTION"   value="1"/>
              <enum mode="defaultvalue"   value="1"/> <!-- catch unknown, but also non-conformant NEEDS_ACTION -->
              <enum name="IN PROCESS"     value="2"/>
              <enum name="CANCELLED"      value="3"/>
              <enum name="ACCEPTED"       value="4"/>
              <enum name="TENTATIVE"      value="5"/>
              <enum name="DELEGATED"      value="6"/>
              <enum name="DECLINED"       value="7"/>
              <enum name="SENT"           value="8"/>
              <enum name="CONFIRMED"      value="9"/>
              <enum name="DRAFT"          value="10"/>
              <enum name="FINAL"          value="11"/>
            </value>
          </property>


          <!-- AALARM and DALARM both use the same fields -->
          <property name="AALARM" onlyformode="old" values="4" suppressempty="yes">
            <value index="0" field="ALARM_TIME" conversion="emptyonly"/>
            <value index="1" field="ALARM_SNOOZE" conversion="emptyonly"/>
            <value index="2" field="ALARM_REPEAT" conversion="emptyonly"/>
            <value index="3" field="ALARM_MSG" conversion="emptyonly"/>
          </property>
          <property name="DALARM" onlyformode="old" values="4" suppressempty="yes">
            <value index="0" field="ALARM_TIME" conversion="emptyonly"/>
            <value index="1" field="ALARM_SNOOZE" conversion="emptyonly"/>
            <value index="2" field="ALARM_REPEAT" conversion="emptyonly"/>
            <value index="3" field="ALARM_MSG" conversion="emptyonly"/>
          </property>

          <subprofile onlyformode="standard" name="VALARM" nummandatory="1" field="ALARM_TIME">
            <property name="TRIGGER" suppressempty="no" mandatory="yes">
              <value field="ALARM_TIME"/>
              <parameter name="VALUE" default="no" show="yes">
                <value field="ALARM_TIME" conversion="FULLVALUETYPE"/>
              </parameter>
              <parameter name="RELATED" default="no" show="yes">
                <value field="ALARM_REL">
                  <enum mode="ignore" value="0"/>
                  <enum name="START" value="1"/>
                  <enum name="END"   value="2"/>
                </value>
              </parameter>
            </property>
            <property name="ACTION" suppressempty="yes" mandatory="yes">
              <value field="ALARM_ACTION"/>
            </property>
            <property name="DESCRIPTION" suppressempty="yes">
              <value field="ALARM_MSG"/>
            </property>
            <property name="REPEAT" suppressempty="yes">
              <value field="ALARM_REPEAT"/>
            </property>
          </subprofile>

          <property onlyformode="old" name="RELATED-TO" suppressempty="yes">
            <value field="PARENT_UID"/>
          </property>

          <property onlyformode="standard" name="RELATED-TO" suppressempty="yes">
            <value field="PARENT_UID"/>
            <parameter onlyformode="standard" name="RELTYPE" default="no" positional="yes" show="yes">
              <value>
                <enum name="PARENT"/>
                <enum mode="defaultvalue" name="other"/>
              </value>
              <position hasnot="other" shows="PARENT" field="PARENT_UID"/>
            </parameter>
          </property>

        </subprofile>

        <!-- sub-profile for event -->
        <subprofile name="VEVENT" nummandatory="1" showifselectedonly="yes" field="ISEVENT" value="1">

          <property name="LAST-MODIFIED">
            <value field="DMODIFIED"/>
          </property>

          <property name="DTSTAMP" suppressempty="yes" onlyformode="standard">
            <value field="DGENERATED"/>
          </property>

          <property name="DCREATED" suppressempty="yes" onlyformode="old">
            <value field="DCREATED"/>
          </property>
          <property name="CREATED" suppressempty="yes" onlyformode="standard">
            <value field="DCREATED"/>
          </property>


          <property name="UID" suppressempty="yes">
            <value field="UID"/>
          </property>

          <property name="SEQUENCE" suppressempty="yes">
            <value field="SEQNO"/>
          </property>

          <property name="GEO" values="2" suppressempty="yes" onlyformode="standard" valueseparator=";">
            <!-- LAT;LON in iCalendar 2.0 -->
            <value index="0" field="GEO_LONG"/>
            <value index="1" field="GEO_LAT"/>
          </property>

          <property onlyformode="standard" name="CATEGORIES" values="list" valueseparator="," suppressempty="yes">
            <value field="CATEGORIES" />
            <position field="CATEGORIES" repeat="array" minshow="0"/>
          </property>

          <property onlyformode="old" name="CATEGORIES" values="list" valueseparator=";" altvalueseparator="," suppressempty="yes">
            <value field="CATEGORIES" />
            <position field="CATEGORIES" repeat="array" minshow="0"/>
          </property>

          <property name="CLASS" suppressempty="yes">
            <value field="CLASS">
              <enum name="PUBLIC"       value="0"/>
              <enum name="PRIVATE"      value="1"/>
              <enum name="CONFIDENTIAL" value="2"/>
            </value>
          </property>


          <property name="TRANSP" suppressempty="yes" onlyformode="standard">
            <value field="TRANSP">
              <enum name="OPAQUE"       value="0"/>
              <enum name="TRANSPARENT"  value="1"/>
              <enum name="TENTATIVE"     value="2"/> <!-- according to Oracle de facto usage in vCalendar 1.0 -->
              <enum name="OUT_OF_OFFICE" value="3"/> <!-- according to Oracle de facto usage in vCalendar 1.0 -->
              <enum mode="defaultvalue" value="0"/>
            </value>
          </property>
          <property name="TRANSP" suppressempty="yes" onlyformode="old">
            <value field="TRANSP"/> <!-- directly numeric in vCalendar 1.0 -->
          </property>


          <property name="PRIORITY" suppressempty="yes">
            <value field="PRIORITY"/>
          </property>

          <property name="SUMMARY" mandatory="yes">
            <value field="SUMMARY"/>
          </property>

          <property name="DESCRIPTION" mandatory="yes">
            <value field="DESCRIPTION"/>
          </property>

          <property name="LOCATION" mandatory="no">
            <value field="LOCATION"/>
          </property>

          <property name="DTSTART" suppressempty="yes" delayedparsing="1">
            <value field="DTSTART" conversion="autodate"/>
            <parameter onlyformode="standard" name="TZID" default="no" show="yes">
              <value field="DTSTART" conversion="TZID"/>
            </parameter>
            <parameter onlyformode="standard" name="VALUE" default="no" show="yes">
              <value field="DTSTART" conversion="VALUETYPE"/>
            </parameter>
          </property>

          <!-- recurrence rule (with delayed parsing, as it is dependent on DTSTART) -->
          <property name="RRULE" suppressempty="yes" delayedparsing="2">
            <!-- Note: RR_FREQ is the beginning of a block of fields
                 suitable for the "rrule" conversion mode -->
            <value field="RR_FREQ" conversion="rrule"/>
          </property>

          <!-- Symbian uses this, so it might make the client work with symbian-prepared servers better -->
          <property name="X-RECURRENCE-ID" suppressempty="yes" onlyformode="old">
            <value field="ORIGSTART" conversion="autodate"/>
          </property>

          <property name="RECURRENCE-ID" suppressempty="yes" onlyformode="standard" delayedparsing="1">
            <value field="ORIGSTART" conversion="autodate"/>
            <parameter name="TZID" default="no" show="yes">
              <value field="ORIGSTART" conversion="TZID"/>
            </parameter>
            <parameter name="VALUE" default="no" show="yes">
              <value field="ORIGSTART" conversion="VALUETYPE"/>
            </parameter>
          </property>

          <property name="EXDATE" values="list" suppressempty="yes" onlyformode="standard" delayedparsing="1" valueseparator="," altvalueseparator=";">
            <value field="EXDATES"/>
            <position field="EXDATES" repeat="array" increment="1" minshow="0"/>
            <parameter name="TZID" default="no" show="yes">
              <value field="EXDATES" conversion="TZID"/>
            </parameter>
          </property>

          <property name="EXDATE" values="list" suppressempty="yes" onlyformode="old" delayedparsing="1" valueseparator=";" altvalueseparator=",">
            <value field="EXDATES"/>
            <position field="EXDATES" repeat="array" increment="1" minshow="0"/>
          </property>


          <property name="DTEND" suppressempty="yes" delayedparsing="1">
            <value field="DTEND" conversion="autoenddate"/>
            <parameter onlyformode="standard" name="TZID" default="no" show="yes">
              <value field="DTEND" conversion="TZID"/>
            </parameter>
            <parameter onlyformode="standard" name="VALUE" default="no" show="yes">
              <value field="DTEND" conversion="VALUETYPE"/>
            </parameter>
          </property>

          <property name="DURATION" suppressempty="yes" delayedparsing="1" onlyformode="standard">
            <value field="DURATION"/>
            <parameter onlyformode="standard" name="VALUE" default="no" show="no">
              <value field="DURATION" conversion="VALUETYPE"/>
            </parameter>
          </property>

          <property name="ATTENDEE" suppressempty="yes" onlyformode="old">
            <value field="ATTENDEES"/>
            <parameter name="ROLE" default="no" positional="yes" show="yes">
              <value>
                <enum name="ORGANIZER"/>
              </value>
              <position has="ORGANIZER" field="ORGANIZER" overwriteempty="yes"/>
              <position hasnot="ORGANIZER" field="ATTENDEES" repeat="array" increment="1" overwriteempty="yes"/>
            </parameter>
            <parameter name="STATUS" default="no" show="yes">
              <value field="ATTENDEE_PARTSTATS">
                <enum name="NEEDS ACTION"   value="1"/>
                <enum mode="defaultvalue"   value="1"/> <!-- catch unknown, but also non-conformant NEEDS_ACTION -->
                <enum name="ACCEPTED"       value="4"/>
                <enum name="DECLINED"       value="7"/>
                <enum name="TENTATIVE"      value="5"/>
                <enum name="DELEGATED"      value="6"/>
              </value>
            </parameter>
          </property>

          <property name="ATTENDEE" suppressempty="yes" onlyformode="standard">
            <value field="ATTENDEES" conversion="mailto"/>
            <position field="ATTENDEES" repeat="array" increment="1" minshow="0"/>
            <parameter name="CN" default="no" show="yes" shownonempty="yes">
              <value field="ATTENDEE_CNS"/>
            </parameter>
            <parameter name="PARTSTAT" default="no" show="yes">
              <value field="ATTENDEE_PARTSTATS">
                <enum name="NEEDS-ACTION"   value="1"/>
                <enum mode="defaultvalue"   value="1"/> <!-- catch unknown, but also non-conformant NEEDS_ACTION -->
                <enum name="ACCEPTED"       value="4"/>
                <enum name="DECLINED"       value="7"/>
                <enum name="TENTATIVE"      value="5"/>
                <enum name="DELEGATED"      value="6"/>
              </value>
            </parameter>
          </property>

          <property name="ORGANIZER" suppressempty="yes" onlyformode="standard">
            <value field="ORGANIZER" conversion="mailto"/>
            <parameter name="CN" default="no" show="yes">
              <value field="ORGANIZER_CN"/>
            </parameter>
          </property>


          <!-- AALARM and DALARM both use the same fields -->
          <property name="AALARM" onlyformode="old" values="4" suppressempty="yes">
            <value index="0" field="ALARM_TIME" conversion="emptyonly"/>
            <value index="1" field="ALARM_SNOOZE" conversion="emptyonly"/>
            <value index="2" field="ALARM_REPEAT" conversion="emptyonly"/>
            <value index="3" field="ALARM_MSG" conversion="emptyonly"/>
          </property>
          <property name="DALARM" onlyformode="old" values="4" suppressempty="yes">
            <value index="0" field="ALARM_TIME" conversion="emptyonly"/>
            <value index="1" field="ALARM_SNOOZE" conversion="emptyonly"/>
            <value index="2" field="ALARM_REPEAT" conversion="emptyonly"/>
            <value index="3" field="ALARM_MSG" conversion="emptyonly"/>
          </property>

          <subprofile onlyformode="standard" name="VALARM" nummandatory="1" field="ALARM_TIME">
            <property name="TRIGGER" suppressempty="no" mandatory="yes">
              <value field="ALARM_TIME"/>
              <parameter name="VALUE" default="no" show="yes">
                <value field="ALARM_TIME" conversion="FULLVALUETYPE"/>
              </parameter>
              <parameter name="RELATED" default="no" show="yes">
                <value field="ALARM_REL">
                  <enum mode="ignore" value="0"/>
                  <enum name="START" value="1"/>
                  <enum name="END"   value="2"/>
                </value>
              </parameter>
            </property>
            <property name="ACTION" suppressempty="yes" mandatory="yes">
              <value field="ALARM_ACTION"/>
            </property>
            <property name="DESCRIPTION" suppressempty="yes">
              <value field="ALARM_MSG"/>
            </property>
            <property name="REPEAT" suppressempty="yes">
              <value field="ALARM_REPEAT"/>
            </property>
          </subprofile>

        </subprofile>

      </profile>
    </mimeprofile>

    <!-- vCalendar 1.0 datatype, using vCalendar profile defined above -->
    <datatype name="vCalendar10" basetype="vcalendar">
      <version>1.0</version>
      <use mimeprofile="vCalendar"/>

      <incomingscript><![CDATA[
        $VCALENDAR_INCOMING_SCRIPT
      ]]></incomingscript>

      <outgoingscript><![CDATA[
        $VCALENDAR_OUTGOING_SCRIPT
      ]]></outgoingscript>

    </datatype>


    <!-- iCalendar 2.0 datatype, using vCalendar profile defined above -->
    <datatype name="iCalendar20" basetype="vcalendar">
      <version>2.0</version>
      <use mimeprofile="vCalendar"/>

      <incomingscript><![CDATA[
        $VCALENDAR_INCOMING_SCRIPT
      ]]></incomingscript>

      <outgoingscript><![CDATA[
        $VCALENDAR_OUTGOING_SCRIPT
      ]]></outgoingscript>

    </datatype>

    <!-- list of internal fields representing plain text note data -->
    <fieldlist name="Note">
      <field name="SYNCLVL" type="integer" compare="never"/>
      <field name="SUBJECT" type="multiline" compare="always"/>
      <field name="TEXT" type="multiline" compare="conflict" merge="lines"/>
    </fieldlist>

    <textprofile name="Note" fieldlist="Note">
      <linemap field="SUBJECT">
        <numlines>1</numlines>
        <inheader>false</inheader>
        <allowempty>true</allowempty>
        <filterkeyword>SUBJECT</filterkeyword>
      </linemap>
      <linemap field="TEXT">
        <numlines>0</numlines>
        <inheader>false</inheader>
        <allowempty>true</allowempty>
      </linemap>
    </textprofile>

    <datatype name="note10" basetype="text">
      <use profile="Note"/>
      <typestring>text/plain</typestring>
      <versionstring>1.0</versionstring>
    </datatype>

    <datatype name="note11" basetype="text">
      <use profile="Note"/>
      <typestring>text/plain</typestring>
      <versionstring>1.1</versionstring>
    </datatype>

    <!-- list of internal fields representing vBookmark data -->
    <fieldlist name="bookmarks">
      <field name="REV" type="timestamp" compare="never" age="yes"/>
      <field name="SYNCLVL" type="integer" compare="never"/>

      <!-- Name -->
      <field name="TITLE" type="string" compare="always"/>

      <!-- categories and classification -->
      <field name="CATEGORIES" type="string" compare="conflict" merge="fillempty"/>
      <field name="CLASS" type="string" compare="conflict" merge="fillempty"/>

      <!-- web addresses -->
      <field name="URL" type="url" compare="slowsync" merge="fillempty"/>

      <!-- Note -->
      <field name="NOTE" type="multiline" compare="conflict" merge="lines"/>

    </fieldlist>

    <!-- vBookmark profile -->
    <mimeprofile name="vBookmark" fieldlist="bookmarks">

      <profile name="VBKM" nummandatory="0">
        <property name="VERSION">
          <value conversion="version"/>
        </property>

        <property name="X-LAST-MODIFIED">
          <value field="REV"/>
        </property>

        <property name="TITLE">
          <value field="TITLE"/>
        </property>

        <property name="URL">
          <value field="URL"/>
        </property>

        <!-- non-standard properties -->

        <!-- inherit CATEGORIES from vCard 3.0, i.e. comma separated -->
        <property name="CATEGORIES" values="list" valueseparator="," altvalueseparator=";">
          <value field="CATEGORIES" combine=","/>
        </property>

        <property name="CLASS" suppressempty="yes">
          <value field="CLASS"/>
        </property>

        <property name="NOTE" filter="no">
          <value field="NOTE"/>
        </property>

      </profile>
    </mimeprofile>

    <!-- vBookmark datatype, using vBookmark profile defined above -->
    <datatype name="vBookmark10" basetype="mimedir">
      <typestring>text/x-vbookmark</typestring>
      <versionstring>1.0</versionstring>
      <use profile="vBookmark"/>
    </datatype>

    <!-- list of internal fields representing email data -->
    <fieldlist name="email">
      <field name="SYNCLVL" type="integer" compare="never"/>
      <field name="MODIFIED" type="timestamp" compare="never" age="yes"/>
      <field name="SENDER" type="multiline" compare="always"/>
      <field name="RECEIVER" type="multiline" compare="always"/>
      <field name="CARBONCOPY" type="multiline" compare="always"/>
      <field name="BLINDCARBONCOPY" type="multiline" compare="always"/>
      <field name="REPLY_TO" type="multiline" compare="never"/>
      <field name="SUBJECT" type="multiline" compare="always"/>
      <field name="PRIORITY" type="integer" compare="never"/>
      <field name="MAILDATE" type="timestamp" compare="never"/>
      <field name="STATUS" type="string" compare="never"/>
      <field name="FOLDER" type="string" compare="conflict"/>
      <field name="ISREAD" type="string" compare="never"/>
      <field name="LIMIT" type="integer" compare="never"/>
      <field name="BODY" type="multiline" compare="never"/>
      <field name="ATT_COUNT" type="integer" compare="never"/>
      <field name="ATT_NAMES" array="yes" type="string" compare="never"/>
      <field name="ATT_MIMETYPES" array="yes" type="string" compare="never"/>
      <field name="ATT_SIZES" array="yes" type="integer" compare="never"/>
      <field name="ATT_CONTENTS" array="yes" type="blob" compare="never"/>
    </fieldlist>

    <!-- this is the text profile used to generate and decode RFC2822/MIME-Multipart
         email messages. -->
    <textprofile name="rfc2822_email" fieldlist="email">

      <mimemail>true</mimemail>
      <!-- attachment configuration -->
      <maxattachments>100</maxattachments>
      <attachmentcountfield>ATT_COUNT</attachmentcountfield>
      <attachmentmimetypesfield>ATT_MIMETYPES</attachmentmimetypesfield>
      <attachmentsfield>ATT_CONTENTS</attachmentsfield>
      <attachmentsizesfield>ATT_SIZES</attachmentsizesfield>
      <attachmentnamesfield>ATT_NAMES</attachmentnamesfield>
      <sizelimitfield>LIMIT</sizelimitfield>


      <linemap field="SENDER">
        <headertag>From:</headertag>
        <valuetype>rfc2047</valuetype>
        <inheader>true</inheader>
        <filterkeyword>FROM</filterkeyword>
      </linemap>

      <linemap field="RECEIVER">
        <headertag>To:</headertag>
        <valuetype>rfc2047</valuetype>
        <inheader>true</inheader>
        <filterkeyword>TO</filterkeyword>
      </linemap>

      <linemap field="CARBONCOPY">
        <headertag>Cc:</headertag>
        <valuetype>rfc2047</valuetype>
        <inheader>true</inheader>
        <filterkeyword>CC</filterkeyword>
      </linemap>

      <linemap field="BLINDCARBONCOPY">
        <headertag>Bcc:</headertag>
        <valuetype>rfc2047</valuetype>
        <inheader>true</inheader>
        <filterkeyword>BCC</filterkeyword>
      </linemap>

      <linemap field="REPLY_TO">
        <headertag>Reply-To:</headertag>
        <valuetype>rfc2047</valuetype>
        <inheader>true</inheader>
      </linemap>

      <linemap field="SUBJECT">
        <headertag>Subject:</headertag>
        <valuetype>rfc2047</valuetype>
        <inheader>true</inheader>
        <filterkeyword>SUBJECT</filterkeyword>
      </linemap>

      <linemap field="PRIORITY">
        <headertag>X-Priority:</headertag>
        <inheader>true</inheader>
      </linemap>

      <linemap field="MAILDATE">
        <valuetype>date</valuetype>
        <headertag>Date:</headertag>
        <inheader>true</inheader>
      </linemap>

      <linemap field="STATUS">
        <headertag>Status:</headertag>
        <inheader>true</inheader>
      </linemap>

      <linemap field="FOLDER">
        <headertag>X-Sync-Parent-Folder:</headertag>
        <inheader>true</inheader>
      </linemap>

      <linemap field="ISREAD">
        <headertag>X-Sync-Message-Read:</headertag>
        <inheader>true</inheader>
      </linemap>

      <linemap field="MODIFIED">
        <!-- note that this is a ISO8601 date -->
        <headertag>X-Sync-Lastmodified:</headertag>
        <inheader>true</inheader>
      </linemap>

      <linemap field="BODY">
        <valuetype>body</valuetype>
        <numlines>0</numlines>
        <inheader>false</inheader>
        <allowempty>true</allowempty>
      </linemap>
    </textprofile>

    <datatype name="email" basetype="text">
      <use profile="rfc2822_email"/>
      <typestring>text/message</typestring> <!-- this is P800-like -->
      <versionstring>1.0</versionstring>

      <initscript><![CDATA[
        $EMAIL_INIT_SCRIPT
      ]]></initscript>

      <processitemscript><![CDATA[
        $EMAIL_PROCESSITEM_SCRIPT
      ]]></processitemscript>


      <mergescript><![CDATA[
        $EMAIL_MERGE_SCRIPT
      ]]></mergescript>


      <outgoingscript><![CDATA[
        $EMAIL_OUTGOING_SCRIPT
      ]]></outgoingscript>

      <filterinitscript><![CDATA[
        $EMAIL_FILTERINIT_SCRIPT
      ]]></filterinitscript>


      <filterscript><![CDATA[
        $EMAIL_FILTER_SCRIPT
      ]]></filterscript>

    </datatype>

    <!-- Note: This is a proprietary extension datatype for Synthesis AG Windows Mobile SyncML clients.
         This format is a compressed form of the standard RFC2822 format. For one, the entire data
         is compressed using the zip algorithm (<zippedbindata>), and secondly attachments are included
         in binary form in the RFC2822 data stream rather than bandwidth wasting B64, adding a
         "Content-Length:" header for each MIME part (<binaryparts>). -->

    <datatype name="email_zipbin" basetype="text">
      <use profile="rfc2822_email"/>
      <typestring>application/x-zip-message</typestring> <!-- our own private zipped binary optimized format -->
      <versionstring>1.1</versionstring>
      <binaryparts>yes</binaryparts>
      <zippedbindata>yes</zippedbindata>
      <zipcompressionlevel>9</zipcompressionlevel> <!-- -1=default, 0=no compression, 1=fast & least effective ... 9=slow and most effective -->

      <initscript><![CDATA[
        $EMAIL_INIT_SCRIPT
      ]]></initscript>

      <processitemscript><![CDATA[
        $EMAIL_PROCESSITEM_SCRIPT
      ]]></processitemscript>


      <mergescript><![CDATA[
        $EMAIL_MERGE_SCRIPT
      ]]></mergescript>


      <outgoingscript><![CDATA[
        $EMAIL_OUTGOING_SCRIPT
      ]]></outgoingscript>

      <filterinitscript><![CDATA[
        $EMAIL_FILTERINIT_SCRIPT
      ]]></filterinitscript>


      <filterscript><![CDATA[
        $EMAIL_FILTER_SCRIPT
      ]]></filterscript>

    </datatype>

    <datatype name="email_sonyericsson" basetype="text">
      <use profile="rfc2822_email"/>
      <typestring>message/rfc822</typestring> <!-- this is M600i/P990-like -->
      <versionstring>1.0</versionstring>

      <initscript><![CDATA[
        $EMAIL_INIT_SCRIPT
      ]]></initscript>

      <processitemscript><![CDATA[
        $EMAIL_PROCESSITEM_SCRIPT
      ]]></processitemscript>


      <mergescript><![CDATA[
        $EMAIL_MERGE_SCRIPT
      ]]></mergescript>


      <outgoingscript><![CDATA[
        $EMAIL_OUTGOING_SCRIPT
      ]]></outgoingscript>

      <filterinitscript><![CDATA[
        $EMAIL_FILTERINIT_SCRIPT
      ]]></filterinitscript>


      <filterscript><![CDATA[
        $EMAIL_FILTER_SCRIPT
      ]]></filterscript>

    </datatype>

    <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>

  </datatypes>


  <server type="plugin">

    <!-- Uncomment the following for Linux if you are sure properly working pthread implementation is available
         For Windows and Mac OS X, multithreading is enabled by default -->
    <!--<multithread>yes</multithread>-->


    <!-- plugin module which handles the session level, i.e. login and device tracking -->
    <plugin_module>[SDK_textdb]</plugin_module>
    <plugin_sessionauth>yes</plugin_sessionauth>
    <plugin_deviceadmin>yes</plugin_deviceadmin>

    <plugin_params>
      <!-- plugin params can contain any number of plugin-specific parameters
           that will be passed to the plugin implementation for processing -->

      <!-- For TextDB: text file locations: -->
      <!-- Uncomment the following tags if you want
           to specifiy locations for the text files generated by the
           server. If you leave it commented, all text files will be in the
           application directory -->
      <!--
      <mapfilepath>C:\sync\auxfiles</mapfilepath>
      <datafilepath>C:\sync\datafiles</datafilepath>
      -->

      <ultimate_answer>42</ultimate_answer> <!-- just as an example -->
    </plugin_params>

    <!-- un-comment or change the following directive if you want the server only accept
         SyncML 1.1 or 1.0 connections - not recommended normally, but
         eventually useful for testing. By default, the server accepts
         all 1.2, 1.1 and 1.0 connections -->
    <!-- <maxsyncmlversion>1.1</maxsyncmlversion> -->

    <!-- IMPORTANT: Note that the following charset, lineend and quoting settings are relevant for session-level data access only.
         Most data access takes place in individual <datastores>, which each has the same three settings
         again locally (see below in the <datastore> sections). -->

    <!-- text db plugin is designed for UTF-8, make sure data is passed as UTF-8 (and not the ISO-8859-1 default) -->
    <datacharset>UTF-8</datacharset>
    <!-- use C-language (unix style) linefeeds (\n, 0x0A) -->
    <datalineends>unix</datalineends>


    <!-- If you want a text logfile, specify its full path here: -->
    <!-- <logfile platform="win32">D:\your\log\directory\yourlogfile.txt</logfile> -->
    <!-- <logfile platform="linux">/your/log/directory/yourlogfile.txt</logfile> -->
    <!-- <logfile platform="macosx">/your/log/directory/yourlogfile.txt</logfile> -->

    <logenabled>yes</logenabled> <!-- log enabled by default (session login scripts might disable it for special users/devices) -->

    <!-- the logfile format can be customized with <loglabels> and <logformat>
         but if these are not specified, a default format will be used
    -->
    <!-- This sample produces a simplified logfile:
    <loglabels>SyncEndTime\tUser\tStatus\tSynctype\tRemoteName\tDatabase\tLocAdded\tLocUpdated\tLocDeleted\n\n</loglabels>
    <logformat>%seT\t%U\t%sS\t%tS\t%nR\t%lD\t%laI\t%luI\t%ldI\n</logformat>
    -->


    <sessioninitscript><![CDATA[
      // these variables are possibly modified by rule scripts
      TIMESTAMP mindate; // earliest date remote party can handle
      INTEGER retransfer_body; // if set to true, body is re-sent to client when message is moved from outbox to sent
      mindate=EMPTY; // no limit by default
      retransfer_body=FALSE; // normally, do not retransfer email body (and attachments) when moving items to sent box
    ]]></sessioninitscript>

    <!-- timeout for unfinished sessions in seconds -->
    <sessiontimeout>300</sessiontimeout>

    <!-- defines how clients must authenticate with the server
         To allow simple authentication (unencrypted passwords will
         be transferred over the net, so be careful)
         set <requiredauth> to "basic" instead of "md5"
    -->
    <requestedauth>md5</requestedauth>
    <requiredauth>md5</requiredauth>
    <autononce>yes</autononce>

    <!-- you can comment out <simpleauthuser> and <simpleauthpw>
         to have the plugin check user authentification.
         Note that the built-in textdb plugin has a hard-wired test/test
         user only -->
    <simpleauthuser>test</simpleauthuser>
    <simpleauthpw>test</simpleauthpw>



    <datastore name="contacts" type="plugin">

      <plugin_module>[SDK_textdb]</plugin_module>
      <plugin_datastoreadmin>yes</plugin_datastoreadmin>
      <plugin_params>
        <!-- specify plugin-specific parameters here, they will be
             passed to the plugin implementation for processing -->
        <ultimate_answer>42</ultimate_answer> <!-- just as an example -->
      </plugin_params>


      <!-- General datastore settings for all DB types -->

      <!-- if this is set to "yes", SyncML clients can only read
           from the server database, but make no modifications -->
      <readonly>no</readonly>

      <!-- conflict strategy: Newer item wins
           You can set "server-wins" or "client-wins" as well
           if you want to give one side precedence
      -->
      <conflictstrategy>newer-wins</conflictstrategy>

      <!-- on slowsync: duplicate items that are not fully equal
           You can set this to "newer-wins" as well to avoid
           duplicates as much as possible
      -->
      <slowsyncstrategy>duplicate</slowsyncstrategy>

      <!-- Visibility control: Server items that have the SYNCLVL
           field set to 0 will be invisible to SyncML clients.
           Using CGI-filtering in database names (such as
           ./contacts?SYNCLVL:>=5) smaller clients can
           sync a reduced set of server items -->
      <makepassfilter>F.SYNCLVL:=10</makepassfilter>
      <invisiblefilter>F.SYNCLVL:=0|F.SYNCLVL*=E</invisiblefilter>
      <makevisiblefilter>F.SYNCLVL:=10</makevisiblefilter>


      <!-- text db plugin is designed for UTF-8, make sure data is passed as UTF-8 (and not the ISO-8859-1 default) -->
      <datacharset>UTF-8</datacharset>
      <!-- use C-language (unix style) linefeeds (\n, 0x0A) -->
      <datalineends>unix</datalineends>

      <!-- set this to "UTC" if time values should be stored in UTC into the database
           rather than local time. "SYSTEM" denotes local server time zone. -->
      <datatimezone>SYSTEM</datatimezone>

      <!-- plugin DB may have its own identifiers to determine the point in time of changes, so
           we must make sure this identifier is stored (and not only the sync time) -->
      <storesyncidentifiers>yes</storesyncidentifiers>

      <!-- TextDB plugin supports resume and resuming partial items, so enable these here -->
      <resumesupport>yes</resumesupport>
      <resumeitemsupport>yes</resumeitemsupport>



      <!-- Mapping of the fields to the fieldlist "contacts" -->
      <fieldmap fieldlist="contacts">
        <automap indexasname="true"/>
      </fieldmap>

      <!-- datatypes supported by this datastore -->
      <typesupport>
        <use datatype="vCard30" mode="rw" preferred="yes"/>
        <use datatype="vCard21" mode="rw" preferred="legacy"/>
      </typesupport>

    </datastore>



    <datastore name="events" type="plugin">

      <plugin_module>[SDK_textdb]</plugin_module>
      <plugin_datastoreadmin>yes</plugin_datastoreadmin>
      <plugin_params>
        <!-- specify plugin-specific parameters here, they will be
             passed to the plugin implementation for processing -->
        <ultimate_answer>42</ultimate_answer> <!-- just as an example -->
      </plugin_params>


      <!-- General datastore settings for all DB types -->

      <!-- if this is set to "yes", SyncML clients can only read
           from the server database, but make no modifications -->
      <readonly>no</readonly>

      <!-- conflict strategy: Newer item wins
           You can set "server-wins" or "client-wins" as well
           if you want to give one side precedence
      -->
      <conflictstrategy>newer-wins</conflictstrategy>

      <!-- on slowsync: duplicate items that are not fully equal
           You can set this to "newer-wins" as well to avoid
           duplicates as much as possible
      -->
      <slowsyncstrategy>duplicate</slowsyncstrategy>

      <!-- Visibility control: Server items that have the SYNCLVL
           field set to 0 will be invisible to SyncML clients.
           Using CGI-filtering in database names (such as
           ./contacts?SYNCLVL:>=5) smaller clients can
           sync a reduced set of server items -->
      <makepassfilter>F.SYNCLVL:=10</makepassfilter>
      <invisiblefilter>F.SYNCLVL:=0|F.SYNCLVL*=E</invisiblefilter>
      <makevisiblefilter>F.SYNCLVL:=10</makevisiblefilter>


      <!-- text db plugin is designed for UTF-8, make sure data is passed as UTF-8 (and not the ISO-8859-1 default) -->
      <datacharset>UTF-8</datacharset>
      <!-- use C-language (unix style) linefeeds (\n, 0x0A) -->
      <datalineends>unix</datalineends>

      <!-- set this to "UTC" if time values should be stored in UTC into the database
           rather than local time. "SYSTEM" denotes local server time zone. -->
      <datatimezone>SYSTEM</datatimezone>

      <!-- plugin DB may have its own identifiers to determine the point in time of changes, so
           we must make sure this identifier is stored (and not only the sync time) -->
      <storesyncidentifiers>yes</storesyncidentifiers>

      <!-- TextDB plugin supports resume and resuming partial items, so enable these here -->
      <resumesupport>yes</resumesupport>
      <resumeitemsupport>yes</resumeitemsupport>



      <!-- Mapping of the fields to the fieldlist "calendar" -->
      <fieldmap fieldlist="calendar">
        <automap indexasname="true"/>
      </fieldmap>

      <!-- datatypes supported by this datastore -->
      <typesupport>
        <use datatype="iCalendar20" mode="rw" variant="VEVENT" preferred="yes"/>
        <use datatype="vCalendar10" mode="rw" variant="VEVENT" preferred="legacy"/>
      </typesupport>

    </datastore>


    <datastore name="tasks" type="plugin">

      <plugin_module>[SDK_textdb]</plugin_module>
      <plugin_datastoreadmin>yes</plugin_datastoreadmin>
      <plugin_params>
        <!-- specify plugin-specific parameters here, they will be
             passed to the plugin implementation for processing -->
        <ultimate_answer>42</ultimate_answer> <!-- just as an example -->
      </plugin_params>


      <!-- General datastore settings for all DB types -->

      <!-- if this is set to "yes", SyncML clients can only read
           from the server database, but make no modifications -->
      <readonly>no</readonly>

      <!-- conflict strategy: Newer item wins
           You can set "server-wins" or "client-wins" as well
           if you want to give one side precedence
      -->
      <conflictstrategy>newer-wins</conflictstrategy>

      <!-- on slowsync: duplicate items that are not fully equal
           You can set this to "newer-wins" as well to avoid
           duplicates as much as possible
      -->
      <slowsyncstrategy>duplicate</slowsyncstrategy>

      <!-- Visibility control: Server items that have the SYNCLVL
           field set to 0 will be invisible to SyncML clients.
           Using CGI-filtering in database names (such as
           ./contacts?SYNCLVL:>=5) smaller clients can
           sync a reduced set of server items -->
      <makepassfilter>F.SYNCLVL:=10</makepassfilter>
      <invisiblefilter>F.SYNCLVL:=0|F.SYNCLVL*=E</invisiblefilter>
      <makevisiblefilter>F.SYNCLVL:=10</makevisiblefilter>


      <!-- text db plugin is designed for UTF-8, make sure data is passed as UTF-8 (and not the ISO-8859-1 default) -->
      <datacharset>UTF-8</datacharset>
      <!-- use C-language (unix style) linefeeds (\n, 0x0A) -->
      <datalineends>unix</datalineends>

      <!-- set this to "UTC" if time values should be stored in UTC into the database
           rather than local time. "SYSTEM" denotes local server time zone. -->
      <datatimezone>SYSTEM</datatimezone>

      <!-- plugin DB may have its own identifiers to determine the point in time of changes, so
           we must make sure this identifier is stored (and not only the sync time) -->
      <storesyncidentifiers>yes</storesyncidentifiers>

      <!-- TextDB plugin supports resume and resuming partial items, so enable these here -->
      <resumesupport>yes</resumesupport>
      <resumeitemsupport>yes</resumeitemsupport>



      <!-- Mapping of the fields to the fieldlist "calendar" -->
      <fieldmap fieldlist="calendar">
        <automap indexasname="true"/>
      </fieldmap>

      <!-- datatypes supported by this datastore -->
      <typesupport>
        <use datatype="iCalendar20" mode="rw" variant="VTODO" preferred="yes"/>
        <use datatype="vCalendar10" mode="rw" variant="VTODO" preferred="legacy"/>
      </typesupport>

    </datastore>


    <!-- this "superdatastore" makes the two individual
         "events" and "tasks" datastores accessible as one
         datastore. This is required for example for
         older Symbian clients -->
    <superdatastore name="calendar">

      <!-- sub-datastores contained in this superdatastore -->

      <!-- if set, SyncML DS 1.2 filtering is possible and will be indicated in server devInf -->
      <ds12filters>yes</ds12filters>

      <!-- if set, datastore supports filtering by a date range specification (SINCE,BEFORE or /dr())
           Note: if this is set to yes, actual range filtering must be implemented in the datatype
           and/or the subdatastores contained in this superdatastore -->
      <daterangesupport>yes</daterangesupport>

      <contains datastore="events">
        <dispatchfilter>F.ISEVENT:=1</dispatchfilter>
        <guidprefix>e</guidprefix>
      </contains>

      <contains datastore="tasks">
        <dispatchfilter>F.ISEVENT:=0</dispatchfilter>
        <guidprefix>t</guidprefix>
      </contains>

      <!-- datatypes supported by this datastore -->
      <typesupport>
        <use datatype="iCalendar20" mode="rw" preferred="yes"/>
        <use datatype="vcalendar10" mode="rw" preferred="legacy"/>
      </typesupport>

    </superdatastore>


    <datastore name="notes" type="plugin">

      <plugin_module>[SDK_textdb]</plugin_module>
      <plugin_datastoreadmin>yes</plugin_datastoreadmin>
      <plugin_params>
        <!-- specify plugin-specific parameters here, they will be
             passed to the plugin implementation for processing -->
        <ultimate_answer>42</ultimate_answer> <!-- just as an example -->
      </plugin_params>


      <!-- General datastore settings for all DB types -->

      <!-- if this is set to "yes", SyncML clients can only read
           from the server database, but make no modifications -->
      <readonly>no</readonly>

      <!-- conflict strategy: Newer item wins
           You can set "server-wins" or "client-wins" as well
           if you want to give one side precedence
      -->
      <conflictstrategy>newer-wins</conflictstrategy>

      <!-- on slowsync: duplicate items that are not fully equal
           You can set this to "newer-wins" as well to avoid
           duplicates as much as possible
      -->
      <slowsyncstrategy>duplicate</slowsyncstrategy>

      <!-- Visibility control: Server items that have the SYNCLVL
           field set to 0 will be invisible to SyncML clients.
           Using CGI-filtering in database names (such as
           ./contacts?SYNCLVL:>=5) smaller clients can
           sync a reduced set of server items -->
      <makepassfilter>F.SYNCLVL:=10</makepassfilter>
      <invisiblefilter>F.SYNCLVL:=0|F.SYNCLVL*=E</invisiblefilter>
      <makevisiblefilter>F.SYNCLVL:=10</makevisiblefilter>


      <!-- text db plugin is designed for UTF-8, make sure data is passed as UTF-8 (and not the ISO-8859-1 default) -->
      <datacharset>UTF-8</datacharset>
      <!-- use C-language (unix style) linefeeds (\n, 0x0A) -->
      <datalineends>unix</datalineends>

      <!-- set this to "UTC" if time values should be stored in UTC into the database
           rather than local time. "SYSTEM" denotes local server time zone. -->
      <datatimezone>SYSTEM</datatimezone>

      <!-- plugin DB may have its own identifiers to determine the point in time of changes, so
           we must make sure this identifier is stored (and not only the sync time) -->
      <storesyncidentifiers>yes</storesyncidentifiers>

      <!-- TextDB plugin supports resume and resuming partial items, so enable these here -->
      <resumesupport>yes</resumesupport>
      <resumeitemsupport>yes</resumeitemsupport>



      <!-- Mapping of the fields to the fieldlist "notes" -->
      <fieldmap fieldlist="Note">
        <automap indexasname="true"/>
      </fieldmap>

      <typesupport>
        <use datatype="note10" mode="rw" preferred="yes"/>
        <use datatype="note11" mode="rw"/>
      </typesupport>

    </datastore>


    <datastore name="bookmarks" type="plugin">

      <plugin_module>[SDK_textdb]</plugin_module>
      <plugin_datastoreadmin>yes</plugin_datastoreadmin>
      <plugin_params>
        <!-- specify plugin-specific parameters here, they will be
             passed to the plugin implementation for processing -->
        <ultimate_answer>42</ultimate_answer> <!-- just as an example -->
      </plugin_params>


      <!-- General datastore settings for all DB types -->

      <!-- if this is set to "yes", SyncML clients can only read
           from the server database, but make no modifications -->
      <readonly>no</readonly>

      <!-- conflict strategy: Newer item wins
           You can set "server-wins" or "client-wins" as well
           if you want to give one side precedence
      -->
      <conflictstrategy>newer-wins</conflictstrategy>

      <!-- on slowsync: duplicate items that are not fully equal
           You can set this to "newer-wins" as well to avoid
           duplicates as much as possible
      -->
      <slowsyncstrategy>duplicate</slowsyncstrategy>

      <!-- Visibility control: Server items that have the SYNCLVL
           field set to 0 will be invisible to SyncML clients.
           Using CGI-filtering in database names (such as
           ./contacts?SYNCLVL:>=5) smaller clients can
           sync a reduced set of server items -->
      <makepassfilter>F.SYNCLVL:=10</makepassfilter>
      <invisiblefilter>F.SYNCLVL:=0|F.SYNCLVL*=E</invisiblefilter>
      <makevisiblefilter>F.SYNCLVL:=10</makevisiblefilter>


      <!-- text db plugin is designed for UTF-8, make sure data is passed as UTF-8 (and not the ISO-8859-1 default) -->
      <datacharset>UTF-8</datacharset>
      <!-- use C-language (unix style) linefeeds (\n, 0x0A) -->
      <datalineends>unix</datalineends>

      <!-- set this to "UTC" if time values should be stored in UTC into the database
           rather than local time. "SYSTEM" denotes local server time zone. -->
      <datatimezone>SYSTEM</datatimezone>

      <!-- plugin DB may have its own identifiers to determine the point in time of changes, so
           we must make sure this identifier is stored (and not only the sync time) -->
      <storesyncidentifiers>yes</storesyncidentifiers>

      <!-- TextDB plugin supports resume and resuming partial items, so enable these here -->
      <resumesupport>yes</resumesupport>
      <resumeitemsupport>yes</resumeitemsupport>



      <!-- Mapping of the fields to the fieldlist "bookmarks" -->
      <fieldmap fieldlist="bookmarks">
        <automap indexasname="true"/>
      </fieldmap>

      <!-- datatypes supported by this datastore -->
      <typesupport>
        <use datatype="vBookmark10" mode="rw" preferred="yes"/>
      </typesupport>

    </datastore>


    <datastore name="emails" type="plugin">

      <plugin_module>[SDK_textdb]</plugin_module>
      <plugin_datastoreadmin>yes</plugin_datastoreadmin>
      <plugin_params>
        <!-- specify plugin-specific parameters here, they will be
             passed to the plugin implementation for processing -->
        <ultimate_answer>42</ultimate_answer> <!-- just as an example -->
      </plugin_params>


      <!-- General datastore settings for all DB types -->

      <!-- if this is set to "yes", SyncML clients can only read
           from the server database, but make no modifications -->
      <readonly>no</readonly>

      <!-- conflict strategy: Newer item wins
           You can set "server-wins" or "client-wins" as well
           if you want to give one side precedence
      -->
      <conflictstrategy>newer-wins</conflictstrategy>

      <!-- on slowsync: duplicate items that are not fully equal
           You can set this to "newer-wins" as well to avoid
           duplicates as much as possible
      -->
      <slowsyncstrategy>duplicate</slowsyncstrategy>

      <!-- Visibility control: Server items that have the SYNCLVL
           field set to 0 will be invisible to SyncML clients.
           Using CGI-filtering in database names (such as
           ./contacts?SYNCLVL:>=5) smaller clients can
           sync a reduced set of server items -->
      <makepassfilter>F.SYNCLVL:=10</makepassfilter>
      <invisiblefilter>F.SYNCLVL:=0|F.SYNCLVL*=E</invisiblefilter>
      <makevisiblefilter>F.SYNCLVL:=10</makevisiblefilter>


      <!-- text db plugin is designed for UTF-8, make sure data is passed as UTF-8 (and not the ISO-8859-1 default) -->
      <datacharset>UTF-8</datacharset>
      <!-- use C-language (unix style) linefeeds (\n, 0x0A) -->
      <datalineends>unix</datalineends>

      <!-- set this to "UTC" if time values should be stored in UTC into the database
           rather than local time. "SYSTEM" denotes local server time zone. -->
      <datatimezone>SYSTEM</datatimezone>

      <!-- plugin DB may have its own identifiers to determine the point in time of changes, so
           we must make sure this identifier is stored (and not only the sync time) -->
      <storesyncidentifiers>yes</storesyncidentifiers>

      <!-- TextDB plugin supports resume and resuming partial items, so enable these here -->
      <resumesupport>yes</resumesupport>
      <resumeitemsupport>yes</resumeitemsupport>



      <!-- Mapping of the fields to the fieldlist "notes" -->
      <fieldmap fieldlist="email">
        <automap indexasname="true"/>
      </fieldmap>

      <typesupport>
        <!-- Note: the compressed Synthesis specific "email_zipbin" format is made the preferred format
             here to make sure clients supporting that format will actually use it. -->
        <use datatype="email_zipbin" mode="rw" preferred="yes"/>
        <use datatype="email" mode="rw" preferred="no"/>
        <use datatype="email_nokia9500" mode="rw" preferred="no"/>
        <use datatype="email_sonyericsson" mode="rw" preferred="no"/>
      </typesupport>

    </datastore>


    <!-- Remote Rules list
         =================
         Note: the <remoterule> tags specify options and exceptions needed for correct handling of
               certain devices. Synthesis AG provides this list including all currently know
               exceptions in this config file and also publishes regular updates for the list
               of remote rules on its web site at http://www.synthesis.ch
    -->


    <remoterule name="t39m">
      <!-- Rule for Ericsson T39m client -->
      <manufacturer>Ericsson</manufacturer>
      <software>R1A</software>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <inputcharset>ANSI</inputcharset>
      <descriptivename>Ericsson T39m</descriptivename>
    </remoterule>


    <remoterule name="t68">
      <!-- Rule for Ericsson T68 client -->
      <manufacturer>Ericsson</manufacturer>
      <software>R1B</software>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <inputcharset>ANSI</inputcharset>
      <descriptivename>Ericsson T68</descriptivename>
    </remoterule>


    <remoterule name="V3">
      <!-- Rule for Motorola V3 -->
      <manufacturer>Motorola*</manufacturer>
      <model>V3</model>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <quote8bitcontent>yes</quote8bitcontent>
      <nocontentfolding>yes</nocontentfolding>
      <outputcharset>ANSI</outputcharset>
      <inputcharset>ANSI</inputcharset>
      <descriptivename>Motorola V3</descriptivename>
    </remoterule>


    <remoterule name="V3i">
      <!-- Rule for Motorola V3i -->
      <manufacturer>Motorola*</manufacturer>
      <model>V3i</model>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <quote8bitcontent>yes</quote8bitcontent>
      <nocontentfolding>yes</nocontentfolding>
      <outputcharset>ANSI</outputcharset>
      <descriptivename>Motorola V3i</descriptivename>
    </remoterule>


    <remoterule name="6230">
      <manufacturer>NOKIA</manufacturer>
      <model>6230</model>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 6230</descriptivename>
    </remoterule>


    <remoterule name="9210">
      <manufacturer>NOKIA</manufacturer>
      <model>9210</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 9210</descriptivename>
    </remoterule>


    <remoterule name="9210i">
      <manufacturer>NOKIA</manufacturer>
      <model>9210i</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 9210</descriptivename>
    </remoterule>


    <remoterule name="3220">
      <manufacturer>NOKIA</manufacturer>
      <model>3220</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 3220</descriptivename>
    </remoterule>


    <remoterule name="3230">
      <manufacturer>NOKIA</manufacturer>
      <model>3230</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 3230</descriptivename>
    </remoterule>


    <remoterule name="3600">
      <manufacturer>NOKIA</manufacturer>
      <model>3600</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 3600</descriptivename>
    </remoterule>


    <remoterule name="3620">
      <manufacturer>NOKIA</manufacturer>
      <model>3620</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 3620</descriptivename>
    </remoterule>


    <remoterule name="3650">
      <manufacturer>NOKIA</manufacturer>
      <model>3650</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 3650</descriptivename>
    </remoterule>


    <remoterule name="3660">
      <manufacturer>NOKIA</manufacturer>
      <model>3660</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 3660</descriptivename>
    </remoterule>


    <remoterule name="6260">
      <manufacturer>NOKIA</manufacturer>
      <model>6260</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 6260</descriptivename>
    </remoterule>


    <remoterule name="6600">
      <manufacturer>NOKIA</manufacturer>
      <model>6600</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 6600</descriptivename>
    </remoterule>


    <remoterule name="6620">
      <manufacturer>NOKIA</manufacturer>
      <model>6620</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 6620</descriptivename>
    </remoterule>


    <remoterule name="6630">
      <manufacturer>NOKIA</manufacturer>
      <model>6630</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 6630</descriptivename>
    </remoterule>


    <remoterule name="6670">
      <manufacturer>NOKIA</manufacturer>
      <model>6670</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 6670</descriptivename>
    </remoterule>


    <remoterule name="7250">
      <manufacturer>NOKIA</manufacturer>
      <model>7250</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 7250</descriptivename>
    </remoterule>


    <remoterule name="7250i">
      <manufacturer>NOKIA</manufacturer>
      <model>7250i</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 7250i</descriptivename>
    </remoterule>


    <remoterule name="7260">
      <manufacturer>NOKIA</manufacturer>
      <model>7260</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 7260</descriptivename>
    </remoterule>


    <remoterule name="7610">
      <manufacturer>NOKIA</manufacturer>
      <model>7610</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 7610</descriptivename>
    </remoterule>


    <remoterule name="7650">
      <manufacturer>NOKIA</manufacturer>
      <model>7650</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia 7650</descriptivename>
    </remoterule>


    <remoterule name="N-Gage">
      <manufacturer>NOKIA</manufacturer>
      <model>N-Gage</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia N-Gage</descriptivename>
    </remoterule>


    <remoterule name="N-Gage QD">
      <manufacturer>NOKIA</manufacturer>
      <model>N-Gage QD</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Nokia N-Gage QD</descriptivename>
    </remoterule>


    <remoterule name="9300">
      <manufacturer>NOKIA</manufacturer>
      <model>9300</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <treatasutc>yes</treatasutc> <!-- needs 2.1.1 or later server -->
      <descriptivename>Nokia 9300</descriptivename>
    </remoterule>


    <remoterule name="9500">
      <manufacturer>NOKIA</manufacturer>
      <model>9500</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <treatasutc>yes</treatasutc> <!-- needs 2.1.1 or later server -->
      <descriptivename>Nokia 9500</descriptivename>
    </remoterule>


    <remoterule name="E90">
      <manufacturer>NOKIA</manufacturer>
      <model>E90</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <ignoredevinfmaxsize>yes</ignoredevinfmaxsize>
      <descriptivename>Nokia E90</descriptivename>
    </remoterule>


    <remoterule name="X">
      <manufacturer>Sendo</manufacturer>
      <model>X</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>Sendo X</descriptivename>
    </remoterule>


    <remoterule name="SX1">
      <manufacturer>SIEMENS</manufacturer>
      <model>SX1</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
      ]]></rulescript>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <forcelocaltime>yes</forcelocaltime>
      <!-- Note: SX1 crashes on contacts with empty properties -->
      <noemptyproperties>yes</noemptyproperties>
      <descriptivename>Siemens SX1</descriptivename>
    </remoterule>


    <remoterule name="M55">
      <manufacturer>SIEMENS</manufacturer>
      <model>M55</model>

      <forcelocaltime>yes</forcelocaltime>
      <limitedfieldlengths>yes</limitedfieldlengths>
      <descriptivename>Siemens M55</descriptivename>
    </remoterule>


    <remoterule name="SL55">
      <manufacturer>SIEMENS</manufacturer>
      <model>SL55</model>

      <forcelocaltime>yes</forcelocaltime>
      <limitedfieldlengths>yes</limitedfieldlengths>
      <descriptivename>Siemens SL55</descriptivename>
    </remoterule>


    <remoterule name="S55">
      <manufacturer>SIEMENS</manufacturer>
      <model>S55</model>

      <forcelocaltime>yes</forcelocaltime>
      <limitedfieldlengths>yes</limitedfieldlengths>
      <descriptivename>Siemens S55</descriptivename>
    </remoterule>


    <remoterule name="S65">
      <manufacturer>SIEMENS</manufacturer>
      <model>S65</model>

      <forcelocaltime>yes</forcelocaltime>
      <limitedfieldlengths>yes</limitedfieldlengths>
      <descriptivename>Siemens S65</descriptivename>
    </remoterule>


    <remoterule name="SL65">
      <manufacturer>SIEMENS</manufacturer>
      <model>SL65</model>

      <forcelocaltime>yes</forcelocaltime>
      <limitedfieldlengths>yes</limitedfieldlengths>
      <descriptivename>Siemens SL65</descriptivename>
    </remoterule>


    <remoterule name="K700">
      <!-- Rule for SonyEricsson K700 (aka SEMC Phone) client -->
      <manufacturer>SonyEricsson</manufacturer>
      <model>SEMC Phone</model>
      <software>R3B</software>

      <!-- is a 1.1 client and claims UTC support, but it seems not to work ok
      <forcelocaltime>yes</forcelocaltime>
      -->
      <limitedfieldlengths>yes</limitedfieldlengths>
      <descriptivename>SonyEricsson K700</descriptivename>
    </remoterule>


    <remoterule name="T610/T630">
      <!-- Rule for SonyEricsson T610/T630 client -->
      <manufacturer>SonyEricsson</manufacturer>
      <software>R2B</software>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <descriptivename>SonyEricsson T610/T630</descriptivename>
    </remoterule>


    <!-- Due to a problem in M600i vCalendar implementation,
         the device does not calculate time zones correctly
         in all cases.
         If your M600i is brand new, you need to specify
         "calendar?/o(Z)" as database path instead of just
         "calendar". If your M600i has already been synced
         at least once via the cradle and the software
         delivered with the device, you must omit the
         "?/o(Z)" appendix and specify just "calendar" instead.
         Please also note that the o(Z) option for never-synced
         M600i devices only works if your server's config is
         derived from a recent version of our sample config.
         Otherwise, just make sure the M600i is synced once
         in the cradle before using SyncML.
    -->
    <remoterule name="M600i">
      <manufacturer>Sony Ericsson</manufacturer>
      <model>M600i</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
        // retransfer body when items are moved to sent box
        retransfer_body=TRUE;
      ]]></rulescript>

      <treataslocaltime>no</treataslocaltime> <!-- can be set to yes to have /o(Z) mode (see comment above) as default, otherwise /o(z) is default -->
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>SonyEricsson M600i</descriptivename>
    </remoterule>


    <!-- Due to a problem in P800 vCalendar implementation,
         the device does not calculate time zones correctly
         in all cases.
         If your P800 is brand new, you need to specify
         "calendar?/o(Z)" as database path instead of just
         "calendar". If your P800 has already been synced
         at least once via the cradle and the software
         delivered with the device, you must omit the
         "?/o(Z)" appendix and specify just "calendar" instead.
         Please also note that the o(Z) option for never-synced
         P800 devices only works if your server's config is
         derived from a recent version of our sample config.
         Otherwise, just make sure the P800 is synced once
         in the cradle before using SyncML.
    -->
    <remoterule name="P800">
      <manufacturer>Sony Ericsson</manufacturer>
      <model>P800</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
        // retransfer body when items are moved to sent box
        retransfer_body=TRUE;
      ]]></rulescript>

      <treataslocaltime>no</treataslocaltime> <!-- can be set to yes to have /o(Z) mode (see comment above) as default, otherwise /o(z) is default -->
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>SonyEricsson P800</descriptivename>
    </remoterule>


    <!-- Due to a problem in P900 vCalendar implementation,
         the device does not calculate time zones correctly
         in all cases.
         If your P900 is brand new, you need to specify
         "calendar?/o(Z)" as database path instead of just
         "calendar". If your P900 has already been synced
         at least once via the cradle and the software
         delivered with the device, you must omit the
         "?/o(Z)" appendix and specify just "calendar" instead.
         Please also note that the o(Z) option for never-synced
         P900 devices only works if your server's config is
         derived from a recent version of our sample config.
         Otherwise, just make sure the P900 is synced once
         in the cradle before using SyncML.
    -->
    <remoterule name="P900">
      <manufacturer>Sony Ericsson</manufacturer>
      <model>P900</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
        // retransfer body when items are moved to sent box
        retransfer_body=TRUE;
      ]]></rulescript>

      <treataslocaltime>no</treataslocaltime> <!-- can be set to yes to have /o(Z) mode (see comment above) as default, otherwise /o(z) is default -->
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>SonyEricsson P900</descriptivename>
    </remoterule>


    <!-- Due to a problem in P910 vCalendar implementation,
         the device does not calculate time zones correctly
         in all cases.
         If your P910 is brand new, you need to specify
         "calendar?/o(Z)" as database path instead of just
         "calendar". If your P910 has already been synced
         at least once via the cradle and the software
         delivered with the device, you must omit the
         "?/o(Z)" appendix and specify just "calendar" instead.
         Please also note that the o(Z) option for never-synced
         P910 devices only works if your server's config is
         derived from a recent version of our sample config.
         Otherwise, just make sure the P910 is synced once
         in the cradle before using SyncML.
    -->
    <remoterule name="P910">
      <manufacturer>Sony Ericsson</manufacturer>
      <model>P910</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
        // retransfer body when items are moved to sent box
        retransfer_body=TRUE;
      ]]></rulescript>

      <treataslocaltime>no</treataslocaltime> <!-- can be set to yes to have /o(Z) mode (see comment above) as default, otherwise /o(z) is default -->
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>SonyEricsson P910</descriptivename>
    </remoterule>


    <!-- Due to a problem in P910i vCalendar implementation,
         the device does not calculate time zones correctly
         in all cases.
         If your P910i is brand new, you need to specify
         "calendar?/o(Z)" as database path instead of just
         "calendar". If your P910i has already been synced
         at least once via the cradle and the software
         delivered with the device, you must omit the
         "?/o(Z)" appendix and specify just "calendar" instead.
         Please also note that the o(Z) option for never-synced
         P910i devices only works if your server's config is
         derived from a recent version of our sample config.
         Otherwise, just make sure the P910i is synced once
         in the cradle before using SyncML.
    -->
    <remoterule name="P910i">
      <manufacturer>Sony Ericsson</manufacturer>
      <model>P910i</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
        // retransfer body when items are moved to sent box
        retransfer_body=TRUE;
      ]]></rulescript>

      <treataslocaltime>no</treataslocaltime> <!-- can be set to yes to have /o(Z) mode (see comment above) as default, otherwise /o(z) is default -->
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>SonyEricsson P910i</descriptivename>
    </remoterule>


    <!-- Due to a problem in P990i vCalendar implementation,
         the device does not calculate time zones correctly
         in all cases.
         If your P990i is brand new, you need to specify
         "calendar?/o(Z)" as database path instead of just
         "calendar". If your P990i has already been synced
         at least once via the cradle and the software
         delivered with the device, you must omit the
         "?/o(Z)" appendix and specify just "calendar" instead.
         Please also note that the o(Z) option for never-synced
         P990i devices only works if your server's config is
         derived from a recent version of our sample config.
         Otherwise, just make sure the P990i is synced once
         in the cradle before using SyncML.
    -->
    <remoterule name="P990i">
      <manufacturer>Sony Ericsson</manufacturer>
      <model>P990i</model>

      <rulescript><![CDATA[
        // no dates before 1980
        mindate=(TIMESTAMP)"19800101T000000Z";
        // retransfer body when items are moved to sent box
        retransfer_body=TRUE;
      ]]></rulescript>

      <treataslocaltime>no</treataslocaltime> <!-- can be set to yes to have /o(Z) mode (see comment above) as default, otherwise /o(z) is default -->
      <forcelocaltime>yes</forcelocaltime>
      <descriptivename>SonyEricsson P990i</descriptivename>
    </remoterule>


    <remoterule name="t68i">
      <!-- Rule for SonyEricsson T68i client -->
      <manufacturer>SonyEricsson</manufacturer>
      <software>R2A</software>

      <limitedfieldlengths>yes</limitedfieldlengths>
      <inputcharset>ANSI</inputcharset>
      <descriptivename>SonyEricsson T68i</descriptivename>
    </remoterule>


    <remoterule name="Funambol_Outlook">
      <!-- Rule for Funambol Outlook Sync Client -->
      <model>Funambol Outlook Sync Client</model>

      <lenientmode>yes</lenientmode> <!-- some status messages are missing at end of session -->
      <descriptivename>Funambol Outlook Sync Client</descriptivename>
    </remoterule>


    <remoterule name="SyncJe_Outlook">
      <!-- Rule for NextHaus SyncJe Outlook Edition -->
      <model>SyncJe Outlook Edition</model>

      <ignorectcap>yes</ignorectcap> <!-- can do contact photo sync, but is missing in CTCap -->
      <descriptivename>NextHaus SyncJe Outlook Client</descriptivename>
    </remoterule>

    <!-- End of remote rule list. -->

  </server>

</sysync_config>
