2008-05-17 05:54:24 +02:00
|
|
|
#!/usr/bin/perl -Tw
|
2001-10-30 03:04:56 +01:00
|
|
|
# Copyright (c) 2001 Ask Bjoern Hansen. See the LICENSE file for details.
|
|
|
|
# The "command dispatch" system is taken from colobus - http://trainedmonkey.com/colobus/
|
|
|
|
#
|
2002-01-22 04:53:48 +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://develooper.com/code/qpsmtpd/
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2002-07-03 15:10:44 +02:00
|
|
|
use lib 'lib';
|
|
|
|
use Qpsmtpd::TcpServer;
|
2001-10-30 03:04:56 +01:00
|
|
|
use strict;
|
|
|
|
$| = 1;
|
|
|
|
|
2002-01-21 15:24:32 +01:00
|
|
|
delete $ENV{ENV};
|
2003-04-15 19:50:22 +02:00
|
|
|
$ENV{PATH} = '/bin:/usr/bin:/var/qmail/bin';
|
2002-01-21 15:24:32 +01:00
|
|
|
|
2002-07-03 15:10:44 +02:00
|
|
|
my $qpsmtpd = Qpsmtpd::TcpServer->new();
|
2005-09-23 21:16:37 +02:00
|
|
|
$qpsmtpd->load_plugins();
|
2002-07-03 15:10:44 +02:00
|
|
|
$qpsmtpd->start_connection();
|
2008-12-31 08:29:14 +01:00
|
|
|
$qpsmtpd->run(\*STDIN); # pass the "socket" like -prefork/-forkserver
|
2007-03-03 11:50:45 +01:00
|
|
|
$qpsmtpd->run_hooks("post-connection");
|
2008-05-09 19:40:31 +02:00
|
|
|
$qpsmtpd->connection->reset;
|
2001-10-30 03:04:56 +01:00
|
|
|
|
2008-12-31 08:29:14 +01: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) }
|
|
|
|
|
2002-07-03 15:10:44 +02:00
|
|
|
__END__
|
2001-10-30 03:04:56 +01:00
|
|
|
|
|
|
|
|
2001-10-31 01:11:29 +01:00
|
|
|
|
2001-10-30 03:04:56 +01:00
|
|
|
|
|
|
|
1;
|