vacation.pl: see email conversation with stevan@bajic.ch and #2835877 (https://sourceforge.net/tracker/?func=detail&aid=2835877&group_id=191583&atid=937964); thanks to stevan for taking the time to explain why he was right :) - this change makes the vacation script look for user#domain@vacation.domain in the alias table, rather than user@domain, which is a better check (as it implies they also have vacation turned on)

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@734 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
David Goodwin 16 years ago
parent 562ab4dc14
commit cd7172dcea

@ -17,7 +17,7 @@
# Slightly better logging which includes messageid
# Avoid infinite loops with domain aliases
#
# 2005-01-19 Troels Arvin <troels@arvin.dk>
# 2005-01-19 Troels Arvin <troels at arvin.dk>
# PostgreSQL-version.
# Normalized DB schema from one vacation table ("vacation")
# to two ("vacation", "vacation_notification"). Uses
@ -27,18 +27,18 @@
# to try to avoid SQL injection.
# International characters are now handled well.
#
# 2005-01-21 Troels Arvin <troels@arvin.dk>
# 2005-01-21 Troels Arvin <troels at arvin.dk>
# Uses the Email::Valid package to avoid sending notices
# to obviously invalid addresses.
#
# 2007-08-15 David Goodwin <david@palepurple.co.uk>
# 2007-08-15 David Goodwin <david at palepurple.co.uk>
# Use the Perl Mail::Sendmail module for sending mail
# Check for headers that start with blank lines (patch from forum)
#
# 2007-08-20 Martin Ambroz <amsys@trustica.cz>
# 2007-08-20 Martin Ambroz <amsys at trustica.cz>
# Added initial Unicode support
#
# 2008-05-09 Fabio Bonelli <fabiobonelli@libero.it>
# 2008-05-09 Fabio Bonelli <fabiobonelli at libero.it>
# Properly handle failed queries to vacation_notification.
# Fixed log reporting.
#
@ -326,10 +326,13 @@ sub find_real_address {
$realemail = $email;
$logger->debug("Found '\$email'\ has vacation active");
} else {
my $vemail = $email;
$vemail =~ s/\@/#/g;
$vemail = $vemail . "\@" . $vacation_domain;
$logger->debug("Looking for alias records that \'$email\' resolves to with vacation turned on");
$query = qq{SELECT goto FROM alias WHERE address=? AND (goto LIKE ? OR goto LIKE ? OR goto LIKE ?)};
$query = qq{SELECT goto FROM alias WHERE address=? AND (goto LIKE ? OR goto LIKE ? OR goto LIKE ? OR goto = ?)};
$stm = $dbh->prepare($query) or panic_prepare($query);
$stm->execute($email,"$email,%","%,$email","%,$email,%") or panic_execute($query,"address='$email'");
$stm->execute($email,"$vemail,%","%,$vemail","%,$vemail,%", "$vemail") or panic_execute($query,"address='$email'");
$rv = $stm->rows;
# Recipient is an alias, check if mailbox has vacation

Loading…
Cancel
Save