[Dovecot] Changing Quota downward for special Mailboxes? (2.1.6)

Jost Krieger Jost.Krieger+dovecot at rub.de
Thu Sep 27 12:08:43 EEST 2012


On Wed 19 Sep 2012 02:52:41 PM GMT, Jost Krieger wrote:
> Oops, that's not what I want!
> 
> How about another command line parameter for lda to suppress the
> emergency save? We know exactly when we are trying to save probable
> spam.
 
I've tried my luck. Would the attached patch be sensible and welcome?

Yours
Jost Krieger
-- 
| Jost.Krieger+sig at ruhr-uni-bochum.de  Please help stamp out spam! |
| Postmaster, JAPH, resident answer machine    at RUB Comp. Center |
| Sincere words are not sweet, sweet words are not sincere.        |
|                                          Lao Tse, Tao Te King 81 |
-------------- next part --------------
diff -r 88a05f387743 doc/man/dovecot-lda.1.in
--- a/doc/man/dovecot-lda.1.in	Thu Sep 27 02:55:14 2012 +0300
+++ b/doc/man/dovecot-lda.1.in	Thu Sep 27 11:04:56 2012 +0200
@@ -5,7 +5,7 @@
 .\"------------------------------------------------------------------------
 .SH SYNOPSIS
 .B dovecot\-lda
-.RB [ \-ek ]
+.RB [ \-eEk ]
 [\fB\-a\fP \fIaddress\fP]
 [\fB\-c\fP \fIconfig_file\fP]
 [\fB\-d\fP \fIusername\fP]
@@ -61,6 +61,10 @@
 The default is to send a rejection mail ourself.
 .\"-------------------------------------
 .TP
+.B \-E
+If mail delivery fails, don't try to do an emergency delivery attempt to INBOX.
+.\"-------------------------------------
+.TP
 .BI \-f\  envelope_sender
 Envelope sender address.
 .\"-------------------------------------
diff -r 88a05f387743 src/lda/main.c
--- a/src/lda/main.c	Thu Sep 27 02:55:14 2012 +0300
+++ b/src/lda/main.c	Thu Sep 27 11:04:56 2012 +0200
@@ -310,7 +310,7 @@
 	master_service = master_service_init("lda",
 		MASTER_SERVICE_FLAG_STANDALONE |
 		MASTER_SERVICE_FLAG_DONT_LOG_TO_STDERR,
-		&argc, &argv, "a:d:ef:km:p:r:");
+		&argc, &argv, "a:d:eEf:km:p:r:");
 
 	memset(&ctx, 0, sizeof(ctx));
 	ctx.session = mail_deliver_session_init();
@@ -334,6 +334,9 @@
 		case 'e':
 			stderr_rejection = TRUE;
 			break;
+		case 'E':
+			ctx.suppress_emergency_delivery = TRUE;
+			break;
 		case 'f':
 			/* envelope sender address */
 			ctx.src_envelope_sender =
diff -r 88a05f387743 src/lib-lda/mail-deliver.c
--- a/src/lib-lda/mail-deliver.c	Thu Sep 27 02:55:14 2012 +0300
+++ b/src/lib-lda/mail-deliver.c	Thu Sep 27 11:04:56 2012 +0200
@@ -402,7 +402,7 @@
 		ret = mail_deliver_save(ctx, ctx->dest_mailbox_name, 0, NULL,
 					storage_r);
 	}
-	if (ret < 0 && strcasecmp(ctx->dest_mailbox_name, "INBOX") != 0) {
+	if (ret < 0 && !ctx->suppress_emergency_delivery && strcasecmp(ctx->dest_mailbox_name, "INBOX") != 0) {
 		/* still didn't work. try once more to save it
 		   to INBOX. */
 		ret = mail_deliver_save(ctx, "INBOX", 0, NULL, storage_r);
diff -r 88a05f387743 src/lib-lda/mail-deliver.h
--- a/src/lib-lda/mail-deliver.h	Thu Sep 27 02:55:14 2012 +0300
+++ b/src/lib-lda/mail-deliver.h	Thu Sep 27 11:04:56 2012 +0200
@@ -49,6 +49,7 @@
 	struct var_expand_table *var_expand_table;
 
 	bool tried_default_save;
+	bool suppress_emergency_delivery;
 	bool saved_mail;
 	bool save_dest_mail;
 	/* Delivery failed because user is out of quota / disk space */


More information about the dovecot mailing list