diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ebe0732..332b98ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,4 +32,4 @@ jobs: perl-version: ${{ matrix.perl }} - run: cpanm --installdeps -n -f . - run: cpanm --installdeps -n -f Mail::SPF Mail::DMARC GeoIP2 ClamAV::Client Redis - - run: prove -lv t \ No newline at end of file + - run: prove -lv t diff --git a/Changes b/Changes index 34db1315..bf6a232d 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,7 @@ + + Remove Apache::Qpsmtpd support + 1.00 Feb 16, 2023 Use readable file test for certificate files (#304) diff --git a/MANIFEST b/MANIFEST index a38bb014..753e87ed 100644 --- a/MANIFEST +++ b/MANIFEST @@ -34,7 +34,6 @@ docs/development.md docs/hooks.md docs/logging.md docs/writing.md -lib/Apache/Qpsmtpd.pm lib/Qpsmtpd.pm lib/Qpsmtpd/Address.pm lib/Qpsmtpd/Auth.pm @@ -105,7 +104,6 @@ plugins/karma plugins/karma_tool plugins/loadcheck plugins/logging/adaptive -plugins/logging/apache plugins/logging/connection_id plugins/logging/devnull plugins/logging/file diff --git a/README.plugins.md b/README.plugins.md index 330dab7f..1ae3ece7 100644 --- a/README.plugins.md +++ b/README.plugins.md @@ -24,9 +24,7 @@ subdirectory, the directory must also be given, like the `virus/clamdscan` in the example below. Alternate plugin directories may be given in the `config/plugin_dirs` config file, one directory per line, these will be searched first before using the builtin fallback -of `plugins/` relative to the qpsmtpd root directory. It may be -necessary, that the `config/plugin_dirs` must be used (if you're using -`Apache::Qpsmtpd`, for example). +of `plugins/` relative to the qpsmtpd root directory. Some plugins may be configured by passing arguments in the `plugins` config file. diff --git a/config.sample/logging b/config.sample/logging index 578467a3..32977d28 100644 --- a/config.sample/logging +++ b/config.sample/logging @@ -10,9 +10,6 @@ logging/warn 6 #logging/adaptive [accept minlevel] [reject maxlevel] [prefix char] #logging/adaptive 4 6 -# send logs to apache (useful if running qpsmtpd under apache) -#logging/apache - # send logs to the great bit bucket #logging/devnull diff --git a/lib/Apache/Qpsmtpd.pm b/lib/Apache/Qpsmtpd.pm deleted file mode 100644 index bd0729c0..00000000 --- a/lib/Apache/Qpsmtpd.pm +++ /dev/null @@ -1,253 +0,0 @@ -package Apache::Qpsmtpd; - -use 5.006001; -use strict; -use warnings FATAL => 'all'; - -use Apache2::ServerUtil (); -use Apache2::Connection (); -use Apache2::Const -compile => qw(OK MODE_GETLINE); -use APR::Const -compile => qw(SO_NONBLOCK EOF SUCCESS); -use APR::Error (); -use APR::Brigade (); -use APR::Bucket (); -use APR::Socket (); -use Apache2::Filter (); -use ModPerl::Util (); - -our $VERSION = '0.02'; - -sub handler { - my Apache2::Connection $c = shift; - $c->client_socket->opt_set(APR::Const::SO_NONBLOCK => 0); - - die "\$ENV{QPSMTPD_CONFIG} must be given" unless $ENV{QPSMTPD_CONFIG}; - - my $qpsmtpd = Qpsmtpd::Apache->new(); - $qpsmtpd->start_connection( - ip => $c->remote_ip, - host => $c->remote_host, - info => undef, - conn => $c, - ); - - $qpsmtpd->run($c); - $qpsmtpd->run_hooks("post-connection"); - $qpsmtpd->connection->reset; - - return Apache2::Const::OK; -} - -package Qpsmtpd::Apache; - -use Qpsmtpd::Constants; -use base qw(Qpsmtpd::SMTP); - -my %cdir_memo; - -sub config_dir { - my ($self, $config) = @_; - if (exists $cdir_memo{$config}) { - return $cdir_memo{$config}; - } - - if (uc($ENV{QPSMTPD_CONFIG}) eq 'USE-VIRTUAL-DOMAINS') { - my $cdir = $self->{conn}->base_server->dir_config("qpsmtpd.config_dir"); - $cdir =~ /^(.*)$/; # detaint - my $configdir = $1 if -e "$1/$config"; - $cdir_memo{$config} = $configdir; - } - else { - shift; - $cdir_memo{$config} = $self->SUPER::config_dir(@_); - } - return $cdir_memo{$config}; -} - -sub start_connection { - my $self = shift; - my %opts = @_; - - $self->{conn} = $opts{conn}; - $self->{conn} - ->client_socket->timeout_set($self->config('timeout') * 1_000_000); - $self->{bb_in} = - APR::Brigade->new($self->{conn}->pool, $self->{conn}->bucket_alloc); - $self->{bb_out} = - APR::Brigade->new($self->{conn}->pool, $self->{conn}->bucket_alloc); - - my $remote_host = $opts{host} || ($opts{ip} ? "[$opts{ip}]" : "[noip!]"); - my $remote_info = $opts{info} ? "$opts{info}\@$remote_host" : $remote_host; - my $remote_ip = $opts{ip}; - - $self->log(LOGNOTICE, "Connection from $remote_info [$remote_ip]"); - - $self->SUPER::connection->start( - remote_info => $remote_info, - remote_ip => $remote_ip, - remote_host => $remote_host, - local_ip => $opts{conn}->local_ip, - @_ - ); -} - -sub config { - my $self = shift; - my ($param, $type) = @_; - if (!$type) { - my $opt = $self->{conn}->base_server->dir_config("qpsmtpd.$param"); - return $opt if defined($opt); - } - return $self->SUPER::config(@_); -} - -sub run { - my $self = shift; - - # should be somewhere in Qpsmtpd.pm and not here... - $self->load_plugins; - - my $rc = $self->start_conversation; - return if $rc != DONE; - - # this should really be the loop and read_input should just - # get one line; I think - $self->read_input(); -} - -sub getline { - my $self = shift; - my $c = $self->{conn} || die "Cannot getline without a conn"; - - return if $c->aborted; - - my $bb = $self->{bb_in}; - - while (1) { - my $rc = - $c->input_filters->get_brigade($bb, Apache2::Const::MODE_GETLINE); - return if $rc == APR::Const::EOF; - die APR::Error::strerror($rc) unless $rc == APR::Const::SUCCESS; - - next unless $bb->flatten(my $data); - - $bb->cleanup; - return $data; - } - - return ''; -} - -sub read_input { - my $self = shift; - my $c = $self->{conn}; - - while (defined(my $data = $self->getline)) { - $data =~ s/\r?\n$//s; # advanced chomp - $self->connection->notes('original_string', $data); - $self->log(LOGDEBUG, "dispatching $data"); - defined $self->dispatch(split / +/, $data, 2) - or $self->respond(502, "command unrecognized: '$data'"); - last if $self->{_quitting}; - } -} - -sub respond { - my ($self, $code, @messages) = @_; - my $c = $self->{conn}; - while (my $msg = shift @messages) { - my $bb = $self->{bb_out}; - my $line = $code . (@messages ? "-" : " ") . $msg; - $self->log(LOGDEBUG, $line); - my $bucket = APR::Bucket->new(($c->bucket_alloc), "$line\r\n"); - $bb->insert_tail($bucket); - $c->output_filters->fflush($bb); - - # $bucket->remove; - $bb->cleanup; - } - return 1; -} - -sub disconnect { - my $self = shift; - $self->SUPER::disconnect(@_); - $self->{_quitting} = 1; - $self->{conn}->client_socket->close(); -} - -1; - -__END__ - -=head1 NAME - -Apache::Qpsmtpd - a mod_perl-2 connection handler for qpsmtpd - -=head1 SYNOPSIS - - Listen 0.0.0.0:25 smtp - AcceptFilter smtp none - ## "smtp" and the AcceptFilter are required for Linux, FreeBSD - ## with apache >= 2.1.5, for others it doesn't hurt. See also - ## http://httpd.apache.org/docs/2.2/mod/core.html#acceptfilter - ## and http://httpd.apache.org/docs/2.2/mod/mpm_common.html#listen - - LoadModule perl_module modules/mod_perl.so - - - use lib qw( /path/to/qpsmtpd/lib ); - use Apache::Qpsmtpd; - $ENV{QPSMTPD_CONFIG} = "/path/to/qpsmtpd/config"; - - - - PerlModule Apache::Qpsmtpd - PerlProcessConnectionHandler Apache::Qpsmtpd - # can specify this in config/plugin_dirs if you wish: - PerlSetVar qpsmtpd.plugin_dirs /path/to/qpsmtpd/plugins - PerlSetVar qpsmtpd.loglevel 4 - - -Using multiple instances of Qpsmtpd on the same server is also -possible by setting: - - $ENV{QPSMTPD_CONFIG} = "USE-VIRTUAL-DOMAINS"; - -Then in the VirtualHost of each config define the configuration -directory: - - PerlSetVar qpsmtpd.config_dir /path/to/qpsmtpd/config - -Several different configurations can be running on the same -server. - -=head1 DESCRIPTION - -This module implements a mod_perl/apache 2.0 connection handler -that turns Apache into an SMTP server using Qpsmtpd. - -It also allows you to set single-valued config options (such -as I, as seen above) using C in F. - -This module should be considered beta software as it is not yet -widely tested. However it is currently the fastest way to run -Qpsmtpd, so if performance is important to you then consider this -module. - -=head1 BUGS - -Probably a few. Make sure you test your plugins carefully. - -The Apache scoreboard (/server-status/) mostly works and shows -connections, but could do with some enhancements specific to SMTP. - -=head1 AUTHOR - -Matt Sergeant, - -Some credit goes to for Apache::SMTP which gave -me the inspiration to do this. added the virtual -host support. - -=cut diff --git a/lib/Qpsmtpd/Base.pm b/lib/Qpsmtpd/Base.pm index 5d3e8faa..4a2da064 100644 --- a/lib/Qpsmtpd/Base.pm +++ b/lib/Qpsmtpd/Base.pm @@ -59,26 +59,6 @@ sub get_resolver { return $self->{_resolver}; } -sub get_async_resolver { - my ( $self, %args ) = @_; - return $self->{_async_resolver} if $self->{_async_resolver}; - - my $async_res; - eval 'use Net::DNS::Async'; - if ($@) { - warn "could not load Net::DNS::Async, is it installed?"; - return; - } - - my $res = Net::DNS::Resolver->new(dnsrch => 0); - $res->tcp_timeout(0); # Net::DNS::Async handles its own timeouts - $res->tcp_timeout(0); - - $self->{_async_resolver} = Net::DNS::Async->new( %args ); - $self->{_async_resolver}{Resolver} = $res; - return $self->{_async_resolver}; -} - sub resolve_a { my ($self, $name) = @_; my $q = $self->get_resolver->query($name, 'A') or return; diff --git a/packaging/rpm/files/README.selinux b/packaging/rpm/files/README.selinux deleted file mode 100644 index 39c015f1..00000000 --- a/packaging/rpm/files/README.selinux +++ /dev/null @@ -1,10 +0,0 @@ -If you run qpsmtpd-apache on a box with SELinux enabled, you'll need to -allow apache to listen to your SMTP port, typically port 25. - -The following command allows apache to listen on port 25: - - semanage port -m -t http_port_t -p tcp 25 - -Use the -d option to remove this permission: - - semanage port -d -t http_port_t -p tcp 25 diff --git a/packaging/rpm/files/qpsmtpd.conf b/packaging/rpm/files/qpsmtpd.conf deleted file mode 100644 index b46ead79..00000000 --- a/packaging/rpm/files/qpsmtpd.conf +++ /dev/null @@ -1,16 +0,0 @@ -Listen 0.0.0.0:25 smtp -AcceptFilter smtp none -## "smtp" and the AcceptFilter are required for Linux, FreeBSD -## with apache >= 2.1.5, for others it doesn't hurt. See also -## http://httpd.apache.org/docs/2.2/mod/core.html#acceptfilter -## and http://httpd.apache.org/docs/2.2/mod/mpm_common.html#listen - - - use Apache::Qpsmtpd; - $ENV{QPSMTPD_CONFIG} = "/etc/qpsmtpd"; - - - - PerlModule Apache::Qpsmtpd - PerlProcessConnectionHandler Apache::Qpsmtpd - diff --git a/packaging/rpm/qpsmtpd.spec.in b/packaging/rpm/qpsmtpd.spec.in deleted file mode 100644 index 60045a2b..00000000 --- a/packaging/rpm/qpsmtpd.spec.in +++ /dev/null @@ -1,345 +0,0 @@ -%{!?_package:%define _package @PACKAGE@} -%{!?_version:%define _version @VERSION@} -%{!?_release:%define _release @RELEASE@} - -Name: %{_package} -Version: %{_version} -Release: %{_release} - -Summary: qpsmtpd + qpsmtpd-apache -License: MIT -Group: System Environment/Daemons -URL: http://smtpd.develooper.com/ -BuildRoot: %{_builddir}/%{name}-%{version}-%{release}-root -BuildRequires: perl >= 0:5.00503 -BuildRequires: perl(ExtUtils::MakeMaker) -BuildArchitectures: noarch -Requires: perl(Mail::Header), perl(Net::DNS) perl(Net::IP) perl(IPC::Shareable) -Requires(pre): coreutils, shadow-utils, perl - -Source0: %{name}-%{version}-%{release}.tar.gz -Source1: qpsmtpd-forkserver.rc -Source2: qpsmtpd-forkserver.sysconfig -Source3: qpsmtpd-xinetd -Source4: in.qpsmtpd -Source5: qpsmtpd.conf -Source6: README.selinux - -%description -qpsmtpd is a flexible smtpd daemon written in Perl. Apart from the core -SMTP features, all functionality is implemented in small "extension -plugins" using the easy to use object oriented plugin API. - -qpsmtpd was originally written as a drop-in qmail-smtpd replacement, but -now it also includes a smtp forward and a postfix "backend". - -%package apache -Requires: perl(mod_perl2) -Summary: mod_perl-2 connection handler for qpsmtpd -Group: System Environment/Daemons - -%package xinetd -Summary: xinetd support for qpsmtpd -Group: System Environment/Daemons -Requires: xinetd - -%description apache - -This module implements a mod_perl/apache 2.0 connection handler -that turns Apache into an SMTP server using Qpsmtpd. - -%description xinetd -This package contains the xinetd startup files for qpsmptd. - -%prep -%setup -q -n %{name}-%{version}-%{release} - -%build -CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLSITELIB=%{_prefix}/lib/perl5/site_perl -make - -%clean -rm -rf $RPM_BUILD_ROOT -%install - -rm -rf $RPM_BUILD_ROOT -eval `perl '-V:installarchlib'` -mkdir -p $RPM_BUILD_ROOT/$installarchlib -if grep -q DESTDIR Makefile ; then - make DESTDIR=$RPM_BUILD_ROOT - find blib/lib -name '*.pm.*' -exec rm -f {} \; - make DESTDIR=$RPM_BUILD_ROOT install -else - make PREFIX=$RPM_BUILD_ROOT/usr - find blib/lib -name '*.pm.*' -exec rm -f {} \; - make PREFIX=$RPM_BUILD_ROOT/usr install -fi -mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name} -rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/plugins/*.* -cp -r plugins ${RPM_BUILD_ROOT}%{_datadir}/%{name}/plugins -mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name} -rm -f ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/*.* -cp -r config.sample/* ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/ -echo %{_datadir}/%{name}/plugins > ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/plugin_dirs -echo %{_localstatedir}/spool/qpsmtpd > ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/spool_dir -mkdir -p ${RPM_BUILD_ROOT}%{_initrddir} -cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_initrddir}/qpsmtpd-forkserver -mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig -cp %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/qpsmtpd-forkserver -mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/spool/qpsmtpd -mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/qpsmtpd -mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/xinetd.d -cp %{SOURCE3} ${RPM_BUILD_ROOT}%{_sysconfdir}/xinetd.d/smtp -mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} -cp %{SOURCE4} ${RPM_BUILD_ROOT}%{_sbindir}/in.qpsmtpd -mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d -cp %{SOURCE5} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d -mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-apache-%{version} -cp %{SOURCE6} $RPM_BUILD_ROOT%{_docdir}/%{name}-apache-%{version} - -[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress - -find ${RPM_BUILD_ROOT}%{_prefix} \( -name perllocal.pod -o -name .packlist \) -exec rm {} \; -find ${RPM_BUILD_ROOT}%{_prefix} -type f -print | \ - sed "s@^$RPM_BUILD_ROOT@@g" | \ - grep -v [Aa]sync | \ - grep -v packaging | \ - grep -v README.selinux | \ - grep -v in\\.qpsmtpd | \ - grep -v /Apache | \ - grep -v /Danga | \ - grep -v Qpsmtpd/PollServer.pm > %{name}-%{version}-%{release}-filelist -if [ "$(cat %{name}-%{version}-%{release}-filelist)X" = "X" ] ; then - echo "ERROR: EMPTY FILE LIST" - exit -1 -fi - -find ${RPM_BUILD_ROOT}%{_prefix} -type f -print | \ - sed "s@^$RPM_BUILD_ROOT@@g" | \ - grep -v [Aa]sync | \ - grep -v packaging | \ - grep -v README.selinux | \ - grep -v /Danga | \ - grep -v Qpsmtpd/PollServer.pm | cat - %{name}-%{version}-%{release}-filelist | sort | uniq -u > %{name}-%{version}-%{release}-apache-filelist -if [ "$(cat %{name}-%{version}-%{release}-apache-filelist)X" = "X" ] ; then - echo "ERROR: EMPTY FILE LIST" - exit -1 -fi - -%files -f %{name}-%{version}-%{release}-filelist -%defattr(-,root,root) -%doc CREDITS Changes LICENSE README.md README.plugins.md STATUS -%{_initrddir}/qpsmtpd-forkserver -%config(noreplace) %{_sysconfdir}/qpsmtpd/* -%config(noreplace) %{_sysconfdir}/sysconfig/qpsmtpd-forkserver -%attr(2750,qpsmtpd,clamav) %dir %{_localstatedir}/spool/qpsmtpd -%attr(0750,smtpd,smtpd) %dir %{_localstatedir}/log/qpsmtpd - -%files apache -f %{name}-%{version}-%{release}-apache-filelist -%defattr(-,root,root) -%config(noreplace) %{_sysconfdir}/httpd/conf.d/* -%doc %{_docdir}/%{name}-apache-%{version}/README.selinux - -%files xinetd -%defattr(-,root,root) -%config(noreplace) %{_sysconfdir}/xinetd.d/smtp -%{_sbindir}/in.qpsmtpd - -%pre -if ! id smtpd >/dev/null 2>&1 ; then - # need to create smtpd user. - if perl -e 'exit ! defined(getgrnam("postdrop"))' ; then - # if postfix is installed, we will probably use - # queue/postfix, which will need this: - supp="-G postdrop" - fi - useradd -r -M -s /bin/false $supp smtpd -fi - -%changelog -* Tue Dec 27 2016 0.96-1 -- Fixed up spec file to build cleanly with 0.96 - -* Fri Oct 14 2011 0.84-1 -- Removed rpm/files/qpsmtpd-plugin-file_connection as there's a -newer version in plugins/logging/file - -* Sat Feb 13 2010 -- Split out xinetd files into separate RPM - -* Sun Jul 12 2009 0.82-0.1 -- Update to latest release -- don't add qpsmtpd to start-up by default -- add apache config file to qpsmtpd-apache package -- remove all patches -- use rpm macros for dirs -- use a filelist for main package instead of a long list of files - -* Tue Jul 15 2008 0.43-0.7 -- Removed SelectServer.pm from .spec file - -* Tue Mar 18 2008 0.43-0.6 -- moved config files back to /etc/qpsmtpd following some changes - to the qpsmtpd src - -* Tue Mar 18 2008 0.43-0.5 -- moved config files to /etc/qpsmtpd/config - -* Tue Mar 18 2008 0.43-0.4 -- Moved qpsmtpd-async to /usr/bin -- Added qpsmtpd-async man page to async package -- Added async smtproute plugin to async package - -* Wed Mar 12 2008 0.43-0.3 -- Makefile.PL now updated in svn, so remove hack - -* Wed Mar 12 2008 0.43-0.2 -- Added qpsmtpd-prefork to qpsmtpd RPM, inc. hack to work round - deficiency in Makefile.PL - -* Mon Mar 10 2008 0.43-0.1 -- Updated to work with Makefile to build from svn - -* Wed Sep 12 2007 0.40-2.0 -- Updated to build trunk-r790 - -* Tue Jun 12 2007 0.40-1.0 -- updated to 0.40 - no code change. - -* Thu Jun 07 2007 0.40-0.2 -- unset environment variables which are normally tainted in perl. -- updated to 0.40rc1 -- added dependency on Net::IP (needed by some plugins) - -* Sat May 05 2007 0.33-0.5 -- moved environment cleanup into start() function, otherwise - LANG just gets reinitialized. - -* Sat May 05 2007 0.33-0.4 -- split qpsmtpd-async into a separate package to avoid dependency - on ParaDNS. - -* Sat May 05 2007 0.33-0.3 -- also unset LANG, LC_ALL and LC_TIME in startup script to prevent - locale specific Received headers (bug reported by Dominik Meyer) - -* Sun Feb 25 2007 0.33-0.2 -- 0.3x branch has been merged back to trunk. - Got current snapshot (r715) from trunk. - -* Sun Feb 25 2007 0.33-0.1 -- Start forkserver via "daemon" (Gavin Carr) -- Fixed 'service qpsmtpd-forkserver status' (Gavin Carr) -- Changed policy for config files to noreplace (Gavin Carr) - -* Sun Nov 05 2006 0.33-0.0 -- Upgraded to current snapshot from 0.3x branch (which should become - 0.33 soon-ish) -- included xinetd-support again. - -* Sat Mar 18 2006 0.32-2 -- fix dnsbl to check whether answer fits query. -- randomize Net::DNS ids for qpsmtpd-forkserver child processes. - -* Wed Mar 08 2006 0.32-1 -- New upstream 0.32 -- rc-file unsets PERL_UNICODE (bug #38397) - -* Sat Jan 28 2006 0.31.1-3 -- Use ${SOURCE*} macros to refer to source files -- Avoid invoking rpm and other cleanup in pre section -- Invoke chkconfig in post. -- (Thanks to Josko Plazonic for the reporting these problems and - suggesting fixes) - -* Wed Nov 30 2005 0.31.1-2 -- Revision 170 of plugins/loggin/file_connection: - Return DECLINED from open_log. - Open log in write_log if it isn't already open. - -* Tue Nov 29 2005 0.31.1-1 -- Commented out queue plugins from sample config -- Added dependencies -- Create smtpd user if it doesn't exist -- Added /var/log/qpsmtpd and /var/spool/qpsmtpd - -* Sat Nov 26 2005 -- Added file_connection plugin -- Startup file for qpsmtpd-forkserver now uses --detach and assumes that - a suitable logging module is configured (file_connection by default) - -* Wed Nov 23 2005 -- Forkserver drops privileges before loading plugins now. - -* Sun Nov 20 2005 -- New upstream 0.31.1 - -* Mon Nov 14 2005 0.31-8 -- New upstream 0.31rc3. -- pre-connection patch slightly simplified since upstream fixed one of - the bugs. - -* Tue Aug 23 2005 -- forced INSTALLSITELIB=/usr/lib/perl5/site_perl as suggested by - Charlie Brady. - -* Sat Aug 20 2005 0.31-7 -- RC2 from upstream. -- Removed patches which aren't applied from spec file. - -* Fri Jul 22 2005 0.31-6 -- New upstream snapshot from 0.31 branch: svn revision 509. - -* Sun Jul 17 2005 0.31-5 -- include only /etc/init.d/qpsmtpd-forkserver, not /etc/init.d - it conflicts with old initscripts packages. - -* Sun Jul 17 2005 0.31-4 -- removed tabs from forkserver - -* Sun Jul 17 2005 0.31-3 -- added startup script for forkserver -- changed BuildArchitectures to noarch. - -* Sat Jul 16 2005 0.31-2 -- pre-connection hook is now actually called, not just defined. - -* Fri Jul 15 2005 0.31-1 -- merged with 0.31. Most of my patches are now in the official release. -- merged Gavin's per-user-config patch with my dirs patch, since the - latter needs a way to turn off logging. -- added /etc/qpsmtpd/plugin_dir to package. - -* Mon Jun 13 2005 0.29-6 -- fixed removal of patch backup files -- fixed option --pid-file - -* Sun Jun 12 2005 -- avoid installing patch backup files -- split Apache::Qpsmtpd into separate package to avoid dependency hell. -- fixed URL -- changed group to Daemons. -- Fixed installation for newer versions of ExtUtils::MakeMaker - -* Wed Jun 1 2005 0.29-5 -- Really don't reap children in signal handler. - -* Tue May 31 2005 0.29-4 -- Return 421 for DENYSOFT_DISCONNECT -- Don't reap children in signal handler. - -* Thu May 19 2005 0.29-3 -- removed code to accept paths without <>. - -* Thu May 19 2005 0.29-2 -- added QPSMTPD_CONFIG env variable and plugin_dir config. -- added supplemental groups and support for pid file -- added shared_connect hook -- changed log level for SMTP dialog from DEBUG to INFO - -* Thu Apr 21 2005 hjp@hjp.at -- added plugins, /etc and docs. - -* Mon Apr 18 2005 hjp@hjp.at -- Specfile autogenerated - diff --git a/plugins/earlytalker b/plugins/earlytalker index 14c5d7f3..cf02c30d 100644 --- a/plugins/earlytalker +++ b/plugins/earlytalker @@ -114,16 +114,9 @@ sub register { } # /end compat - if ($qp->{conn} && $qp->{conn}->isa('Apache2::Connection')) { - require APR::Const; - APR::Const->import(qw(POLLIN SUCCESS)); - $self->register_hook('connect', 'apr_connect_handler'); - $self->register_hook('data', 'apr_data_handler'); - } - else { - $self->register_hook('connect', 'connect_handler'); - $self->register_hook('data', 'data_handler'); - } + $self->register_hook('connect', 'connect_handler'); + $self->register_hook('data', 'data_handler'); + if ($self->{_args}{'defer-reject'}) { $self->register_hook('mail', 'mail_handler') }; diff --git a/plugins/logging/apache b/plugins/logging/apache deleted file mode 100644 index b6099227..00000000 --- a/plugins/logging/apache +++ /dev/null @@ -1,113 +0,0 @@ -#!perl -w - -=head1 NAME - -logging/apache - logging plugin for qpsmtpd which logs to the apache error log - -=cut - -# more POD at the end - -use strict; -use warnings FATAL => 'all'; -use Apache2::Log; -use Apache2::RequestUtil (); - -use Qpsmtpd::Constants; - -sub register { - my ($self, $qp) = @_; - - die "Not running under Apache::Qpsmtpd" - unless ($qp->{conn} && $qp->{conn}->isa('Apache2::Connection')); - - my $rr = Apache2::RequestRec->new($self->qp->{conn}); - $self->{_log} = $rr->log - if $rr; - - $self->log(LOGINFO, 'Initializing logging::apache plugin'); -} - -sub hook_logging { - my ($self, $transaction, $trace, $hook, $plugin, @log) = @_; - - # Don't log your own log entries! If this is the only logging plugin - # then these lines will not be logged at all. You can safely comment - # out this line and it will not cause an infinite loop. - return DECLINED if defined $plugin and $plugin eq $self->plugin_name; - - unless ($self->{_log}) { - my $rr = Apache2::RequestRec->new($self->qp->{conn}); - unless ($rr) { - warn "no Apache2::RequestRec?... logmsg was: ", join(" ", @log); - return DECLINED; - } - $self->{_log} = $rr->log; - } - - # luckily apache uses the same log levels as qpsmtpd... - ($trace = lc Qpsmtpd::Constants::log_level($trace)) =~ s/^log//; - $trace = 'emerg' # ... well, nearly... - if $trace eq 'radar'; - - my $log = $self->{_log}; - unless ($log->can($trace)) { # ... but you never know if it changes - $log->emerg("Can't log with level '$trace', logmsg was: ", - join(" ", @log)); - return DECLINED; - } - - $log->$trace( - join( - " ", - $$ - . ( - defined $plugin ? " $plugin plugin:" - : defined $hook ? " running plugin ($hook):" - : "" - ), - @log - ) - ); # no \n at the end! - - return DECLINED; -} - -=head1 DESCRIPTION - -The logging/apache plugin uses the apache logging mechanism to write its -messages to the apache error log. - -=head1 INSTALL AND CONFIG - -Place this plugin in the plugin/logging directory beneath the standard -qpsmtpd installation. Edit the config/logging file and add a line like -this: - - logging/apache - -To change what is shown in the logs, change the I directive in -the virtual host config for Qpsmtpd and maybe change the I log -file: - - - PerlSetVar QpsmtpdDir /path/to/qpsmtpd - PerlModule Apache::Qpsmtpd - PerlProcessConnectionHandler Apache::Qpsmtpd - LogLevel debug - ErrorLog /var/log/apache2/qpsmtpd.log - - -=head1 AUTHOR - -Hanno Hecker - -=head1 COPYRIGHT AND LICENSE - -Copyright (c) 2007 Hanno Hecker - -This plugin is licensed under the same terms as the qpsmtpd package itself. -Please see the LICENSE file included with qpsmtpd for details. - -=cut - diff --git a/t/qpsmtpd-base.t b/t/qpsmtpd-base.t index 20f5148e..2d443024 100644 --- a/t/qpsmtpd-base.t +++ b/t/qpsmtpd-base.t @@ -17,7 +17,6 @@ __tildeexp(); __is_localhost(); __is_valid_ip(); __get_resolver(); -__get_async_resolver(); __resolve_a(); __resolve_aaaa(); __resolve_mx(); @@ -63,14 +62,6 @@ sub __get_resolver { } -sub __get_async_resolver { - eval 'use Net::DNS::Async'; - return if ($@); - my $res = $base->get_async_resolver() or return; - isa_ok( $res, 'Net::DNS::Async', "resolver object, $res"); - isa_ok( $res->{Resolver}, 'Net::DNS::Resolver', "resolver object, $res"); -} - sub __resolve_a { my @r = $base->resolve_a('simerson.net'); ok(@r, "resolve_a: " . join(',', @r));