#!/usr/bin/perl # # logpopauth-post # smtp-poplock package by David Harris # use strict; &main; sub main { # log if we have a fileno to write to my $fileno = $ENV{'LOGPOPAUTH_FILENO'}; if ( defined $fileno ) { delete $ENV{'LOGPOPAUTH_FILENO'}; my $ip_addr = $ENV{'TCPREMOTEIP'}; if ( open FH, ">&=$fileno" ) { print FH "qmail-pop3d authenticated host: $ip_addr\n"; close FH; } } # Run our friend exec @ARGV; die "exec failed"; } # NOTE Thu May 20, 1999 David Harris # The perl fdopen command (actually open with ">&=" as expression) causes # the error string ($!) to be set with the error "Invalid seek" on my # Red Hat Linux 6.0 machine with the 2.2.5 kernel. However, everything still # appears to work.