Re: [exim] Vary weird problem - unable to set uid=12

Top Page
Delete this message
Reply to this message
Author: Ted Cooper
Date:  
To: exim-users
Subject: Re: [exim] Vary weird problem - unable to set uid=12
Marc Perkel wrote:
> Yeah - I think I get how to talk to a socket in Exim if there's
> something to talk to. Not being much of a programmer and barely
> understanding some of this I don't know how to create a program to do
> what I want and make it listen on a socket for exim to talk to. And
> probably what I want to do is dirt simple.
>
> One of the things I do is generate black lists and white lists and a ton
> of other lists. I have several exim servers as spam filters and when
> certian conditions happen I want to report the event by sending a line
> of text to a central listening server that accepts the line and appends
> it to a text file. I then have processes (cron) that go through these
> files and generate rbldns files for my various lists.
>
> In the listening side I'm running socat.
>
> socat -u TCP4-LISTEN:107,reuseaddr,fork OPEN:/data/info.log,creat,append
>
> On the sending side I'm running a shell script with the exim run command.
>
> set acl_c_run = ${run{/etc/exim/info/info-report uribl $acl_c_badlink}}
>
> The info-report script is simple.
>
> echo "$*" | nc -w 2 listdata.ctyme.com 107
> exit 0
>
> So what I need to do is replace my scripts that use run and nc (netcat)
> with a listening socket that does the same thing. I'll bet that socat
> probably could do that. But I don't know how. It would make it a lot
> faster because I'm running this several times for each message and I'm
> sure it's not efficient. Probably causing Linux to melt down.



You shouldn't need to touch the socat part - it's the server side,
already listens on a socket and will continue to do what it does.

Socket might be confusing as it is a programming term for the memory
structure resulting from accessing an interface:port pair. Once opened,
all calls talk to the socket structure rather than a host or port.

On the exim side just change the ${run} to -

set acl_c_whatever = ${readsocket{inet:central:107}{$acl_c_badlink}{
}{20s}{SOCKERR}}
OR
continue = as above