/[smeserver]/rpms/qpsmtpd/sme7/qpsmtpd-0.33-xinetd.patch
ViewVC logotype

Contents of /rpms/qpsmtpd/sme7/qpsmtpd-0.33-xinetd.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu Jun 14 19:18:15 2007 UTC (17 years, 4 months ago) by slords
Branch: MAIN
CVS Tags: qpsmtpd-0_40-1_3_el4_sme, qpsmtpd-0_40-1_0_el4_sme, qpsmtpd-0_40-1_5_el4_sme, qpsmtpd-0_40-1_2_el4_sme, qpsmtpd-0_40-1_7_el4_sme, qpsmtpd-0_40-1_4_el4_sme, qpsmtpd-0_40-1_9_el4_sme, qpsmtpd-0_40-1_6_el4_sme, qpsmtpd-0_40-1_12_el4_sme, qpsmtpd-0_40-1_10_el4_sme, qpsmtpd-0_40-1_11_el4_sme, qpsmtpd-0_40-1_1_el4_sme
Branch point for: qpsmtpd-0_40
Import on branch sme7 of package qpsmtpd-0.40-1.0.el4.sme.src.rpm

1 --- lib/Qpsmtpd/TcpServer.pm.xinetd Wed Oct 4 15:49:49 2006
2 +++ lib/Qpsmtpd/TcpServer.pm Sun Nov 5 16:20:44 2006
3 @@ -1,6 +1,7 @@
4 package Qpsmtpd::TcpServer;
5 use Qpsmtpd::SMTP;
6 use Qpsmtpd::Constants;
7 +use Socket;
8
9 @ISA = qw(Qpsmtpd::SMTP);
10 use strict;
11 @@ -12,12 +13,25 @@
12 sub start_connection {
13 my $self = shift;
14
15 - die "Qpsmtpd::TcpServer must be started by tcpserver\n"
16 - unless $ENV{TCPREMOTEIP};
17 + my ($remote_host, $remote_info, $remote_ip);
18
19 - my $remote_host = $ENV{TCPREMOTEHOST} || ( $ENV{TCPREMOTEIP} ? "[$ENV{TCPREMOTEIP}]" : "[noip!]");
20 - my $remote_info = $ENV{TCPREMOTEINFO} ? "$ENV{TCPREMOTEINFO}\@$remote_host" : $remote_host;
21 - my $remote_ip = $ENV{TCPREMOTEIP};
22 + if ($ENV{TCPREMOTEIP}) {
23 + # started from tcpserver (or some other superserver which
24 + # exports the TCPREMOTE* variables.
25 + $remote_ip = $ENV{TCPREMOTEIP};
26 + $remote_host = $ENV{TCPREMOTEHOST} || "[$remote_ip]";
27 + $remote_info = $ENV{TCPREMOTEINFO} ? "$ENV{TCPREMOTEINFO}\@$remote_host" : $remote_host;
28 + } else {
29 + # Started from inetd or similar.
30 + # get info on the remote host from the socket.
31 + # ignore ident/tap/...
32 + my $hersockaddr = getpeername(STDIN)
33 + or die "getpeername failed: $0 must be called from tcpserver, (x)inetd or a similar program which passes a socket to stdin";
34 + my ($port, $iaddr) = sockaddr_in($hersockaddr);
35 + $remote_ip = inet_ntoa($iaddr);
36 + $remote_host = gethostbyaddr($iaddr, AF_INET) || "[$remote_ip]";
37 + $remote_info = $remote_host;
38 + }
39 $self->log(LOGNOTICE, "Connection from $remote_info [$remote_ip]");
40
41 # if the local dns resolver doesn't filter it out we might get

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed