changeset 2719:f8adc5cb2508 HEAD

Renamed pop3_mails_keep_recent to pop3_no_flag_updates which includes not updating seen-flag.
author Timo Sirainen <tss@iki.fi>
date Sun, 10 Oct 2004 17:32:32 +0300
parents f5b135533197
children b0474af863ab
files dovecot-example.conf src/auth/mech.c src/master/mail-process.c src/master/master-settings.c src/master/master-settings.h src/pop3/client.c src/pop3/commands.c src/pop3/common.h src/pop3/main.c
diffstat 9 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/dovecot-example.conf	Sun Oct 10 17:21:07 2004 +0300
+++ b/dovecot-example.conf	Sun Oct 10 17:32:32 2004 +0300
@@ -426,10 +426,10 @@
   # POP3 executable location
   #mail_executable = /usr/libexec/dovecot/pop3
 
-  # Don't try to set mails non-recent with POP3 sessions. This is mostly
-  # intended to reduce disk I/O. With maildir it doesn't move files from
-  # new/ to cur/, with mbox it doesn't write Status-header.
-  #pop3_mails_keep_recent = no
+  # Don't try to set mails non-recent or seen with POP3 sessions. This is
+  # mostly intended to reduce disk I/O. With maildir it doesn't move files
+  # from new/ to cur/, with mbox it doesn't write Status-header.
+  #pop3_no_flag_updates = no
 
   # Support LAST command which exists in old POP3 specs, but has been removed
   # from new ones. Some clients still wish to use this though. Enabling this
--- a/src/auth/mech.c	Sun Oct 10 17:21:07 2004 +0300
+++ b/src/auth/mech.c	Sun Oct 10 17:32:32 2004 +0300
@@ -241,7 +241,8 @@
 		/* get this before callback because it can destroy connection */
 		free_request = AUTH_MASTER_IS_DUMMY(auth_request->conn->master);
 
-		reply_data = mech_auth_success(&reply, auth_request, data, data_size);
+		reply_data = mech_auth_success(&reply, auth_request,
+					       data, data_size);
 		auth_request->callback(&reply, reply_data, auth_request->conn);
 	}
 
--- a/src/master/mail-process.c	Sun Oct 10 17:21:07 2004 +0300
+++ b/src/master/mail-process.c	Sun Oct 10 17:32:32 2004 +0300
@@ -218,8 +218,8 @@
 		env_put("MAILDIR_CHECK_CONTENT_CHANGES=1");
 	if (set->mail_full_filesystem_access)
 		env_put("FULL_FILESYSTEM_ACCESS=1");
-	if (set->pop3_mails_keep_recent)
-		env_put("POP3_MAILS_KEEP_RECENT=1");
+	if (set->pop3_no_flag_updates)
+		env_put("POP3_NO_FLAG_UPDATES=1");
 	if (set->mbox_dirty_syncs)
 		env_put("MBOX_DIRTY_SYNCS=1");
 	if (set->mbox_lazy_writes)
--- a/src/master/master-settings.c	Sun Oct 10 17:21:07 2004 +0300
+++ b/src/master/master-settings.c	Sun Oct 10 17:32:32 2004 +0300
@@ -122,7 +122,7 @@
 	DEF(SET_STR, imap_client_workarounds),
 
 	/* pop3 */
-	DEF(SET_BOOL, pop3_mails_keep_recent),
+	DEF(SET_BOOL, pop3_no_flag_updates),
 	DEF(SET_BOOL, pop3_enable_last),
 	DEF(SET_STR, pop3_client_workarounds),
 
@@ -290,7 +290,7 @@
 	MEMBER(imap_client_workarounds) NULL,
 
 	/* pop3 */
-	MEMBER(pop3_mails_keep_recent) FALSE,
+	MEMBER(pop3_no_flag_updates) FALSE,
 	MEMBER(pop3_enable_last) FALSE,
 	MEMBER(pop3_client_workarounds) NULL,
 
--- a/src/master/master-settings.h	Sun Oct 10 17:21:07 2004 +0300
+++ b/src/master/master-settings.h	Sun Oct 10 17:32:32 2004 +0300
@@ -93,7 +93,7 @@
 	const char *imap_client_workarounds;
 
 	/* pop3 */
-	int pop3_mails_keep_recent;
+	int pop3_no_flag_updates;
 	int pop3_enable_last;
 	const char *pop3_client_workarounds;
 
--- a/src/pop3/client.c	Sun Oct 10 17:21:07 2004 +0300
+++ b/src/pop3/client.c	Sun Oct 10 17:32:32 2004 +0300
@@ -211,7 +211,7 @@
 	mail_storage_set_callbacks(storage, &mail_storage_callbacks, client);
 
 	flags = 0;
-	if (getenv("POP3_MAILS_KEEP_RECENT") != NULL)
+	if (no_flag_updates)
 		flags |= MAILBOX_OPEN_KEEP_RECENT;
 	client->mailbox = mailbox_open(storage, "INBOX", flags);
 	if (client->mailbox == NULL) {
--- a/src/pop3/commands.c	Sun Oct 10 17:21:07 2004 +0300
+++ b/src/pop3/commands.c	Sun Oct 10 17:32:32 2004 +0300
@@ -332,7 +332,7 @@
 		return;
 	}
 
-	if (body_lines == (uoff_t)-1) {
+	if (body_lines == (uoff_t)-1 && !no_flag_updates) {
 		/* mark the message seen with RETR command */
 		if (client->seen_bitmask == NULL) {
 			client->seen_bitmask =
--- a/src/pop3/common.h	Sun Oct 10 17:21:07 2004 +0300
+++ b/src/pop3/common.h	Sun Oct 10 17:32:32 2004 +0300
@@ -10,7 +10,7 @@
 
 extern struct ioloop *ioloop;
 extern enum client_workarounds client_workarounds;
-extern int enable_last_command;
+extern int enable_last_command, no_flag_updates;
 
 extern void (*hook_mail_storage_created)(struct mail_storage **storage);
 extern void (*hook_client_created)(struct client **client);
--- a/src/pop3/main.c	Sun Oct 10 17:21:07 2004 +0300
+++ b/src/pop3/main.c	Sun Oct 10 17:32:32 2004 +0300
@@ -35,6 +35,7 @@
 static char log_prefix[128]; /* syslog() needs this to be permanent */
 enum client_workarounds client_workarounds = 0;
 int enable_last_command = FALSE;
+int no_flag_updates = FALSE;
 
 static void sig_quit(int signo __attr_unused__)
 {
@@ -132,6 +133,7 @@
 
 	parse_workarounds();
 	enable_last_command = getenv("POP3_ENABLE_LAST") != NULL;
+	no_flag_updates = getenv("POP3_NO_FLAG_UPDATES") != NULL;
 
 	storage = mail_storage_create_with_data(mail, getenv("USER"));
 	if (storage == NULL) {