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 DBI;
|
||||||
use POSIX qw(strftime);
|
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
|
# -l = logging of virtual vacation parsed report/filter streams and decisions
|
||||||
# -v = verbose (extra flag) logging of report stream
|
# -v = verbose (extra flag) logging of report stream
|
||||||
# -d = debug (extra flag) logging of filter stream
|
# -d = debug (extra flag) logging of filter stream
|
||||||
@ -35,8 +35,8 @@ my $db_user = '';
|
|||||||
my $db_pass = '';
|
my $db_pass = '';
|
||||||
my $db_name = '';
|
my $db_name = '';
|
||||||
|
|
||||||
if ($opt_c && -e $opt_c) {
|
if ($opt_c && -e "/etc/mail/$opt_c") {
|
||||||
open (my $fh_config, '<', $opt_c);
|
open (my $fh_config, '<', "/etc/mail/$opt_c");
|
||||||
while (my $line = <$fh_config>) {
|
while (my $line = <$fh_config>) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
if ($line =~ /^host\s+(.*)$/) { $db_host = $1; }
|
if ($line =~ /^host\s+(.*)$/) { $db_host = $1; }
|
||||||
@ -112,22 +112,17 @@ while (my $line = <>) {
|
|||||||
dolog($fh, "$sid to: $email, from: $from", $opt_l);
|
dolog($fh, "$sid to: $email, from: $from", $opt_l);
|
||||||
$selvacation->bind_param(1, $email);
|
$selvacation->bind_param(1, $email);
|
||||||
$selvacation->execute;
|
$selvacation->execute;
|
||||||
|
|
||||||
if ($selvacation->rows == 1) {
|
if ($selvacation->rows == 1) {
|
||||||
dolog($fh, "$sid found OOO for $email", $opt_l);
|
dolog($fh, "$sid found OOO for $email", $opt_l);
|
||||||
my @vacation_msg = $selvacation->fetchrow_array;
|
my @vacation_msg = $selvacation->fetchrow_array;
|
||||||
|
|
||||||
$selcache->bind_param(1, $email);
|
$selcache->bind_param(1, $email);
|
||||||
$selcache->bind_param(2, $from);
|
$selcache->bind_param(2, $from);
|
||||||
$selcache->execute;
|
$selcache->execute;
|
||||||
|
|
||||||
if ($selcache->rows == 0) {
|
if ($selcache->rows == 0) {
|
||||||
dolog($fh, "$sid sending OOO to $from", $opt_l);
|
dolog($fh, "$sid sending OOO to $from", $opt_l);
|
||||||
|
|
||||||
$upcache->bind_param(1, $from);
|
$upcache->bind_param(1, $from);
|
||||||
$upcache->bind_param(2, $email);
|
$upcache->bind_param(2, $email);
|
||||||
$upcache->execute;
|
$upcache->execute;
|
||||||
|
|
||||||
open my $fh_email, "|-", "/usr/sbin/sendmail -t";
|
open my $fh_email, "|-", "/usr/sbin/sendmail -t";
|
||||||
print $fh_email "From: $email\n";
|
print $fh_email "From: $email\n";
|
||||||
print $fh_email "To: $from\n";;
|
print $fh_email "To: $from\n";;
|
||||||
|
Loading…
Reference in New Issue
Block a user