From a9f0538bccfc77b5a9cd94bfa3a4549f9cfba350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Sat, 5 Jun 2004 10:06:44 +0000 Subject: [PATCH] Don't keep adding ip addresses to the process status line ($0) when running under PPerl. Include the date and time the session started in the process status line. git-svn-id: https://svn.perl.org/qpsmtpd/trunk@233 958fd67b-6ff1-0310-b445-bb7760255be9 --- Changes | 6 +++++- lib/Qpsmtpd/TcpServer.pm | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 640e8db..0126fdb 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,8 @@ -0.28 +0.28 - 2004/06/05 + + Don't keep adding ip addresses to the process status line ($0) when running under PPerl. + + Include the date and time the session started in the process status line. Added a "queue/maildir" plugin for writing incoming mails to a maildir. diff --git a/lib/Qpsmtpd/TcpServer.pm b/lib/Qpsmtpd/TcpServer.pm index 5fd4420..24b3647 100644 --- a/lib/Qpsmtpd/TcpServer.pm +++ b/lib/Qpsmtpd/TcpServer.pm @@ -5,6 +5,10 @@ use Qpsmtpd::Constants; @ISA = qw(Qpsmtpd::SMTP); use strict; +use POSIX (); + +my $first_0; + sub start_connection { my $self = shift; @@ -20,7 +24,9 @@ sub start_connection { # things. So to be safe, cut them out. $remote_host =~ tr/a-zA-Z\.\-0-9//cd; - $0 = "$0 [$remote_ip : $remote_host]"; + $first_0 = $0 unless $first_0; + my $now = POSIX::strftime("%H:%M:%S %Y-%m-%d", localtime); + $0 = "$first_0 [$remote_ip : $remote_host : $now]"; $self->SUPER::connection->start(remote_info => $remote_info, remote_ip => $remote_ip,