From befc18154fb1ce60c8dc4aa7aeed84dce95e7817 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 2 Jun 2020 12:56:18 +0100 Subject: [PATCH] see: https://github.com/postfixadmin/postfixadmin/commit/86852b3dbdbc8b9a3923d5186d2f32f630328ccf#r39604078 - fix MX lookup --- VIRTUAL_VACATION/vacation.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/VIRTUAL_VACATION/vacation.pl b/VIRTUAL_VACATION/vacation.pl index 293bc95e..62b7e061 100644 --- a/VIRTUAL_VACATION/vacation.pl +++ b/VIRTUAL_VACATION/vacation.pl @@ -440,7 +440,7 @@ sub send_vacation_email { $logger->debug("Will send vacation response for $orig_messageid: FROM: $email (orig_to: $orig_to), TO: $orig_from; VACATION SUBJECT: $row[0] ; VACATION BODY: $row[1]"); my $subject = $row[0]; - $subject = Encode::decode_utf8( $subject ) if( !Encode::is_utf8( $subject ) ); + $subject = Encode::decode_utf8( $subject ) if( !Encode::is_utf8( $subject ) ); $orig_subject = decode("mime-header", $orig_subject); $subject =~ s/\$SUBJECT/$orig_subject/g; if ($subject ne $row[0]) { @@ -448,12 +448,13 @@ sub send_vacation_email { } my $body = $row[1]; - $body = Encode::decode_utf8( $body ) if( !Encode::is_utf8( $body ) ); + $body = Encode::decode_utf8( $body ) if( !Encode::is_utf8( $body ) ); + my $from = $email; my $to = $orig_from; # part of the username in the email && part of the domain in the email - my ($email_username_part, $email_domain_part) = split(/@/, $email); + my ($email_username_part, $email_domain_part) = split(/@/, $orig_from); my $resolver = Net::DNS::Resolver->new; my @mx = mx($resolver, $email_domain_part);