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

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Phil Pennock
Datum:  
To: exim-users
Betreff: Re: [exim] Vary weird problem - unable to set uid=12
On 2009-03-29 at 18:40 -0700, 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.


You already have a program listening on a socket for Exim to talk to.

> 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 have a listening socket; it's a TCP socket, on listdata.ctyme.com
port 107.

${readsocket{inet:listdata.ctyme.com:107}{uribl $acl_c_badlink\n}{2s}}

The key points are:

* there's no response from the server after you finish sending, so Exim
will expand the ${readsocket...} to the empty string
* echo was supplying a newline, which you'll need to supply yourself
(as I showed above)
* carefully read The Exim Specification on ${readsocket} to look at the
options for error-handling to decide what you want to do

Regards,
-Phil