+ char buf[SIZ];
+ long len;
+ long count;
+ stringlist *Messages;
+ stringlist *NextMsg;
+
+ Messages = NULL;
+ NextMsg = NULL;
+ count = 0;
+ if (CtdlAccessCheck(ac_room_aide)) return;
+ if (atoi(argbuf) == 0) {
+ cprintf("%d Ok.\n", CIT_OK);
+ return;
+ }
+ cprintf("%d Send info...\n", SEND_LISTING);
+
+ do {
+ len = client_getln(buf, sizeof buf);
+ if (strcmp(buf, "000")) {
+ if (Messages == NULL) {
+ Messages = malloc (sizeof (stringlist));
+ NextMsg = Messages;
+ }
+ else {
+ Messages->Next = malloc (sizeof (stringlist));
+ NextMsg = NextMsg->Next;
+ }
+ NextMsg->Next = NULL;
+ NextMsg->Str = malloc (len+1);
+ NextMsg->len = len;
+ memcpy (NextMsg->Str, buf, len + 1);/// maybe split spam /ham per line?
+ count++;
+ }
+ } while (strcmp(buf, "000"));
+/// is there a way to filter foreachmessage by a list?