[dovecot-cvs] dovecot-lda/src deliver.c,1.30,1.31

cras at dovecot.org cras at dovecot.org
Sun Oct 16 17:48:21 EEST 2005


Update of /var/lib/cvs/dovecot-lda/src
In directory talvi:/tmp/cvs-serv5452

Modified Files:
	deliver.c 
Log Message:
Added -m parameter to store mail to non-INBOX mailbox without Sieve scripting.



Index: deliver.c
===================================================================
RCS file: /var/lib/cvs/dovecot-lda/src/deliver.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- deliver.c	15 Oct 2005 13:54:24 -0000	1.30
+++ deliver.c	16 Oct 2005 14:48:19 -0000	1.31
@@ -458,6 +458,7 @@
 int main(int argc, char *argv[])
 {
 	const char *config_path = DEFAULT_CONFIG_FILE;
+	const char *mailbox = "INBOX";
 	const char *auth_socket;
 	const char *home, *destination, *mail_env, *str, *script_path;
         const struct var_expand_table *table;
@@ -496,6 +497,14 @@
 					"Missing config file path argument");
 			}
 			config_path = argv[i];
+		} else if (strcmp(argv[i], "-m") == 0) {
+			/* destination mailbox */
+			i++;
+			if (i == argc) {
+				i_fatal_status(EX_USAGE,
+					       "Missing mailbox argument");
+			}
+			mailbox = argv[i];
 		} else {
 			print_help();
 			i_fatal_status(EX_USAGE,
@@ -619,7 +628,7 @@
 	if (ret <= 0) {
 		/* sieve script didn't handle this. store into inbox. */
 		i_stream_seek(input, 0);
-		if (save_mail(storage, "INBOX", mail, 0, NULL) < 0) {
+		if (save_mail(storage, mailbox, mail, 0, NULL) < 0) {
 			const char *error;
 			int ret, syntax, temporary_error;
 



More information about the dovecot-cvs mailing list