aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-12-20 12:48:16 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-12-20 12:48:16 +0200
commitc2efb9e546db69a6c51532e35831c137d119f5b9 (patch)
treee67810bb8dddb967bd5b3de90229c5523902efea /src
parent6285eff8645b0b368f0f565caf39b656f5d4403e (diff)
downloadmailfromd-c2efb9e546db69a6c51532e35831c137d119f5b9.tar.gz
mailfromd-c2efb9e546db69a6c51532e35831c137d119f5b9.tar.bz2
Improve Sieve interface
* src/builtin/sieve.bi: Initialize Sieve environment * doc/functions.texi: Document changes.
Diffstat (limited to 'src')
-rw-r--r--src/builtin/sieve.bi10
1 files changed, 10 insertions, 0 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,6 +85,7 @@ 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,
@@ -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.