changeset 319:d0cff4da67ac HEAD

When selecting a mailbox and we're out of disk space, send ALERT to user telling about it.
author Timo Sirainen <tss@iki.fi>
date Thu, 26 Sep 2002 00:25:40 +0300
parents 6f82f54b8e27
children fb2bb2d2b4a5
files src/imap/cmd-select.c src/lib-storage/index/index-status.c src/lib-storage/mail-storage.h
diffstat 3 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-select.c	Thu Sep 26 00:24:32 2002 +0300
+++ b/src/imap/cmd-select.c	Thu Sep 26 00:25:40 2002 +0300
@@ -91,6 +91,11 @@
 		t_strdup_printf("* OK [UIDVALIDITY %u] UIDs valid",
 				status.uidvalidity));
 
+	if (status.diskspace_full) {
+		client_send_line(client, "* OK [ALERT] Disk space is full, "
+				 "delete some messages.");
+	}
+
 	client_send_tagline(client, box->readonly ?
 			    "OK [READ-ONLY] Select completed." :
 			    "OK [READ-WRITE] Select completed.");
--- a/src/lib-storage/index/index-status.c	Thu Sep 26 00:24:32 2002 +0300
+++ b/src/lib-storage/index/index-status.c	Thu Sep 26 00:25:40 2002 +0300
@@ -119,6 +119,7 @@
 	status->unseen = hdr->messages_count - hdr->seen_messages_count;
 	status->uidvalidity = hdr->uid_validity;
 	status->uidnext = hdr->next_uid;
+	status->diskspace_full = ibox->index->nodiskspace;
 
 	if (items & STATUS_FIRST_UNSEEN_SEQ) {
 		status->first_unseen_seq =
--- a/src/lib-storage/mail-storage.h	Thu Sep 26 00:24:32 2002 +0300
+++ b/src/lib-storage/mail-storage.h	Thu Sep 26 00:25:40 2002 +0300
@@ -188,6 +188,8 @@
 
 	unsigned int first_unseen_seq;
 
+	unsigned int diskspace_full:1;
+
 	/* may be allocated from temp pool */
 	const char *custom_flags[MAIL_CUSTOM_FLAGS_COUNT];
 };