qpsmtpd/qpsmtpd

37 lines
997 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/perl -Tw
2010-04-08 07:30:30 +02:00
# Copyright (c) 2001-2010 Ask Bjoern Hansen. See the LICENSE file for details.
2009-04-03 08:34:12 +02:00
# The "command dispatch" system was taken from colobus - http://trainedmonkey.com/colobus/
2001-10-30 03:04:56 +01:00
#
# this is designed to be run under tcpserver (http://cr.yp.to/ucspi-tcp.html)
2001-10-30 03:04:56 +01:00
# or inetd if you're into that sort of thing
#
# For more information see http://smtpd.github.io/qpsmtpd/
2001-10-30 03:04:56 +01:00
#
use lib 'lib';
use Qpsmtpd::TcpServer;
2001-10-30 03:04:56 +01:00
use strict;
$| = 1;
delete $ENV{ENV};
$ENV{PATH} = '/bin:/usr/bin:/var/qmail/bin';
my $qpsmtpd = Qpsmtpd::TcpServer->new();
$qpsmtpd->load_plugins();
$qpsmtpd->start_connection();
2013-04-21 06:34:07 +02:00
$qpsmtpd->run(\*STDIN); # pass the "socket" like -prefork/-forkserver
$qpsmtpd->run_hooks("post-connection");
$qpsmtpd->connection->reset;
2001-10-30 03:04:56 +01:00
2013-04-21 06:34:07 +02:00
# needed for Qpsmtpd::TcpServer::check_socket():
# emulate IO::Socket::connected on STDIN. STDIN was used instead of STDOUT
# because the other code also calls getpeername(STDIN).
sub IO::Handle::connected { return getpeername(shift) }
__END__
2001-10-30 03:04:56 +01:00
2001-10-30 03:04:56 +01:00
1;