+ else if (!strcasecmp(operation, "fetch")) {
+ msg = malloc(sizeof(struct CtdlMessage));
+ memset(msg, 0, sizeof(struct CtdlMessage));
+ msg->cm_magic = CTDLMESSAGE_MAGIC;
+ msg->cm_anon_type = MES_NORMAL;
+ msg->cm_format_type = FMT_RFC822;
+ msg->cm_fields['A'] = strdup("Citadel");
+ fp = fopen(temp, "r");
+ if (fp) {
+ long len;
+ fseek(fp, 0L, SEEK_END);
+ len = ftell(fp);
+ fseek(fp, 0L, SEEK_SET);
+ msg->cm_fields['M'] = malloc(len + 1);
+ rv = fread(msg->cm_fields['M'], len, 1, fp);
+ msg->cm_fields['M'][len] = 0;
+ fclose(fp);
+ }
+ msgnum = CtdlSubmitMsg(msg, NULL, "Lobby", 0); /* FIXME put somewhere else */
+ CtdlFreeMessage(msg);
+ cprintf("%d %ld\n", CIT_OK, msgnum);
+ }
+ else if (!strcasecmp(operation, "revert")) {