smtpd / qpsmtpd

qpsmtpd is a flexible smtpd daemon written in Perl
http://smtpd.github.io/qpsmtpd/
MIT License
138 stars 75 forks source link

Apply bugfix from debian package: No Received header if received_hook configured #309

Closed wornet-aer closed 1 year ago

wornet-aer commented 1 year ago

While trying to build qpsmtpd 1.00 🎉 🥂 as a ubuntu/debian package, i came across this recent bugfix in the debian package for 0.94-6. As it seems to me, this bug is still present. Maybe someone can verify this?

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933679

I think, we should fix such things directly in the upstream code, instead of applying patches on the packages for specific systems.

Full patch file as reference:

Description: Fix the received_line hook
 When the received_line hook returned a result, the calling method
 returned the new line instead of adding it to the header (see Debian
 bug #933679)
Author: Peter J. Holzer <hjp@hjp.at>
Last-Update: 2023-08-20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: qpsmtpd/lib/Qpsmtpd/SMTP.pm
===================================================================
--- qpsmtpd.orig/lib/Qpsmtpd/SMTP.pm
+++ qpsmtpd/lib/Qpsmtpd/SMTP.pm
@@ -861,7 +861,7 @@ sub received_line {
     my ($rc, @received) =
       $self->run_hooks("received_line", $smtp, $authheader, $sslheader);
     if ($rc == OK) {
-        return join("\n", @received);
+        $header_str = join("\n", @received);
     }
     else {    # assume $rc == DECLINED
         $header_str =