diff --git a/src/server/testsuite/lyskomd.0/gen-15.py b/src/server/testsuite/lyskomd.0/gen-15.py
index 96ec0961102ce5a727ccbd10f99492a2696c6c4b..dfd1ee79a22a2fe16ef1191aad09b79ce39132c6 100644
--- a/src/server/testsuite/lyskomd.0/gen-15.py
+++ b/src/server/testsuite/lyskomd.0/gen-15.py
@@ -1,5 +1,13 @@
 import string
 
+# Set EXTENDED to 1 to emit tests for lots of misc-into combinations,
+# which takes a very long time to test (approx. 5 minutes on a 600 MHz Athlon).
+EXTENDED = 0
+
+# Set DEBUG to 1 to emit extra "get-time" calls, which slows the test down
+# approximately 5%, but makes it easier to spot errors.
+DEBUG = 1
+
 class factory:
     def __init__(self, bcc_trigg, bcc_visible, other_trigg, other_visible, rd):
         self.__bcc_trigg = bcc_trigg
@@ -11,38 +19,59 @@ class factory:
                 self.__other_visible.append(n)
 	self.__readable = bcc_trigg + other_trigg + rd
 
-    def create(self, misc, conf, loc):
+    def create(self, misc, conf, loc,
+               rec_time = None, sent_by = None, sent_at = None):
         if misc == 15:
             trigg = self.__bcc_trigg
             visib = self.__bcc_visible
         else:
             trigg = self.__other_trigg
             visib = self.__other_visible
-        return misc_group(misc, conf, loc, trigg, visib, self.__readable)
+        return misc_group(misc, conf, loc, trigg, visib, self.__readable,
+                          rec_time, sent_by, sent_at)
+
+
+def a_list_pattern(lst):
+    if len(lst) == 0:
+        return "0 \\\\\\*"
+    else:
+        return "%d { %s }" % (len(lst), string.join(lst, " "))
+
+def a_list_rq(lst):
+    return "%d { %s }" % (len(lst), string.join(lst, " "))
 
 
 class misc_group:
-    def __init__(self, misc, conf, loc, trigg, visib, readable):
+    def __init__(self, misc, conf, loc, trigg, visib, readable,
+                 rec_time, sent_by, sent_at):
         self.__misc = misc
         self.__conf = conf
         self.__loc = loc
         self.__trigg = trigg
         self.__visib = visib
 	self.__readable = readable
+        self.__rec_time = rec_time
+        self.__sent_by = sent_by
+        self.__sent_at = sent_at
 
-    def miscs(self, viewer, rec_time = None, sent_by = None, sent_at = None):
+    def miscs(self, viewer):
         if viewer not in self.__visib:
             return []
         res = ["%d %d" % (self.__misc, self.__conf),
                "6 %d" % self.__loc]
-        if rec_time != None:
+        if self.__rec_time != None:
             res.append("7 $any_time")
-        if sent_by != None:
-            res.append("8 %d" % sent_by)
-        if sent_at != None:
+        if self.__sent_by != None:
+            res.append("8 %d" % self.__sent_by)
+        if self.__sent_at != None:
             res.append("9 $any_time")
         return res
 
+    def async(self, viewer, txt):
+        if viewer not in self.__visib:
+            return None
+        return "%d %d %d" % (txt, self.__conf, self.__misc)
+
     def trigger(self, viewer):
         return viewer in self.__trigg
 
