Re: [exim] Using ${run ...} to execute external command, de…

Top Page
Delete this message
Reply to this message
Author: Dan_Mitton
Date:  
To: Morten W. Petersen
CC: exim-users @ exim. org
Subject: Re: [exim] Using ${run ...} to execute external command, dealing with result, Exim syntax
Morten,

I'm assuming that something is invoking 'greylist_acl'. ACLs are not like
routers where they get tried top down. Something must invoke it.

acl_m8 will get set to the STDOUT & SDTERR from your script (which might
include <CR><LF>). Remember, that there is no shell !!

Yes, $runrc is the return code from the run command. You might want to
try logging it too.

Also, try putting a couple of log_message lines before and after your
$run, just to make sure your even getting there.

Dan



Sent by:        exim-users-bounces@???
To:     "exim-users @ exim. org" <exim-users@???>
cc:      (bcc: Dan Mitton/YD/RWDOE)
Subject:        [exim] Using ${run ...} to execute external command, 
dealing with result, Exim syntax
LSN: Not Relevant
User Filed as: Not a Record


Hi,

I'm trying to use an external python script to verify that a remote SMTP
host
can accept a recipient. Using Exim's callout didn't work (getting too
many
write lock issues).

The configuration looks like this:

[...]
begin acl

greylist_acl:
    warn set acl_m8 = ${run{/opt/nidelven/do_remote_callout.py 
$local_part $domain $sender_address $sender_host_address 
$sender_helo_name}{$value}{error}}
        log_message = greylisting ACL result: $acl_m8
    accept
        condition = ${if eq{$acl_m8}{greylist}{1}}
    deny
[...]


However, I don't see any entries in the log, so it doesn't look like the
command
or the logging is being run. Am I missing something to get logging
working?

What is the right way to access the result of the command? Is that
stored in
acl_m8? Does $runrc represent the exit value of the command?

What's the right syntax for checking the exit value against 0, 1 etc?

Thanks,

Morten

--
Morten W. Petersen
Manager
Nidelven IT Ltd

Phone: +47 45 44 00 69
Email: morten@???


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/