#include <pwd.h>
#include <errno.h>
#include <sys/types.h>
-#include <sys/time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
#include <sys/wait.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include "citadel.h"
#include "server.h"
-#include <time.h>
#include "sysdep_decls.h"
#include "citserver.h"
#include "support.h"
void imap_fetch_flags(int seq) {
cprintf("FLAGS (");
if (IMAP->flags[seq] & IMAP_DELETED) cprintf("\\Deleted ");
+ if (IMAP->flags[seq] & IMAP_SEEN) cprintf("\\Seen ");
cprintf(")");
}
}
fprintf(imfp->output_fp, "\r\n");
}
- fprintf(imfp->output_fp, "Content-Length: %d\r\n", length);
+ fprintf(imfp->output_fp, "Content-Length: %ld\r\n", (long)length);
fprintf(imfp->output_fp, "\r\n");
}
fclose(tmp);
- if (is_peek) {
- /* FIXME set the last read pointer or something */
+ /* Mark this message as "seen" *unless* this is a "peek" operation */
+ if (is_peek == 0) {
+ CtdlSetSeen(msgnum, 1);
}
}
*imap_fetch_bodystructure_pre, /* pre-multi */
*imap_fetch_bodystructure_post, /* post-multi */
NULL,
- 0);
+ 1); /* don't decode -- we want it as-is */
}