[Exim] Exim 4.34 environment variable patch

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Eli
日付:  
To: 'Exim-Users \(E-mail\)'
題目: [Exim] Exim 4.34 environment variable patch
I'm not sure how many of you use it or have used it or just like looking at
patches, but my previous patch for Exim 4.30 to add access to environment
variables in Exim has now been updated to patch and compile with Exim 4.34
(I just tried my old patch and it failed a hunk, so...).

The URL is http://www.hoktar.com/downloads/other/env-exim-4.34.patch

This particular patch hasn't seen production use yet since I just made it
(Exim compiles, no segfaulting it seems, so we're good thus far). The patch
for 4.30 has been in production use for some months now and has been working
flawlessly. I have it running on 4 systems of which they all deal with
quite a bit of email daily (one deals with upwards of 30GB worth of traffic
a day (500gb/month) sometimes - all email).

Here's a little excerpt for people to see how to use it (from my config
files):

acl_not_smtp                    = acl_check_pipe


...

acl_check_pipe:
        warn    message         = X-Headers-Begin: $message_id


        warn    message         = X-CGI-Client: $env_REMOTE_ADDR
                condition       = ${if def:env_REMOTE_ADDR {yes}{no}}


        warn    message         = X-CGI-Server: $env_SERVER_NAME
($env_SERVER_ADDR)
                condition       = ${if def:env_SERVER_ADDR {yes}{no}}


        warn    message         = X-CGI-Script: $env_SCRIPT_NAME
($env_SCRIPT_FILENAME)
                condition       = ${if def:env_SCRIPT_NAME {yes}{no}}


        warn    message         = X-Headers-End: $message_id


        accept



As you can see it supports the def:env_VARIABLE calls, as well as direct
refernce via $env_VARIABLE. If you specify a variable that does not exist,
it does not generate an error/warning in your logs, but rather returns NULL,
so this differs from testing variables. I chose this behaviour because you
may not know if the variable exists or not, and you probably don't want it
to fail if it doesn't exist (I know I don't).

Hopefully some of you are using this - and maybe Philip can even add it to
Exim's source maybe? :D

Enjoy,

Eli.