Re: [exim] greylisting and VERP's

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Chris Webb
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] greylisting and VERP's
Steffen Heil <lists@???> writes:

> Would you mind to share that?


I'm definitely planning on packaged it up and releasing it for others to use
once I'm happy with it.

> I got some experience with bdb recently, but I have non with unix domain
> sockets.


Exim's readsocket makes this especially convenient and easy. You can just do
something like this in Perl:

  use Socket;
  [...]
  unlink($socketpath) or die "unlink: $!";
  socket(SERVER, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
  bind(SERVER, sockaddr_un($socketpath)) or die "bind: $!";
  $SIG{PIPE} = 'IGNORE';
  listen(SERVER, SOMAXCONN);
  while (accept(CLIENT, SERVER)) {
    sysread CLIENT, $query, 16384;
    [...]
    syswrite CLIENT, $response;
    close CLIENT;
  }


and then from Exim's string expansion mechanism, you can pass in a query to
expand to a response: ${readsocket{SOCKETPATH}{request string}}. (Test with
exim -be.)

Because this simple-minded server is inherently serialized, there are no
locking issues or race conditions to worry about, which might be a concern
if you use an embedded perl interpreter to achieve the same effect.

Best wishes,

Chris.