Multiline headers - patch from David White <davidw53@users.sourceforge.net>

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@16 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
Greg 18 years ago
parent cecbdd1660
commit b1e8f75daa

@ -27,16 +27,16 @@ use strict;
use Sys::Syslog; use Sys::Syslog;
$db_type = 'mysql'; my $db_type = 'mysql';
$db_host = 'localhost'; my $db_host = 'localhost';
$db_user = 'postfixadmin'; my $db_user = 'postfixadmin';
$db_pass = 'postfixadmin'; my $db_pass = 'postfixadmin';
$db_name = 'postfix'; my $db_name = 'postfix';
$sendmail = "/usr/sbin/sendmail"; my $sendmail = "/usr/sbin/sendmail";
$logfile = ""; # specify a file name here for example: vacation.log my $logfile = ""; # specify a file name here for example: vacation.log
$debugfile = ""; # specify a file name here for example: vacation.debug my $debugfile = ""; # specify a file name here for example: vacation.debug
$syslog = 0; # 1 if log entries should be sent to syslog my $syslog = 0; # 1 if log entries should be sent to syslog
$logger = "/usr/bin/logger"; my $logger = "/usr/bin/logger";
# Alternatively, you can put the variables above in a # Alternatively, you can put the variables above in a
# config file that is readable by the vacation user. # config file that is readable by the vacation user.
@ -209,16 +209,21 @@ sub send_vacation_email {
########################### main ################################# ########################### main #################################
my ($from, $to, $cc, $subject, $messageid); my ($from, $to, $cc, $subject, $messageid, $lastheader);
# Take headers apart # Take headers apart
while (<STDIN>) { while (<STDIN>) {
last if (/^$/); last if (/^$/);
if (/^from:\s+(.*)\n$/i) { $from = $1; }
if (/^to:\s+(.*)\n$/i) { $to = $1; } if (/^\s+(.*)/) {
if (/^cc:\s+(.*)\n$/i) { $cc = $1; } if( $lastheader) { $$lastheader .= " $1"; }
if (/^subject:\s+(.*)\n$/i) { $subject = $1; } } else { undef $lastheader; }
if (/^message-id:\s+(.*)\n$/i) { $messageid = $1; } if (/^from:\s+(.*)\n$/i) { $from = $1; $lastheader = \$from; }
if (/^to:\s+(.*)\n$/i) { $to = $1; $lastheader = \$to; }
if (/^cc:\s+(.*)\n$/i) { $cc = $1; $lastheader = \$cc; }
if (/^subject:\s+(.*)\n$/i) { $subject = $1; $lastheader = \$subject; }
if (/^message-id:\s+(.*)\n$/i) { $messageid = $1; $lastheader = \$messageid; }
if (/^precedence:\s+(bulk|list|junk)/i) { exit (0); } if (/^precedence:\s+(bulk|list|junk)/i) { exit (0); }
if (/^x-loop:\s+postfix\ admin\ virtual\ vacation/i) { exit (0); } if (/^x-loop:\s+postfix\ admin\ virtual\ vacation/i) { exit (0); }
} }

Loading…
Cancel
Save