From: cajus Date: Tue, 10 Feb 2009 10:31:47 +0000 (+0000) Subject: Moved around X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=39aaf4a0d1e8981fd7bb84c566b00b0412368f64;p=gosa.git Moved around git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13416 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/uw-imap/personal/mail/uw-imap/class_mail-methods-uwimap.inc b/gosa-plugins/uw-imap/personal/mail/uw-imap/class_mail-methods-uwimap.inc new file mode 100644 index 000000000..4aa558c56 --- /dev/null +++ b/gosa-plugins/uw-imap/personal/mail/uw-imap/class_mail-methods-uwimap.inc @@ -0,0 +1,146 @@ +config->data['SERVERS']['IMAP'])){ + $this->ServerList = $this->config->data['SERVERS']['IMAP']; + } + + /* Check for required PROCMAIL_PATH configuration + */ + if($this->config->get_cfg_value("procMailPath","") == ""){ + msg_dialog::display(_("Configuration error"),msgPool::invalidConfigurationAttribute("procMailPath"), ERROR_DIALOG); + $this->procmaildir = ""; + }else{ + $this->procmaildir = $this->config->data['MAIN']['PROCMAIL_PATH']; + } + } + + + public function saveSieveSettings() + { + if(empty($this->procmaildir)){ + @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "", + "MAIL: Skippend writting scripts, 'procMailPath' is not configured"); + return; + } + + mailMethod::saveSieveSettings(); + /* Map attribute from parent class + */ + $mail = $this->parent->mail; + $gosaMailDeliveryMode = $this->parent->gosaMailDeliveryMode; + $gosaMailAlternateAddress = $this->parent->gosaMailAlternateAddress; + $gosaMailMaxSize = $this->parent->gosaMailMaxSize; + $gosaSpamMailbox = $this->parent->gosaSpamMailbox; + $gosaSpamSortLevel = $this->parent->gosaSpamSortLevel; + $gosaVacationMessage = $this->parent->gosaVacationMessage; + + $recipe = ""; + $addrlist = $mail; + foreach ($gosaMailAlternateAddress as $val){ + $addrlist .= "|$val"; + } + $user = $this->getUAttribValue(); + + /* Only create a new one, if it is not empty */ + if (is_integer(strpos($gosaMailDeliveryMode, "R")) || + is_integer(strpos($gosaMailDeliveryMode, "C")) || + !is_integer(strpos($gosaMailDeliveryMode, "L")) || + is_integer(strpos($gosaMailDeliveryMode, "V")) || + is_integer(strpos($gosaMailDeliveryMode, "S"))) { + $text= implode ("", file(CONFIG_DIR."/procmail-header.txt")); + $text = preg_replace('/"/', '\\"', $text); + eval ("\$recipe.=\"$text\";"); + } + + /* Add anti-spam variables */ + if (is_integer(strpos($gosaMailDeliveryMode, "S"))) { + $spambox = $gosaSpamMailbox; + $spamlevel = $gosaSpamSortLevel; + $text= implode ("", file(CONFIG_DIR."/procmail-spam.txt")); + $text = preg_replace('/"/', '\\"', $text); + eval ("\$recipe.=\"$text\";"); + } + + /* Add vacation recipe */ + if (is_integer(strpos($gosaMailDeliveryMode, "V"))) { + $vacmsg = $gosaVacationMessage; + $text= implode ("", file(CONFIG_DIR."/procmail-vacation.txt")); + $text = preg_replace('/"/', '\\"', $text); + eval ("\$recipe.=\"$text\";"); + } + + /* Check if no local delivery is wanted */ + if (!is_integer(strpos($gosaMailDeliveryMode, "L"))) { + $text= implode ("", file(CONFIG_DIR."/procmail-discard.txt")); + $text = preg_replace('/"/', '\\"', $text); + eval ("\$recipe.=\"$text\";"); + } + + /* Write procmail script */ + if (!empty($recipe)) { + $text= implode ("", file(CONFIG_DIR."/procmail-footer.txt")); + $text = preg_replace('/"/', '\\"', $text); + eval ("\$recipe.=\"$text\";"); + $file = $this->procmaildir . "/" . $this->getUAttribValue(); + + if (!file_put_contents($file, $recipe)) { + msg_dialog::display(_("Error"),(sprintf(_("Unable to write procmail script to '%s'."), $file)),ERROR_DIALOG); + } + } + } + +} + +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/gosa-plugins/uw-imap/personal/mail/uwimap/class_mail-methods-uwimap.inc b/gosa-plugins/uw-imap/personal/mail/uwimap/class_mail-methods-uwimap.inc deleted file mode 100644 index 4aa558c56..000000000 --- a/gosa-plugins/uw-imap/personal/mail/uwimap/class_mail-methods-uwimap.inc +++ /dev/null @@ -1,146 +0,0 @@ -config->data['SERVERS']['IMAP'])){ - $this->ServerList = $this->config->data['SERVERS']['IMAP']; - } - - /* Check for required PROCMAIL_PATH configuration - */ - if($this->config->get_cfg_value("procMailPath","") == ""){ - msg_dialog::display(_("Configuration error"),msgPool::invalidConfigurationAttribute("procMailPath"), ERROR_DIALOG); - $this->procmaildir = ""; - }else{ - $this->procmaildir = $this->config->data['MAIN']['PROCMAIL_PATH']; - } - } - - - public function saveSieveSettings() - { - if(empty($this->procmaildir)){ - @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__, "", - "MAIL: Skippend writting scripts, 'procMailPath' is not configured"); - return; - } - - mailMethod::saveSieveSettings(); - /* Map attribute from parent class - */ - $mail = $this->parent->mail; - $gosaMailDeliveryMode = $this->parent->gosaMailDeliveryMode; - $gosaMailAlternateAddress = $this->parent->gosaMailAlternateAddress; - $gosaMailMaxSize = $this->parent->gosaMailMaxSize; - $gosaSpamMailbox = $this->parent->gosaSpamMailbox; - $gosaSpamSortLevel = $this->parent->gosaSpamSortLevel; - $gosaVacationMessage = $this->parent->gosaVacationMessage; - - $recipe = ""; - $addrlist = $mail; - foreach ($gosaMailAlternateAddress as $val){ - $addrlist .= "|$val"; - } - $user = $this->getUAttribValue(); - - /* Only create a new one, if it is not empty */ - if (is_integer(strpos($gosaMailDeliveryMode, "R")) || - is_integer(strpos($gosaMailDeliveryMode, "C")) || - !is_integer(strpos($gosaMailDeliveryMode, "L")) || - is_integer(strpos($gosaMailDeliveryMode, "V")) || - is_integer(strpos($gosaMailDeliveryMode, "S"))) { - $text= implode ("", file(CONFIG_DIR."/procmail-header.txt")); - $text = preg_replace('/"/', '\\"', $text); - eval ("\$recipe.=\"$text\";"); - } - - /* Add anti-spam variables */ - if (is_integer(strpos($gosaMailDeliveryMode, "S"))) { - $spambox = $gosaSpamMailbox; - $spamlevel = $gosaSpamSortLevel; - $text= implode ("", file(CONFIG_DIR."/procmail-spam.txt")); - $text = preg_replace('/"/', '\\"', $text); - eval ("\$recipe.=\"$text\";"); - } - - /* Add vacation recipe */ - if (is_integer(strpos($gosaMailDeliveryMode, "V"))) { - $vacmsg = $gosaVacationMessage; - $text= implode ("", file(CONFIG_DIR."/procmail-vacation.txt")); - $text = preg_replace('/"/', '\\"', $text); - eval ("\$recipe.=\"$text\";"); - } - - /* Check if no local delivery is wanted */ - if (!is_integer(strpos($gosaMailDeliveryMode, "L"))) { - $text= implode ("", file(CONFIG_DIR."/procmail-discard.txt")); - $text = preg_replace('/"/', '\\"', $text); - eval ("\$recipe.=\"$text\";"); - } - - /* Write procmail script */ - if (!empty($recipe)) { - $text= implode ("", file(CONFIG_DIR."/procmail-footer.txt")); - $text = preg_replace('/"/', '\\"', $text); - eval ("\$recipe.=\"$text\";"); - $file = $this->procmaildir . "/" . $this->getUAttribValue(); - - if (!file_put_contents($file, $recipe)) { - msg_dialog::display(_("Error"),(sprintf(_("Unable to write procmail script to '%s'."), $file)),ERROR_DIALOG); - } - } - } - -} - -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?>