Commit 74196ba1 authored by Jesse Norell's avatar Jesse Norell
Browse files

always write before/after sieve scripts, and autoresponder dates optional

parent acdbd68b
......@@ -49,4 +49,4 @@ ALTER TABLE `web_domain` CHANGE `apache_directives` `apache_directives` mediumte
ALTER TABLE `web_domain` CHANGE `nginx_directives` `nginx_directives` mediumtext NULL DEFAULT NULL;
-- add move to junk before/after option, default to after
ALTER TABLE `mail_user` MODIFY `move_junk` enum('y','a','n') NOT NULL DEFAULT 'a';
ALTER TABLE `mail_user` MODIFY `move_junk` enum('y','a','n') NOT NULL DEFAULT 'y';
......@@ -1046,7 +1046,7 @@ CREATE TABLE `mail_user` (
`autoresponder_end_date` datetime NULL default NULL,
`autoresponder_subject` varchar(255) NOT NULL default 'Out of office reply',
`autoresponder_text` mediumtext NULL,
`move_junk` enum('y','a','n') NOT NULL default 'a',
`move_junk` enum('y','a','n') NOT NULL default 'y',
`purge_trash_days` INT NOT NULL DEFAULT '0',
`purge_junk_days` INT NOT NULL DEFAULT '0',
`custom_mailfilter` mediumtext,
......
......@@ -31,25 +31,11 @@ include_once 'validate_datetime.inc.php';
class validate_autoresponder extends validate_datetime
{
function start_date($field_name, $field_value, $validator)
{
global $app;
// save field value for later use in end_date()
$this->start_date = $field_value;
if($_POST['autoresponder'] == 'y' && $field_value == '') {
// we need a start date when autoresponder is on
return $app->tform->lng($validator['errmsg']).'<br />';
}
}
function end_date($field_name, $field_value, $validator)
{
global $app;
$start_date = $this->start_date;
//$start_date = $app->tform_actions->dataRecord['autoresponder_start_date'];
$start_date = $app->tform_actions->dataRecord['autoresponder_start_date'];
// Parse date
$datetimeformat = (isset($app->remoting_lib) ? $app->remoting_lib->datetimeformat : $app->tform->datetimeformat);
......@@ -60,8 +46,8 @@ class validate_autoresponder extends validate_datetime
$start_date_tstamp = mktime($start_date_array['hour'], $start_date_array['minute'], $start_date_array['second'], $start_date_array['month'], $start_date_array['day'], $start_date_array['year']);
$end_date_tstamp = mktime($end_date_array['hour'], $end_date_array['minute'], $end_date_array['second'], $end_date_array['month'], $end_date_array['day'], $end_date_array['year']);
// End date has to be > start date
if($end_date_tstamp <= $start_date_tstamp && ($start_date || $field_value)) {
// If both are set, end date has to be > start date
if($start_date && $field_value && $end_date_tstamp <= $start_date_tstamp) {
return $app->tform->lng($validator['errmsg']).'<br />';
}
}
......
......@@ -364,10 +364,6 @@ if ($global_config['mail']['mailbox_show_autoresponder_tab'] === 'y') {
0 => array ( 'type' => 'ISDATETIME',
'allowempty' => 'y',
'errmsg'=> 'autoresponder_start_date_is_no_date'),
1 => array ( 'type' => 'CUSTOM',
'class' => 'validate_autoresponder',
'function' => 'start_date',
'errmsg'=> 'autoresponder_start_date_is_required'),
)
),
'autoresponder_end_date' => array (
......@@ -403,7 +399,7 @@ if ($global_config['mail']['mailbox_show_mail_filter_tab'] === 'y') {
'move_junk' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => 'a',
'default' => 'y',
'value' => array('y' => 'move_junk_y_txt', 'a' => 'move_junk_a_txt', 'n' => 'move_junk_n_txt'),
),
'purge_trash_days' => array (
......
......@@ -11,7 +11,7 @@ $wb['autoresponder_txt'] = 'Active';
$wb['autoresponder_start_date_txt'] = 'Start on';
$wb['autoresponder_start_date_ispast'] = 'Start date cannot be in the past.';
$wb['autoresponder_end_date_txt'] = 'End by';
$wb['autoresponder_end_date_isgreater'] = 'End date must be set and be later than start date.';
$wb['autoresponder_end_date_isgreater'] = 'End date must be later than start date.';
$wb['no_domain_perm'] = 'You have no permission for this domain.';
$wb['error_no_pwd'] = 'Password is empty.';
$wb['quota_error_isint'] = 'Mailbox size must be a number.';
......@@ -60,7 +60,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -54,7 +54,6 @@ $wb['password_match_txt'] = 'The passwords do match.';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['backup_interval_txt'] = 'Backup interval';
......
......@@ -14,7 +14,6 @@ $wb['autoresponder_start_date_txt'] = 'Iniciar em';
$wb['autoresponder_start_date_ispast'] = 'O campo "Iniciar em" não pode ser menor que a data atual.';
$wb['autoresponder_end_date_txt'] = 'Terminar em';
$wb['autoresponder_end_date_isgreater'] = 'O campo "Terminar em" deve ser configurado e não pode ser menor ou igual a data atual.';
$wb['autoresponder_start_date_is_required'] = 'Data iniciar deve ser configurado quando a opção de auto-resposta estiver habilitada.';
$wb['no_domain_perm'] = 'Você não tem permissão para este domínio.';
$wb['error_no_pwd'] = 'A senha está em branco.';
$wb['quota_error_isint'] = 'O tamanho da conta de e-mail deve ser um número.';
......
......@@ -53,7 +53,6 @@ $wb['password_match_txt'] = 'Les mots de passe correspondent.';
$wb['disablesmtp_txt'] = 'Désactiver SMTP (envoi)';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Séparer chaque adresses par une virgule)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['greylisting_txt'] = 'Enable greylisting';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
......
......@@ -53,7 +53,6 @@ $wb['password_match_txt'] = 'Hesla se shodují.';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Při posílání kopií na více e-mailových adres, oddělte čárkami.)';
$wb['disablesmtp_txt'] = 'Zakázat SMTP (pouze odesílání)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['greylisting_txt'] = 'Povolit greylisting';
$wb['sender_cc_txt'] = 'Odeslat odchozí kopii na';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
......
......@@ -60,7 +60,6 @@ $wb['daily_backup_txt'] = 'taeglich';
$wb['weekly_backup_txt'] = 'woechentlich';
$wb['monthly_backup_txt'] = 'monatlich';
$wb['cc_note_txt'] = '(Mehrere E-Mail-Adressen mit Kommas trennen)';
$wb['autoresponder_start_date_is_required'] = 'Startdatum muss angegeben werden.';
$wb['sender_cc_txt'] = 'Kopie ausgehender Emails senden an (BCC)';
$wb['sender_cc_error_isemail'] = '-Kopie ausgehender Emails senden an- Feld enthält keine gültige Emailadresse';
$wb['sender_cc_note_txt'] = '(Mehrere E-Mail-Adressen mit Kommas trennen)';
......
......@@ -53,7 +53,6 @@ $wb['password_mismatch_txt'] = 'Adgangskoderne stemmer ikke overens.';
$wb['password_match_txt'] = 'Adgangskoderne stemmer overens.';
$wb['email_error_isascii'] = 'Undlad venligst at bruge specielle Unicode-tegn for din adgangskode Dette kan føre til problemer med din mail-klient.';
$wb['cc_note_txt'] = '(Adskil flere e-mail adresser med kommaer)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['password_click_to_set_txt'] = 'Click to set';
$wb['greylisting_txt'] = 'Enable greylisting';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
......
......@@ -54,7 +54,6 @@ $wb['password_match_txt'] = 'The passwords do match.';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['backup_interval_txt'] = 'Backup interval';
......
......@@ -13,8 +13,7 @@ $wb["autoresponder_txt"] = 'Active';
$wb["autoresponder_start_date_txt"] = 'Start on';
$wb["autoresponder_start_date_ispast"] = 'Start date cannot be in the past.';
$wb["autoresponder_end_date_txt"] = 'End by';
$wb["autoresponder_end_date_isgreater"] = 'End date must be set and be later than start date.';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb["autoresponder_end_date_isgreater"] = 'End date must be later than start date.';
$wb["no_domain_perm"] = 'You have no permission for this domain.';
$wb["error_no_pwd"] = 'Password is empty.';
$wb["quota_error_isint"] = 'Mailbox size must be a number.';
......
......@@ -4,7 +4,6 @@ $wb['active_txt'] = 'Habilitado';
$wb['autoresponder_active'] = 'Activar auto respuesta';
$wb['autoresponder_end_date_isgreater'] = 'Debe indicar la fecha de finalización y esta debe ser mayor a la de inicio.';
$wb['autoresponder_end_date_txt'] = 'Finaliza el';
$wb['autoresponder_start_date_is_required'] = 'Cuando se activa la auto respuesta se debe definir una fecha de inicio.';
$wb['autoresponder_start_date_ispast'] = 'La fecha de inicio no puede estar en el pasado.';
$wb['autoresponder_start_date_txt'] = 'Comienza el';
$wb['autoresponder_subject'] = 'Estoy fuera de la oficina';
......
......@@ -60,7 +60,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -53,7 +53,6 @@ $wb['password_match_txt'] = 'Les mots de passe correspondent.';
$wb['disablesmtp_txt'] = 'Désactiver SMTP (envoi)';
$wb['email_error_isascii'] = 'Merci de ne pas utiliser de caractères spéciaux Unicode dans votre mot de passe. Ceci pourrait engendrer des problèmes avec votre client mail.';
$wb['cc_note_txt'] = '(Séparer les adresses e-mail multiples par des virgules)';
$wb['autoresponder_start_date_is_required'] = 'Une date de démarrage doit être renseignée quand le répondeur automatique est activé.';
$wb['greylisting_txt'] = 'Activer le greylisting';
$wb['sender_cc_txt'] = 'Envoyer une copie des mails sortants à';
$wb['sender_cc_error_isemail'] = 'Le champ -Envoyer une copie des mails sortants à- no contiens pas une adresse e-mail valide';
......
......@@ -10,7 +10,7 @@ $wb['autoresponder_text_txt'] = 'Text';
$wb['autoresponder_txt'] = 'Aktivno';
$wb['autoresponder_start_date_txt'] = 'Start on';
$wb['autoresponder_end_date_txt'] = 'End by';
$wb['autoresponder_end_date_isgreater'] = 'End date must be set and be later than start date.';
$wb['autoresponder_end_date_isgreater'] = 'End date must be later than start date.';
$wb['no_domain_perm'] = 'You have no permission for this domain.';
$wb['error_no_pwd'] = 'Password is empty.';
$wb['quota_error_isint'] = 'Mailbox size must be a number.';
......@@ -57,7 +57,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['generate_password_txt'] = 'Generate Password';
......
......@@ -30,7 +30,7 @@ $wb['quota_error_value'] = 'Invalid quota value. Allowed values are: 0 for unlim
$wb['autoresponder_start_date_txt'] = 'Start on';
$wb['autoresponder_start_date_ispast'] = 'Start date cannot be in the past.';
$wb['autoresponder_end_date_txt'] = 'End by';
$wb['autoresponder_end_date_isgreater'] = 'End date must be set and be later than start date.';
$wb['autoresponder_end_date_isgreater'] = 'End date must be later than start date.';
$wb['move_junk_txt'] = 'Move Spam Emails to Junk directory';
$wb["move_junk_y_txt"] = 'Move first, before custom filters.';
$wb["move_junk_a_txt"] = 'Move last, after custom filters.';
......@@ -61,7 +61,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -61,7 +61,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -54,7 +54,6 @@ $wb['password_match_txt'] = 'Le passwords coincidono.';
$wb['email_error_isascii'] = 'Non utilizzare caratteri speciali unicode per la password. Potresti avere problemi con il tuo client di psota.';
$wb['cc_note_txt'] = '(Separa indirizzi email multipli con la virgola)';
$wb['disablesmtp_txt'] = 'Disabilita SMTP (trasmissione)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['greylisting_txt'] = 'Enable greylisting';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
......
......@@ -30,7 +30,7 @@ $wb['quota_error_value'] = '容量の値が不正です。 無制限にする場
$wb['autoresponder_start_date_txt'] = 'Start on';
$wb['autoresponder_start_date_ispast'] = 'Start date cannot be in the past.';
$wb['autoresponder_end_date_txt'] = 'End by';
$wb['autoresponder_end_date_isgreater'] = 'End date must be set and be later than start date.';
$wb['autoresponder_end_date_isgreater'] = 'End date must be later than start date.';
$wb['move_junk_txt'] = 'Move Spam Emails to Junk directory';
$wb["move_junk_y_txt"] = 'Move first, before custom filters.';
$wb["move_junk_a_txt"] = 'Move last, after custom filters.';
......@@ -61,7 +61,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -60,7 +60,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Meerdere e-mail adressen scheiden met een komma)';
$wb['disablesmtp_txt'] = 'Uitschakelen SMTP (versturen)';
$wb['autoresponder_start_date_is_required'] = 'Een startdatun is vereist voor het inschakelen van Autobeantwoorden.';
$wb['sender_cc_txt'] = 'Stuur uitgaande kopie aan';
$wb['sender_cc_error_isemail'] = 'Het \\"Stuur uitgaande kopie aan\\" veld bevat geen geldig e-mail adres';
$wb['sender_cc_note_txt'] = '(Meerdere e-mail adressen scheiden met een komma)';
......
......@@ -61,7 +61,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -61,7 +61,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -28,7 +28,7 @@ $wb['disablepop3_txt'] = 'Blocheaza POP3';
$wb['autoresponder_start_date_txt'] = 'Start on';
$wb['autoresponder_start_date_ispast'] = 'Start date cannot be in the past.';
$wb['autoresponder_end_date_txt'] = 'End by';
$wb['autoresponder_end_date_isgreater'] = 'End date must be set and be later than start date.';
$wb['autoresponder_end_date_isgreater'] = 'End date must be later than start date.';
$wb['duplicate_alias_or_forward_txt'] = 'There is already an alias or forwrd with this email address.';
$wb['quota_error_value'] = 'Invalid quota value. Allowed values are: 0 for unlimited or numbers > 1';
$wb['move_junk_txt'] = 'Move Spam Emails to Junk directory';
......@@ -61,7 +61,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -61,7 +61,6 @@ $wb['monthly_backup_txt'] = 'Ежемесячно';
$wb['email_error_isascii'] = 'Пожалуйста, не используйте специальные символы Юникода для вашего пароля. Это может привести к проблемам с вашим почтовым клиентом.';
$wb['cc_note_txt'] = '(Разделите несколько адресов электронной почты запятыми)';
$wb['disablesmtp_txt'] = 'Отключить SMTP (отправка)';
$wb['autoresponder_start_date_is_required'] = 'Дата начала должна быть установлена когда автоответчик включен.';
$wb['sender_cc_txt'] = 'Отправка исходящей копии на';
$wb['sender_cc_error_isemail'] = 'Поле -Отправка исходящей копии на- не содержит действительный адрес электронной почты';
$wb['sender_cc_note_txt'] = '(Разделите несколько адресов электронной почты запятыми)';
......
......@@ -30,7 +30,7 @@ $wb['quota_error_value'] = 'Invalid quota value. Allowed values are: 0 for unlim
$wb['autoresponder_start_date_txt'] = 'Starta den';
$wb['autoresponder_start_date_ispast'] = 'Startdatum kan inte vara i det förflutna.';
$wb['autoresponder_end_date_txt'] = 'Sluta den';
$wb['autoresponder_end_date_isgreater'] = 'End date must be set and be later than start date.';
$wb['autoresponder_end_date_isgreater'] = 'End date must be later than start date.';
$wb['move_junk_txt'] = 'FLytta spamepost till spammappen';
$wb["move_junk_y_txt"] = 'Move first, before custom filters.';
$wb["move_junk_a_txt"] = 'Move last, after custom filters.';
......@@ -61,7 +61,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -30,7 +30,7 @@ $wb['quota_error_value'] = 'Neplatná hodnota kvóty. Povolené hodnoty sú: 0 p
$wb['autoresponder_start_date_txt'] = 'Start on';
$wb['autoresponder_start_date_ispast'] = 'Start date cannot be in the past.';
$wb['autoresponder_end_date_txt'] = 'End by';
$wb['autoresponder_end_date_isgreater'] = 'End date must be set and be later than start date.';
$wb['autoresponder_end_date_isgreater'] = 'End date must be later than start date.';
$wb['move_junk_txt'] = 'Move Spam Emails to Junk directory';
$wb["move_junk_y_txt"] = 'Move first, before custom filters.';
$wb["move_junk_a_txt"] = 'Move last, after custom filters.';
......@@ -61,7 +61,6 @@ $wb['monthly_backup_txt'] = 'Monthly';
$wb['email_error_isascii'] = 'Please do not use special unicode characters for your password. This could lead to problems with your mail client.';
$wb['cc_note_txt'] = '(Separate multiple email addresses with commas)';
$wb['disablesmtp_txt'] = 'Disable SMTP (sending)';
$wb['autoresponder_start_date_is_required'] = 'Start date must be set when Autoresponder is enabled.';
$wb['sender_cc_txt'] = 'Send outgoing BCC to';
$wb['sender_cc_error_isemail'] = 'The -Send outgoing copy to- field does not contain a valid email address';
$wb['sender_cc_note_txt'] = '(Separate multiple email addresses with commas)';
......
......@@ -14,7 +14,6 @@ $wb['autoresponder_start_date_txt'] = 'Başlangıç';
$wb['autoresponder_start_date_ispast'] = 'Başlangıç zamanı geçmişte olamaz.';
$wb['autoresponder_end_date_txt'] = 'Bitiş';
$wb['autoresponder_end_date_isgreater'] = 'Bitiş zamanı başlangıç zamanından sonra olmalıdır.';
$wb['autoresponder_start_date_is_required'] = 'Otoyanıtlayıcı kullanıldığında başlangıç tarihi belirtilmelidir.';
$wb['no_domain_perm'] = 'Bu etki alanı için izniniz yok.';
$wb['error_no_pwd'] = 'Parola boş olamaz.';
$wb['quota_error_isint'] = 'E-posta kutusunun boyutu bir sayı olmalıdır.';
......
<tmpl_if name="sieve_script" op="==" value="before">
# This sieve script is generated by ISPConfig, any changes made will be overwritten.
# You can create and activate a per-user sieve script (manually or via managesieve),
# which will execute before this.
require ["fileinto", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress", "copy", "reject"];
# which will execute after this.
<tmpl_if name="cc">
# Send a copy of email to
<tmpl_loop name="ccloop">
redirect "<tmpl_var name='address'>";
</tmpl_loop>
</tmpl_if>
require ["fileinto", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress", "copy", "reject"];
<tmpl_if name="move_junk" op="==" value="y">
# Move spam to spam folder
......@@ -19,9 +14,20 @@ if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes",
}
</tmpl_if>
<tmpl_if name="cc">
# Send a copy of email to
<tmpl_loop name="ccloop">
redirect "<tmpl_var name='address'>";
</tmpl_loop>
</tmpl_if>
<tmpl_var name='custom_mailfilter'>
keep;
</tmpl_if>
<tmpl_if name="sieve_script" op="==" value="after">
# This sieve script is generated by ISPConfig, any changes made will be overwritten.
# You can create and activate a per-user sieve script (manually or via managesieve),
# which will execute before this.
<tmpl_if name="move_junk" op="==" value="a">
# Move spam to spam folder
......@@ -39,13 +45,28 @@ if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes",
# Move spam to spam folder
if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes", header :contains "subject" "*** SPAM ***", header :contains "subject" "***SPAM***") {
fileinto "Junk";
# Stop here so that we do not reply on spams
stop;
}
<tmpl_if name="start_date">
if currentdate :value "ge" "iso8601" "<tmpl_var name='start_date'>" {
</tmpl_if>
<tmpl_if name="end_date">
if currentdate :value "le" "iso8601" "<tmpl_var name='end_date'>" {
</tmpl_if>
vacation :days 1
:subject "<tmpl_var name='autoresponder_subject'>"
# :addresses ["test@test.int", "till@test.int"]
<tmpl_var name='addresses'>
"<tmpl_var name='autoresponder_text'>";
<tmpl_if name="end_date">
}
</tmpl_if>
<tmpl_if name="start_date">
}
</tmpl_if>
</tmpl_if>
</tmpl_if>
<tmpl_if name="sieve_script" op="==" value="before">
# This sieve script is generated by ISPConfig, any changes made will be overwritten.
# You can create and activate a per-user sieve script (manually or via managesieve),
# which will execute before this.
# which will execute after this.
require ["fileinto", "regex", "date", "relational", "vacation", "imap4flags", "envelope", "subaddress", "copy", "reject"];
<tmpl_if name="move_junk" op="==" value="y">
......@@ -21,7 +23,11 @@ redirect "<tmpl_var name='address'>";
<tmpl_var name='custom_mailfilter'>
keep;
</tmpl_if>
<tmpl_if name="sieve_script" op="==" value="after">
# This sieve script is generated by ISPConfig, any changes made will be overwritten.
# You can create and activate a per-user sieve script (manually or via managesieve),
# which will execute before this.
<tmpl_if name="move_junk" op="==" value="a">
# Move spam to spam folder
......@@ -43,8 +49,11 @@ if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes",
stop;
}
<tmpl_if name="autoresponder_date_limit">
if allof(currentdate :value "ge" "iso8601" "<tmpl_var name='start_date'>", currentdate :value "le" "iso8601" "<tmpl_var name='end_date'>") {
<tmpl_if name="start_date">
if currentdate :value "ge" "iso8601" "<tmpl_var name='start_date'>" {
</tmpl_if>
<tmpl_if name="end_date">
if currentdate :value "le" "iso8601" "<tmpl_var name='end_date'>" {
</tmpl_if>
vacation :days 1
......@@ -52,8 +61,12 @@ vacation :days 1
<tmpl_var name='addresses'>
"<tmpl_var name='autoresponder_text'>";
<tmpl_if name="autoresponder_date_limit">
<tmpl_if name="end_date">
}
</tmpl_if>
<tmpl_if name="start_date">
}
</tmpl_if>
</tmpl_if>
</tmpl_if>
......@@ -127,116 +127,111 @@ class maildeliver_plugin {
}
unset($tmp);
//* Create new filter file based on template
$tpl = new tpl();
$tpl->newTemplate($filter_file_template);
// cc Field
$tmp_mails_arr = explode(',',$data["new"]["cc"]);
$tmp_addresses_arr = array();
foreach($tmp_mails_arr as $address) {
if(trim($address) != '') $tmp_addresses_arr[] = array('address' => trim($address));
}
foreach ( array('before', 'after') as $sieve_script ) {
//* Create new filter file based on template
$tpl = new tpl();
$tpl->newTemplate($filter_file_template);
// cc Field
$tmp_mails_arr = explode(',',$data["new"]["cc"]);
$tmp_addresses_arr = array();
foreach($tmp_mails_arr as $address) {
if(trim($address) != '') $tmp_addresses_arr[] = array('address' => trim($address));
}
$tpl->setVar('cc', $data["new"]["cc"]);
$tpl->setLoop('ccloop', $tmp_addresses_arr);
// Custom filters
if($data["new"]["custom_mailfilter"] == 'NULL') $data["new"]["custom_mailfilter"] = '';
$tpl->setVar('custom_mailfilter', str_replace("\r\n","\n",$data["new"]["custom_mailfilter"]));
// Move junk
$tpl->setVar('move_junk', $data["new"]["move_junk"]);
// Check autoresponder dates
if((!$data['new']['autoresponder_start_date'] || $data["new"]["autoresponder_start_date"] == '0000-00-00 00:00:00') && (!$data['new']['autoresponder_end_date'] || $data["new"]["autoresponder_end_date"] == '0000-00-00 00:00:00')) {
$tpl->setVar('autoresponder_date_limit', 0);
} else {
$tpl->setVar('autoresponder_date_limit', 1);
}
// Set autoresponder start date
$data["new"]["autoresponder_start_date"] = str_replace(" ", "T", $data["new"]["autoresponder_start_date"]);
$tpl->setVar('start_date', $data["new"]["autoresponder_start_date"]);
// Set autoresponder end date
$data["new"]["autoresponder_end_date"] = str_replace(" ", "T", $data["new"]["autoresponder_end_date"]);
$tpl->setVar('end_date', $data["new"]["autoresponder_end_date"]);
// Autoresponder
$tpl->setVar('autoresponder', $data["new"]["autoresponder"]);
// Autoresponder Subject
$data["new"]["autoresponder_subject"] = str_replace("\"", "'", $data["new"]["autoresponder_subject"]);
$tpl->setVar('autoresponder_subject', $data["new"]["autoresponder_subject"]);
// Autoresponder Text
$data["new"]["autoresponder_text"] = str_replace("\"", "'", $data["new"]["autoresponder_text"]);
$tpl->setVar('autoresponder_text', $data["new"]["autoresponder_text"]);
$tpl->setVar('cc', $data["new"]["cc"]);
$tpl->setLoop('ccloop', $tmp_addresses_arr);
// Custom filters
if($data["new"]["custom_mailfilter"] == 'NULL') $data["new"]["custom_mailfilter"] = '';
$tpl->setVar('custom_mailfilter', str_replace("\r\n","\n",$data["new"]["custom_mailfilter"]));
// Move junk
$tpl->setVar('move_junk', $data["new"]["move_junk"]);
// Set autoresponder start date
$data["new"]["autoresponder_start_date"] = str_replace(" ", "T", $data["new"]["autoresponder_start_date"]);
$tpl->setVar('start_date', $data["new"]["autoresponder_start_date"]);
// Set autoresponder end date
$data["new"]["autoresponder_end_date"] = str_replace(" ", "T", $data["new"]["autoresponder_end_date"]);
$tpl->setVar('end_date', $data["new"]["autoresponder_end_date"]);
// Autoresponder
$tpl->setVar('autoresponder', $data["new"]["autoresponder"]);
// Autoresponder Subject
$data["new"]["autoresponder_subject"] = str_replace("\"", "'", $data["new"]["autoresponder_subject"]);
$tpl->setVar('autoresponder_subject', $data["new"]["autoresponder_subject"]);
// Autoresponder Text
$data["new"]["autoresponder_text"] = str_replace("\"", "'", $data["new"]["autoresponder_text"]);
$tpl->setVar('autoresponder_text', $data["new"]["autoresponder_text"]);
if (! defined($address_str)) {
//* Set alias addresses for autoresponder
$sql = "SELECT * FROM mail_forwarding WHERE type = 'alias' AND destination = ?";
$records = $app->db->queryAllRecords($sql, $data["new"]["email"]);
$addresses = array();
$addresses[] = $data["new"]["email"];