dovecot-2.0-pigeonhole: Vacation extension: now inhibits replies...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Wed Feb 9 20:32:36 EET 2011


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/0b7100d990b2
changeset: 1471:0b7100d990b2
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Wed Feb 09 19:31:36 2011 +0100
description:
Vacation extension: now inhibits replies to messages from sender listed in :addresses.

diffstat:

 src/lib-sieve/plugins/vacation/cmd-vacation.c |  25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r c4ff3b2c21e3 -r 0b7100d990b2 src/lib-sieve/plugins/vacation/cmd-vacation.c
--- a/src/lib-sieve/plugins/vacation/cmd-vacation.c	Wed Feb 09 19:29:43 2011 +0100
+++ b/src/lib-sieve/plugins/vacation/cmd-vacation.c	Wed Feb 09 19:31:36 2011 +0100
@@ -1039,13 +1039,30 @@
 	}    
 	
 	/* Are we perhaps trying to respond to ourselves ? 
-	 * (FIXME: verify this to :addresses as well?)
 	 */
-	if ( sieve_address_compare(sender, recipient, TRUE) 
-		== 0 ) {
-		sieve_result_global_log(aenv, "discarded vacation reply to own address");	
+	if ( sieve_address_compare(sender, recipient, TRUE) == 0 ) {
+		sieve_result_global_log(aenv,
+			"discarded vacation reply to own address <%s>",
+			str_sanitize(sender, 128));	
 		return TRUE;
 	}
+
+	/* Are we perhaps trying to respond to one of our alternative :addresses?
+	 */
+	if ( ctx->addresses != NULL ) {
+		const char * const *alt_address = ctx->addresses;
+		
+		while ( *alt_address != NULL ) {
+			if ( sieve_address_compare(sender, *alt_address, TRUE) == 0 ) {
+				sieve_result_global_log(aenv,
+					"discarded vacation reply to own address <%s> "
+					"(as specified using :addresses argument)",
+					str_sanitize(sender, 128));	
+				return TRUE;
+			}
+			alt_address++;
+		}			
+	}
 	
 	/* Did whe respond to this user before? */
 	if ( sieve_action_duplicate_check_available(senv) ) {


More information about the dovecot-cvs mailing list