> > If it is a listening daemon process you can use the
> readsocket (UNIX
> > or INET sockets):
> >
> > ${readsocket{<name>}{<request>}{<timeout>}{<eol string>}{<fail
> > string>}}
>
> Thanks Herb!
>
> This looks pretty interesting... A daemon might be the way to
> go for this.
> Does this command get expanded to whatever the daemon
> returns?
Yes.
> Is the readsocket command new? I can't find it in
> the docs...
(I am the wrong guy to ask about "new" since I am brand
new to Exim mysefl). Readsocket is in the spec, along
with Readfile, right above the (perl &) Run command reference
I gave you:
http://www.exim.org/exim-html-4.50/doc/html/spec_11.html#IX851
Here's my greylistd that is driven by the DNSBL
(ALL_DNS_BLACKLISTS is defined to thte list of
RBL we wish to check):
defer
message = $sender_host_address is not yet authorized to deliver \
mail from <$sender_address> to <$local_part@$domain>. \
Please try later.
log_message = greylisted.
!senders = :
!authenticated = *
domains = +local_domains : +relay_to_domains
!hosts = : +relay_from_hosts : \
${if exists {/etc/greylistd/whitelist-hosts}\
{/etc/greylistd/whitelist-hosts}{}} : \
${if exists {/var/lib/greylistd/whitelist-hosts}\
{/var/lib/greylistd/whitelist-hosts}{}}
dnslists = ALL_DNS_BLACKLISTS
condition = ${readsocket{/var/run/greylistd/socket}\
{--grey \
${mask:$sender_host_address/24} \
$sender_address \
$local_part@$domain}\
{5s}{}{false}}
Here is one where I use the return value more explicitly;
it checks and sets the SPF status as a header:
warn set acl_c4 = ${if match{${readsocket{/var/run/spfd}\
{ip=$sender_host_address\nhelo=\
$sender_helo_name\nsender=$sender_address\n\n}\
{7s}{ }{socket_error}}\
}{result=(pass|fail|socket_error|softfail|none|\
neutral|error|unknown|(\s*\S+))}{$1}{weird}}
logwrite = :reject: H=$sender_fullhost listed SPF [$acl_c4]
message = X-SPF: $acl_c4
(I changed line breaks, appended \ above to try to avoid
wrap but did not TEST the changes.)
--
Herb Martin
> -----Original Message-----
> From: exim-users-bounces@???
> [mailto:exim-users-bounces@exim.org] On Behalf Of Jim Archer
> Sent: Saturday, August 06, 2005 6:38 PM
> To: Herb Martin; 'Mailinglist EXIM'
> Subject: RE: [exim] Calling my own app from an ACL ???
>
> --On Saturday, August 06, 2005 5:54 PM -0500 Herb Martin
> <HerbM@???> wrote:
>
>
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/
>