|
|
|
|
@ -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
|
|
|
|
|
|