diff --git a/VIRTUAL_VACATION/vacation.pl b/VIRTUAL_VACATION/vacation.pl index ee7a9267..a53fadc4 100644 --- a/VIRTUAL_VACATION/vacation.pl +++ b/VIRTUAL_VACATION/vacation.pl @@ -71,7 +71,7 @@ #  Add configuration parameter $smtp_client in order to get mails through # postfix helo-checks, using check_helo_access whitelist without permitting 'localhost' default style stuff # -# 2012-04-19 Jan Kruis +# 2012-04-19 Jan Kruis # change SQL query for vacation into function. # Add sub get_interval() # Gives the user the option to set the interval time ( 0 = one reply, 1 = autoreply, > 1 = Delay reply ) @@ -304,8 +304,8 @@ sub already_notified { } $stm->execute($to,$from); - my $query = qq{INSERT into vacation_notification (on_vacation,notified) values (?,?)}; - my $stm = $dbh->prepare($query); + $query = qq{INSERT into vacation_notification (on_vacation,notified) values (?,?)}; + $stm = $dbh->prepare($query); if (!$stm) { $logger->error("Could not prepare query '$query' to: $to, from:$from"); return 1; diff --git a/config.inc.php b/config.inc.php index c73550e0..867c7e2b 100644 --- a/config.inc.php +++ b/config.inc.php @@ -299,12 +299,17 @@ $CONF['transport_options'] = array ( // You should define default transport. It must be in array above. $CONF['transport_default'] = 'virtual'; -$CONF['usercontol'] = 'YES'; -// Virtual Vacation +// +// +// Virtual Vacation Stuff +// +// + // If you want to use virtual vacation for you mailbox users set this to 'YES'. // NOTE: Make sure that you install the vacation module. (See VIRTUAL-VACATION/) $CONF['vacation'] = 'NO'; + // This is the autoreply domain that you will need to set in your Postfix // transport maps to handle virtual vacations. It does not need to be a // real domain (i.e. you don't need to setup DNS for it). @@ -318,23 +323,53 @@ $CONF['vacation_control'] ='YES'; // Set to 'YES' if your domain admins should be able to edit user vacation. $CONF['vacation_control_admin'] = 'YES'; -// Get the user ofr Admin a chioce of reply -$CONF['choice_of_reply'] = array ( - 'One Reply', // Only Reply ones on a email - 'Auto Reply', // Only Reply to this Sender if last email from this sender - 'Interval Reply' // same as above but delay time is +// Alllow ReplyType Control +// This varible will be checked in ./templates/vacation.tpl +// YES means it show the reply option, everything else means it will not show +$CONF['vacation_replytype_control'] = 'YES'; + +// AllowUser Reply +// You can Allow or Disable User control over Reply Type +// This variable will be checked in ./templates/vacation.tpl +// YES means it show the reply option, anything else means it will not show +$CONF['vacation_allow_user_reply'] = 'YES'; + +// ReplyType options +// If you want to define additional reply options put them in array below. +$CONF['vacation_choice_of_reply'] = array ( + 'One Reply', // Sends only Once the message during Out of Office + 'Auto Reply', // Reply on every email but not within autoreplydelay + 'Interval Reply' // Reply on every email but not within intervaldelay_default ); -$CONF['replytype_default'] = 'One Reply'; -$CONF['autoreplydelay_default'] = '10'; // Send no email if last email was send within 10 sec. -$CONF['intervaldelay_default'] = '3600'; // Send only a reply to a email if the last 1 hour ago. +// ReplyType default +// You should define default replytype. It must be in array above. +$CONF['vacation_replytype_default'] = 'One Reply'; + +// autoreplydelay +// You should define autodefaultdelay is seconds +// if a new message comes in within this delay it most likely that that the sender is +// autoreplying on our autoreply message. +$CONF['vacation_autoreplydelay_default'] = '10'; + +// Replydelay default +// You should define default replydelay time here time in in seconds. +$CONF['vacation_intervaldelay_default'] = '86400'; // is 1 day = 60 sec * 60 min * 24 hours + +// +// End Vacation Stuff. +// // Users Control for Domain Admin -// Set to "Yes" if your doamain admins schould be able to edit field userscontrole in table domain +// Set to "Yes" if your domain admins schould be able to edit field userscontrole in table domain // Userscontrol is edited in admin_create-domain.tpl and admin_edit-domain.tpl // Userscontrol is default set to on when creating a domain $CONF['users_domain_controle'] = 'YES'; + +$CONF['usercontol'] = 'YES'; + + // Alias Control // Postfix Admin inserts an alias in the alias table for every mailbox it creates. // The reason for this is that when you want catch-all and normal mailboxes diff --git a/vacation.php b/vacation.php index cc54393c..ad816736 100644 --- a/vacation.php +++ b/vacation.php @@ -98,11 +98,11 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") { if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); } if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); } - if ($tReply_Type =='') { $tReply_Type = $CONF['replytype_default'];} + if ($tReply_Type =='') { $tReply_Type = $CONF['vacation_replytype_default'];} if ($tReply_Type =='One Reply') { $tInterval_Time = '0';} - if ($tReply_Type =='Auto Reply') { $tInterval_Time = $CONF['autoreplydelay_default'];} - if (($tReply_Type =='Interval Reply') and ($tInterval_Time =='')) { $tInterval_Time = $CONF['intervaldelay_default'];} - if (($tReply_Type =='Interval Reply') and ($tInterval_Time <= $CONF['autoreplydelay_default'])) { $tInterval_Time = $CONF['intervaldelay_default'];} + if ($tReply_Type =='Auto Reply') { $tInterval_Time = $CONF['vacation_autoreplydelay_default'];} + if (($tReply_Type =='Interval Reply') and ($tInterval_Time =='')) { $tInterval_Time = $CONF['vacation_intervaldelay_default'];} + if (($tReply_Type =='Interval Reply') and ($tInterval_Time <= $CONF['vacation_autoreplydelay_default'])) { $tInterval_Time = $CONF['vacation_intervaldelay_default'];} } @@ -132,11 +132,11 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") //set a default, reset fields for coming back selection if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); } if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); } - if ($tReply_Type =='') { $tReply_Type = $CONF['replytype_default'];} + if ($tReply_Type =='') { $tReply_Type = $CONF['vacation_replytype_default'];} if ($tReply_Type =='One Reply') { $tInterval_Time = '0';} - if ($tReply_Type =='Auto Reply') { $tInterval_Time = $CONF['autoreplydelay_default'];} - if (($tReply_Type =='Interval Reply') and ($tInterval_Time =='')) { $tInterval_Time = $CONF['intervaldelay_default'];} - if (($tReply_Type =='Interval Reply') and ($tInterval_Time <= $CONF['autoreplydelay_default'])) { $tInterval_Time = $CONF['intervaldelay_default'];} + if ($tReply_Type =='Auto Reply') { $tInterval_Time = $CONF['vacation_autoreplydelay_default'];} + if (($tReply_Type =='Interval Reply') and ($tInterval_Time =='')) { $tInterval_Time = $CONF['vacation_intervaldelay_default'];} + if (($tReply_Type =='Interval Reply') and ($tInterval_Time <= $CONF['vacation_autoreplydelay_default'])) { $tInterval_Time = $CONF['vacation_intervaldelay_default'];} $fReply_Type = $tReply_Type ; $fInterval_Time = $tInterval_Time; @@ -187,7 +187,7 @@ $smarty->assign ('tSubject', $tSubject); $smarty->assign ('tBody', $tBody); $smarty->assign ('tActiveFrom', date ("d.m.Y", strtotime ($tActiveFrom))); $smarty->assign ('tActiveUntil', date ("d.m.Y", strtotime ($tActiveUntil))); -$smarty->assign ('select_options', select_options ( $CONF ['choice_of_reply'], array ($tReply_Type)),false); +$smarty->assign ('select_options', select_options ( $CONF ['vacation_choice_of_reply'], array ($tReply_Type)),false); $smarty->assign ('tInterval_Time', $tInterval_Time); $smarty->assign ('smarty_template', 'vacation'); $smarty->display ('index.tpl');