From 8162353e9d63b4e2643ccd747520449f728b119d Mon Sep 17 00:00:00 2001
From: Bron Gondwana <brong@launde.home.brong.net>
Date: Wed, 24 Dec 2008 23:29:36 +1100
Subject: [PATCH] Autoreply to Envelope FROM

This patch is from the mailing list, and allows auto-reply
to the value of the Envelope 'FROM'.
---
 script.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/script.c b/script.c
index ca9f982..1843dd4 100644
--- a/script.c
+++ b/script.c
@@ -449,6 +449,10 @@ static int send_notify_callback(sieve_interp_t *interp,
     nc.options = notify->options ? notify->options : NULL;
     nc.priority = notify->priority;
 
+    if(nc.options && !strcmp(nc.method,"mailto"))
+      if(!strcmp("$env-from$",*nc.options))
+        interp->getenvelope(message_context, "From", &nc.options);
+
     build_notify_message(interp, body_cache, notify->message, message_context, 
 			 &out_msg, &out_msglen);
 
-- 
1.5.6.5

