aboutsummaryrefslogtreecommitdiff
path: root/src/builtin/sieve.bi
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtin/sieve.bi')
-rw-r--r--src/builtin/sieve.bi12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/builtin/sieve.bi b/src/builtin/sieve.bi
index ea531a83..871bbc90 100644
--- a/src/builtin/sieve.bi
+++ b/src/builtin/sieve.bi
@@ -85,7 +85,8 @@ MF_DEFUN(sieve, NUMBER, NUMBER nmsg, STRING script, OPTIONAL, NUMBER flags,
int f = MF_OPTVAL(flags);
mu_attribute_t attr;
mu_message_t msg;
-
+ const char *s;
+
rc = mu_sieve_machine_create(&mach);
MF_ASSERT(rc == 0, mfe_failure,
_("failed to initialize sieve machine: %s"),
@@ -97,6 +98,15 @@ MF_DEFUN(sieve, NUMBER, NUMBER nmsg, STRING script, OPTIONAL, NUMBER flags,
if (f & MF_SIEVE_DEBUG_INSTR)
modify_debug_flags(MU_DEBUG_LEVEL_MASK(MU_DEBUG_TRACE9), 0);
+ mu_sieve_set_environ(mach, "location", "MTA");
+ mu_sieve_set_environ(mach, "phase", "pre");
+ s = env_get_macro(env, "client_addr");
+ if (s)
+ mu_sieve_set_environ(mach, "remote-ip", s);
+ s = env_get_macro(env, "client_ptr");
+ if (s)
+ mu_sieve_set_environ(mach, "remote-host", s);
+
mu_sieve_set_data(mach, env);
if (f & MF_SIEVE_TEXT) {

Return to:

Send suggestions and report system problems to the System administrator.