From bd2f30bdad2929e59ce3a2e0d879281ae532de4a Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 24 Dec 2014 02:40:07 +0000 Subject: [PATCH] Keep data_post hook, and add data_post_headers --- lib/Qpsmtpd/Plugin.pm | 2 +- lib/Qpsmtpd/SMTP.pm | 6 +++--- plugins/dspam | 2 +- plugins/spamassassin | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Qpsmtpd/Plugin.pm b/lib/Qpsmtpd/Plugin.pm index 4c6cdb9..febd4b7 100644 --- a/lib/Qpsmtpd/Plugin.pm +++ b/lib/Qpsmtpd/Plugin.pm @@ -12,7 +12,7 @@ our @hooks = qw( logging config user_config post-fork pre-connection connect ehlo_parse ehlo helo_parse helo auth_parse auth auth-plain auth-login auth-cram-md5 rcpt_parse rcpt_pre rcpt mail_parse mail mail_pre - data data_headers_end data_post data_post_final queue_pre queue queue_post vrfy noop + data data_headers_end data_post_headers data_post queue_pre queue queue_post vrfy noop quit reset_transaction disconnect post-connection unrecognized_command deny ok received_line help ); diff --git a/lib/Qpsmtpd/SMTP.pm b/lib/Qpsmtpd/SMTP.pm index ef533e4..49211fc 100644 --- a/lib/Qpsmtpd/SMTP.pm +++ b/lib/Qpsmtpd/SMTP.pm @@ -781,10 +781,10 @@ sub data_respond { return 1; } - $self->run_hooks("data_post"); + $self->run_hooks("data_post_headers"); $self->authentication_results(); $self->received_line(); - $self->run_hooks("data_post_final"); + $self->run_hooks("data_post"); } sub authentication_results { @@ -889,7 +889,7 @@ sub received_line { $self->transaction->header->add('Received', $header_str, 0); } -sub data_post_final_respond { +sub data_post_respond { my ($self, $rc, $msg, $args) = @_; if ($rc == DONE) { return 1; diff --git a/plugins/dspam b/plugins/dspam index 3ac60ab..295fcdf 100644 --- a/plugins/dspam +++ b/plugins/dspam @@ -220,7 +220,7 @@ sub register { $self->get_dspam_bin() or return DECLINED; - $self->register_hook('data_post_final', 'data_post_handler'); + $self->register_hook('data_post', 'data_post_handler'); } sub get_dspam_bin { diff --git a/plugins/spamassassin b/plugins/spamassassin index f179f04..5d1a0ce 100644 --- a/plugins/spamassassin +++ b/plugins/spamassassin @@ -164,7 +164,7 @@ sub register { $self->{_args}{reject_type} = 'perm'; } - $self->register_hook('data_post_final', 'data_post_handler'); + $self->register_hook('data_post', 'data_post_handler'); } sub data_post_handler {