@@ -90,7 +119,7 @@ obj = {
     (9,  8): factory([8], [9], [], [6, 7], []),
     (9,  9): factory([9], [], [], [6, 7, 8], []),
     (9, 10): factory([7, 8], [6, 9], [], [], [6, 9]),
-    (9, 11): factory([7, 8], [9], [], [], []),
+    (9, 11): factory([7, 8], [9], [], [6], []),
     (9, 12): factory([7, 8], [9], [], [], []),
     (9, 13): factory([7, 8], [6, 9], [], [], [6, 9]),
     (9, 14): factory([7, 8], [9], [], [6], [9]),
@@ -138,11 +167,26 @@ def create(author, recipients):
     talk_to(author)
     cs = ref.next()
     tx = tno.next()
-    print "send \"%d 86 [holl \"text %d\"] %d { %s } 0 { }\\n\"" % (
-        cs, tx, len(crea), string.join(crea, " "))
+    print "send \"%d 86 [holl \"text %d\"] %s 0 { }\\n\"" % (
+        cs, tx, a_list_rq(crea))
     new_text(author, tx, misc)
     talk_to(author)
     print "simple_expect \"=%d %d\"" % (cs, tx)
+    verify_text_stat(tx, author, misc)
+    return (tx, misc)
+
+def add_misc(author, txt, misc_type, rcpt, old_misc):
+    misc = obj[(author, rcpt)].create(misc_type, rcpt, locno.alloc(rcpt),
+                                      sent_at = 1)
+    talk_to(author)
+    cs = ref.next()
+    print "send \"%d 30 %d %d %d\\n\"" % (cs, txt, rcpt, misc_type)
+    new_recipient(author, txt, misc, old_misc)
+    talk_to(author)
+    print "simple_expect \"=%d\"" % cs
+    return misc
+
+def verify_text_stat(tx, author, misc):
     for p in PERSONS:
         talk_to(p)
         print "send \"%d 90 %d\\n\"" % (ref.next(), tx)
@@ -154,12 +198,11 @@ def create(author, recipients):
                 visib = 1
         if visib:
             print "simple_expect \"=%d $any_time " \
-                  "%d 0 %d 0 %d { %s } 0 \\\\\\*\"" % (
+                  "%d 0 %d 0 %s 0 \\\\\\*\"" % (
                 ref.curr, author, len("text %d" % tx),
-                len(pattern), string.join(pattern, " "))
+                a_list_pattern(pattern))
         else:
             print "simple_expect \"%%%d 14 %d\"" % (ref.curr, tx)
-    return (tx, misc)
 
 PERSONS = range(6, 10)
 
@@ -174,10 +217,52 @@ def new_text(author, txt, misc):
         if sent:
             talk_to(viewer)
             print "simple_expect \":18 15 %d $any_time " \
-                  "%d 0 %d 0 %d { %s } 0 \\\\\\*\"" % (
+                  "%d 0 %d 0 %s 0 \\\\\\*\"" % (
+                txt, author, len("text %d" % txt),
+                a_list_pattern(pattern))
+        elif author != viewer and DEBUG:
+            talk_to(viewer)
+            print "send \"%d 35\\n\"" % ref.next()
+            print "simple_expect \"=%d $any_time\"" % ref.curr
+
+def new_recipient(author, tx, misc, old_misc):
+    for viewer in PERSONS:
+        sent = 0
+        for m in old_misc + [misc]:
+            if m.trigger(viewer):
+                sent = 1
+        async = misc.async(viewer, tx)
+        if sent and async != None:
+            talk_to(viewer)
+            print "simple_expect \":3 16 %s\"" % async
+        elif author != viewer and DEBUG:
+            talk_to(viewer)
+            print "send \"%d 35\\n\"" % ref.next()
+            print "simple_expect \"=%d $any_time\"" % ref.curr
+
+def delete(author, txt, misc):
+    nr = ref.next()
+    talk_to(author)
+    print "send \"%d 29 %d\\n\"" % (nr, txt)
+    deleted_text(author, txt, misc)
+    talk_to(author)
+    print "simple_expect \"=%d\"" % nr
+
+def deleted_text(author, txt, misc):
+    for viewer in PERSONS:
+        sent = 0
+        pattern = []
+        for m in misc:
+            if m.trigger(viewer):
+                sent = 1
+            pattern = pattern + m.miscs(viewer)
+        if sent:
+            talk_to(viewer)
+            print "simple_expect \":18 14 %d $any_time " \
+                  "%d 0 %d 0 %s 0 \\\\\\*\"" % (
                 txt, author, len("text %d" % txt),
-                len(pattern), string.join(pattern, " "))
-        elif author != viewer:
+                a_list_pattern(pattern))
+        elif author != viewer and DEBUG:
             talk_to(viewer)
             print "send \"%d 35\\n\"" % ref.next()
             print "simple_expect \"=%d $any_time\"" % ref.curr
@@ -242,10 +327,55 @@ def disco():
     print "lyskomd_death"
 
 setup()
+
+print "send_user \"testing simple create+delete\\n\""
+
 for author in [6, 7, 8, 9]:
-    for misc in [0, 1, 15]:
+    for misc_type in [0, 1, 15]:
         for rcpt in [6, 7, 8, 9, 10, 11, 12, 13, 14, 15]:
             if author in [6, 9] and rcpt in [12, 15]:
                 continue
-            create(author, [(misc, rcpt)])
+            (txt, misc) = create(author, [(misc_type, rcpt)])
+            delete(author, txt, misc)
+            if not EXTENDED:
+                continue
+            for second_misc_type in [0, 1, 15]:
+                for second_rcpt in [6, 7, 8, 9, 10, 11, 12, 13, 14, 15]:
+                    if rcpt == second_rcpt:
+                        continue
+                    if author in [6, 9] and second_rcpt in [12, 15]:
+                        continue
+                    (txt, misc) = create(author, [
+                        (misc_type, rcpt),
+                        (second_misc_type, second_rcpt)])
+                    delete(author, txt, misc)
+
+print "send_user \"testing simple create+add+delete\\n\""
+
+for author in [6, 7, 8, 9]:
+    for misc_type in [0, 1, 15]:
+        for rcpt in [6, 7, 8, 9, 10, 11, 12, 13, 14, 15]:
+            if author in [6, 9] and rcpt in [12, 15]:
+                continue
+            (txt, misc) = create(author, []) 
+            misc.append(add_misc(author, txt, misc_type, rcpt, misc))
+            verify_text_stat(txt, author, misc)
+            delete(author, txt, misc)
+            if not EXTENDED:
+                continue
+            for second_misc_type in [0, 1, 15]:
+                for second_rcpt in [6, 7, 8, 9, 10, 11, 12, 13, 14, 15]:
+                    if rcpt == second_rcpt:
+                        continue
+                    if author in [6, 9] and second_rcpt in [12, 15]:
+                        continue
+                    (txt, misc) = create(author, [])
+                    misc.append(add_misc(author, txt, misc_type, rcpt, misc))
+                    verify_text_stat(txt, author, misc)
+                    misc.append(add_misc(author, txt,
+                                         second_misc_type, second_rcpt, misc))
+                    verify_text_stat(txt, author, misc)
+                    delete(author, txt, misc)
+
+
 disco()