[exim] local_scan expand_string

Top Page
Delete this message
Reply to this message
Author: Roland Roberts
Date:  
To: exim-users
Subject: [exim] local_scan expand_string
I'm having trouble figuring out how to make this work....

For context, I'm trying to modify sa-exim.c to allow another argument
which is the user to use with the spamc -u switch. This is to support a
client who wants to enable teergrubing and have per-virtual-domain
spamassassin preferences. The teergrubing requires (I believe) that I
use the sa-exim local_scan function, but the per-virtual-domain
preferences requires that I be able to pass in a user to spamc.

I've added a new configuration option, SAspamcuser that looks like this:

    SAspamcuser: ${lookup{$domain}lsearch*{/etc/virtualdomain}{$value}}


and code inside sa-exim.c that looks like this:

    M_CHECKFORSTR(SAspamcuser);


    if (SAspamcuser) {
        char *expand = expand_string(SAspamcuser);
        if (expand == NULL)
        {
            PANIC(string_sprintf("SAspamcuser expansion failure on %s", SAspamcuser));
        }


        if (SAEximDebug)
        {
            log_write(0, LOG_MAIN, "SA: Debug: SAspamcuser expand returned: '%s'", expand);
        }
    }


and turn on debug. The log shows

    2006-05-25 20:18:02 1FjQ1h-0005fq-R7 SA: Debug: SAspamcuser expand returned: ''


What I believe is happening is that $domain is not yet set when
local_scan is being called.

Which begs the question, can I really do what I've been asked to do?

regards,

roland
-- 
                       PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises
roland@???                            6818 Madeline Court
roland@???                           Brooklyn, NY 11220