+/* if mailbox has at least 1 new message, sets mtime > atime of mailbox
+ * so buffy check reports new mail */
+static void reset_atime (CONTEXT *ctx)
+{
+ struct utimbuf utimebuf;
+ int i;
+ time_t now = time (NULL);
+
+ for (i = 0; i < ctx->msgcount; i++)
+ {
+ if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->read && !ctx->hdrs[i]->old)
+ {
+ utimebuf.actime = now - 1;
+ utimebuf.modtime = now;
+ utime (ctx->path, &utimebuf);
+ return;
+ }
+ }
+}
+