Update vacation.pl: -c wording change and remove some LF/CR
This commit is contained in:
parent
6253537e39
commit
5c0734b7ab
@ -22,7 +22,7 @@ use Getopt::Std;
|
||||
use DBI;
|
||||
use POSIX qw(strftime);
|
||||
|
||||
# -c = location of the SQL config file for OpenSMTPD
|
||||
# -c = name SQL config file for OpenSMTPD, located in /etc/mail
|
||||
# -l = logging of virtual vacation parsed report/filter streams and decisions
|
||||
# -v = verbose (extra flag) logging of report stream
|
||||
# -d = debug (extra flag) logging of filter stream
|
||||
@ -35,8 +35,8 @@ my $db_user = '';
|
||||
my $db_pass = '';
|
||||
my $db_name = '';
|
||||
|
||||
if ($opt_c && -e $opt_c) {
|
||||
open (my $fh_config, '<', $opt_c);
|
||||
if ($opt_c && -e "/etc/mail/$opt_c") {
|
||||
open (my $fh_config, '<', "/etc/mail/$opt_c");
|
||||
while (my $line = <$fh_config>) {
|
||||
chomp $line;
|
||||
if ($line =~ /^host\s+(.*)$/) { $db_host = $1; }
|
||||
@ -112,22 +112,17 @@ while (my $line = <>) {
|
||||
dolog($fh, "$sid to: $email, from: $from", $opt_l);
|
||||
$selvacation->bind_param(1, $email);
|
||||
$selvacation->execute;
|
||||
|
||||
if ($selvacation->rows == 1) {
|
||||
dolog($fh, "$sid found OOO for $email", $opt_l);
|
||||
my @vacation_msg = $selvacation->fetchrow_array;
|
||||
|
||||
$selcache->bind_param(1, $email);
|
||||
$selcache->bind_param(2, $from);
|
||||
$selcache->execute;
|
||||
|
||||
if ($selcache->rows == 0) {
|
||||
dolog($fh, "$sid sending OOO to $from", $opt_l);
|
||||
|
||||
$upcache->bind_param(1, $from);
|
||||
$upcache->bind_param(2, $email);
|
||||
$upcache->execute;
|
||||
|
||||
open my $fh_email, "|-", "/usr/sbin/sendmail -t";
|
||||
print $fh_email "From: $email\n";
|
||||
print $fh_email "To: $from\n";;
|
||||
|
Loading…
Reference in New Issue
Block a user