[pmg-devel] SPAM: [PATCH pmg-api 1/1] fix: 2971, to DKIM signing for OOO messages by using postmaster@<domain> as a sender if it is not present.

Nigel van Keulen nigel2392 at gmail.com
Sat May 18 16:58:55 CEST 2024


---
 src/PMG/RuleDB/Accept.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/PMG/RuleDB/Accept.pm b/src/PMG/RuleDB/Accept.pm
index e3e39a7..8a6261f 100644
--- a/src/PMG/RuleDB/Accept.pm
+++ b/src/PMG/RuleDB/Accept.pm
@@ -101,8 +101,16 @@ sub execute {
 	PMG::Utils::remove_marks($entity);
 
 	if ($dkim->{sign}) {
+
+		my $mailSender = $msginfo->{sender};
+		if ($mailSender eq '') {
+			my $mailDomain = $msginfo->{domain};
+			$mailSender = "postmaster\@$mailDomain";
+			syslog('info', "%s: No sender found, using default sender: %s", $queue->{logid}, $mailSender);
+		}
+
 	    eval {
-		$entity = PMG::DKIMSign::sign_entity($entity, $dkim, $msginfo->{sender});
+		$entity = PMG::DKIMSign::sign_entity($entity, $dkim, $mailSender);
 	    };
 	    if ($@) {
 		syslog('warning',
-- 
2.43.0.windows.1




More information about the pmg-devel mailing list