From ff60b38cf24e0341d249e1c9ebdb7423410029a4 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sat, 14 Jul 2007 18:52:55 +0000 Subject: [PATCH] Added an option to set the date range for which autoreplies are sent --- sendmail/autoreply.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sendmail/autoreply.pl b/sendmail/autoreply.pl index 37defdb4a..839f745d7 100755 --- a/sendmail/autoreply.pl +++ b/sendmail/autoreply.pl @@ -60,6 +60,13 @@ if ($header{'from'} =~ /postmaster|mailer-daemon/i) { exit 0; } +# Check if we are within the requested time range +if ($header{'Autoreply-Start'} && time() < $header{'Autoreply-Start'} || + $header{'Autoreply-End'} && time() > $header{'Autoreply-End'}) { + # Nope .. so do nothing + exit 0; + } + # work out the correct to address @to = ( &split_addresses($header{'to'}), &split_addresses($header{'cc'}),