Current time: 04-24-2024, 04:51 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Webmail mit Abwesenheitsfunktion
Author Message
Rafioso Offline
Junior Member
*

Posts: 151
Joined: Oct 2009
Reputation: 0
Post: #1
Webmail mit Abwesenheitsfunktion
Hi,

ich nutze das standardmäßige SquirrelMail als Webmail und ispCP 1.0.6.
Wie kann man vom Webmail aus eine Abwesenheitsnachricht bzw. Auto-Responder erstellen? Ich kann ja schlecht jedem das Passwort für den ispCP-Bereich geben Wink

Danke.
08-09-2010 08:18 AM
Find all posts by this user Quote this message in a reply
Slowman Offline
Member
***

Posts: 332
Joined: Feb 2007
Reputation: 0
Post: #2
RE: Webmail mit Abwesenheitsfunktion
Meinste das Plugin hier: http://squirrelmail.org/plugin_view.php?id=172
08-09-2010 10:25 PM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #3
RE: Webmail mit Abwesenheitsfunktion
Das dürfte nicht automatisch funktionieren.

man muss die DB ändern und dann den request manager aufrufen, um die Änderungen ins System schreiben zu lassen...
Zurzeit gibt es nur das separaten Tool (irgendwo im Wiki glaubs), womit die Mailuser ihr Passwort ändern und die Ferienabwesenheit setzen können...

/J
08-09-2010 10:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Rafioso Offline
Junior Member
*

Posts: 151
Joined: Oct 2009
Reputation: 0
Post: #4
RE: Webmail mit Abwesenheitsfunktion
(08-09-2010 10:25 PM)Slowman Wrote:  Meinste das Plugin hier: http://squirrelmail.org/plugin_view.php?id=172
Nein, das meinte ich nicht. Ich meinte, ob es generell eine Lösung dazu gibt.

(08-09-2010 10:54 PM)joximu Wrote:  Das dürfte nicht automatisch funktionieren.

man muss die DB ändern und dann den request manager aufrufen, um die Änderungen ins System schreiben zu lassen...
Zurzeit gibt es nur das separaten Tool (irgendwo im Wiki glaubs), womit die Mailuser ihr Passwort ändern und die Ferienabwesenheit setzen können...

/J
Ich habe die Doku durchsucht, aber nichts gefunden :/
08-09-2010 11:59 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #5
RE: Webmail mit Abwesenheitsfunktion
hm... Mist, ist nur ein Passwort Wechsler...

ich kann dir nur meine Änderungen auflisten, die ich bei horde-vacation gemacht habe (ich fuinde horde-webmail besser als squirrel):

die conf.php (Ausschnitt):
Code:
$conf['vacation']['default_subject'] = _("On vacation message");
$conf['vacation']['default_message'] = _("I'm on vacation and will not be reading my mail for a while.\nYour mail will be dealt with when I return.");
$conf['vacation']['subject'] = false;
$conf['vacation']['from'] = false;
$conf['server']['params']['default']['query_set'] = 'UPDATE `ispcp`.`mail_users` SET `mail_auto_respond_text` = \M, `mail_auto_respond` = 1, `status` = \'change\' WHERE mail_add
$conf['server']['params']['default']['query_unset'] = 'UPDATE `ispcp`.`mail_users` SET `mail_auto_respond` = 0, `status` = \'change\' WHERE mail_addr = \U AND `mail_pass` = \P';
$conf['server']['params']['default']['query_get'] = "SELECT IF(`mail_auto_respond`=1,'Y', 'N') AS `vacation`, `mail_auto_respond_text` AS `message`, '' AS `subject` FROM `ispcp`
$conf['server']['params']['default']['driverconfig'] = 'horde';
$conf['server']['params']['default']['hordeauth'] = false;
$conf['server']['params']['encryption'] = 'plain';
$conf['server']['params']['show_encryption'] = false;
$conf['server']['driver'] = 'ispcp';



und die Datei lib/Driver/ispcp.php als "diff-u" von customsql.php:
Code:
--- customsql.php       2009-01-29 17:02:55.000000000 +0100
+++ ispcp.php   2010-01-28 17:33:17.000000000 +0100
@@ -13,7 +13,7 @@
  * @since   Vacation 3.1
  * @package Vacation
  */
-class Vacation_Driver_customsql extends Vacation_Driver {
+class Vacation_Driver_ispcp extends Vacation_Driver {

     /**
      * SQL connection object.
@@ -35,7 +35,7 @@
      * @param string $user   A user name.
      * @param array $params  Configuration parameters for the backend.
      */
-    function Vacation_Driver_customsql($user, $params = array())
+    function Vacation_Driver_ispcp($user, $params = array())
     {
         $params = Horde::getDriverConfig('server', 'sql');
         parent::Vacation_Driver($user, $params);
@@ -65,6 +65,9 @@
         // Build username.
         $myuser = $this->_buildUsername();

+        # ispcp
+        $password = $this->encrypt_db_password($password);
+
         // Encrypt password.
         $crypted_password = $this->_encryptPassword($password, $this->_getCurrentPassword($myuser));

@@ -91,6 +94,8 @@
         if ($result !== DB_OK) {
             return PEAR::raiseError(_("An unknown error occured while enabling the vacation notice."));
         }
+        # ispCP Update...
+        $this->send_request();
     }

     /**
@@ -113,6 +118,9 @@
         // Build username.
         $myuser = $this->_buildUsername();

+        # ispcp
+        $password = $this->encrypt_db_password($password);
+
         // Encrypt password.
         $crypted_password = $this->_encryptPassword($password, $this->_getCurrentPassword($myuser));

@@ -135,6 +143,9 @@
         if ($result !== DB_OK) {
             return PEAR::raiseError(_("An unknown error occured while enabling the vacation notice."));
         }
+
+        # ispCP Update...
+        $this->send_request();
     }

     /**
@@ -166,6 +177,9 @@
         // Build username.
         $myuser = $this->_buildUsername();

+        # ispcp
+        $password = $this->encrypt_db_password($password);
+
         // Encrypt password.
         $crypted_password = $this->_encryptPassword($password, $this->_getCurrentPassword($myuser));

@@ -205,7 +219,7 @@
         if (empty($this->_params[$this->_realm]['query_password'])) {
             return '';
         }
-
+
         // Build the SQL query.
         $query = str_replace('\U',
                              $this->_db->quote($this->_buildUsername()),
@@ -230,7 +244,12 @@
     {
         if ($this->_realm === 'default' ||
             $this->_realm === '') {
-            return $this->_user;
+
+            $userid = Auth::getAuth();
+//            $userid = Auth::getBareAuth();
+
+//            return $this->_user;
+            return $userid;
         } else {
             return $this->_user . '@' . $this->_realm;
         }
@@ -308,4 +327,120 @@
         $this->_connected = true;
     }

+# ispcp Funktionen
+function read_line(&$socket) {
+    $ch = '';
+    $line = '';
+    do {
+        $ch = socket_read($socket,1);
+        $line = $line . $ch;
+    } while($ch != "\r" && $ch != "\n");
+    return $line;
+}
+
+function send_request() {
+
+#        global $Version;
+        $Version = 'ispCP-Horde-Passwd';
+
+        $code = 999;
+
+    @$socket = socket_create (AF_INET, SOCK_STREAM, 0);
+    if ($socket < 0) {
+        $errno =  "socket_create() failed.\n";
+        return $errno;
+    }
+
+    @$result = socket_connect ($socket, '127.0.0.1', 9876);
+    if ($result == FALSE) {
+        $errno =  "socket_connect() failed.\n";
+        return $errno;
+    }
+
+    /* read one line with welcome string */
+    $out = $this->read_line($socket);
+
+    list($code) = explode(' ', $out);
+    if ($code == 999) {
+        return $out;
+    }
+
+    /* send hello query */
+    $query = "helo  $Version\r\n";
+    socket_write ($socket, $query, strlen ($query));
+
+    /* read one line with helo answer */
+    $out = $this->read_line($socket);
+
+    list($code) = explode(' ', $out);
+    if ($code == 999) {
+        return $out;
+    }
+
+    /* send reg check query */
+    $query = "execute query\r\n";
+    socket_write ($socket, $query, strlen ($query));
+    /* read one line key replay */
+    $execute_reply = $this->read_line($socket);
+
+    list($code) = explode(' ', $execute_reply);
+    if ($code == 999) {
+        return $out;
+    }
+
+    /* send quit query */
+    $quit_query = "bye\r\n";
+    socket_write ($socket, $quit_query, strlen ($quit_query));
+    /* read quit answer */
+    $quit_reply = $this->read_line($socket);
+
+    list($code) = explode(' ', $quit_reply);
+    if ($code == 999) {
+        return $out;
+    }
+
+    list($answer) = explode(' ', $execute_reply);
+
+    socket_close ($socket);
+
+    return $answer;
+}
+
+function encrypt_db_password($db_pass) {
+    require '/var/www/ispcp/gui/include/ispcp-db-keys.php';
+#    global $ispcp_db_pass_key, $ispcp_db_pass_iv;
+
+    if (extension_loaded('mcrypt') || @dl('mcrypt.' . PHP_SHLIB_SUFFIX)) {
+        $td = @mcrypt_module_open(MCRYPT_BLOWFISH, '', 'cbc', '');
+        // Create key
+        $key = $ispcp_db_pass_key;
+        // Create the IV and determine the keysize length
+        $iv = $ispcp_db_pass_iv;
+
+        // compatibility with used perl pads
+        $block_size = @mcrypt_enc_get_block_size($td);
+        $strlen = strlen($db_pass);
+
+        $pads = $block_size-$strlen % $block_size;
+
+        $db_pass .= str_repeat(' ', $pads);
+
+        // Initialize encryption
+        @mcrypt_generic_init($td, $key, $iv);
+        // Encrypt string
+        $encrypted = @mcrypt_generic ($td, $db_pass);
+        @mcrypt_generic_deinit($td);
+        @mcrypt_module_close($td);
+
+        $text = @base64_encode("$encrypted");
+
+        // Show encrypted string
+        return trim($text);
+    } else {
+        //system_message("ERROR: The php-extension 'mcrypt' not loaded!");
+        die("ERROR: The php-extension 'mcrypt' not loaded!");
+    }
+}
+
+
}

Vielleicht siehst du damit, was ca nötig ist...

Natürlich muss der sql-User diese Tabellen ändern können (der sql-user von horde... - das habe ich mal geschrieben im Forum...)

Edit: das könnte so aussehen:

INSERT INTO `tables_priv` (`Host`, `Db`, `User`, `Table_name`, `Grantor`, `Timestamp`, `Table_priv`, `Column_priv`) VALUES
('localhost', 'ispcp', 'horde-webmail', 'mail_users', 'root', '2009-06-20 23:16:31', 'Select', 'Select,Update');

INSERT INTO `columns_priv` (`Host`, `Db`, `User`, `Table_name`, `Column_name`, `Timestamp`, `Column_priv`) VALUES
('localhost', 'ispcp', 'horde-webmail', 'mail_users', 'mail_auto_respond_text', '2009-06-20 23:17:18', 'Update'),
('localhost', 'ispcp', 'horde-webmail', 'mail_users', 'mail_auto_respond', '2009-06-20 23:17:18', 'Update'),
('localhost', 'ispcp', 'horde-webmail', 'mail_users', 'status', '2009-06-20 23:17:18', 'Update'),
('localhost', 'ispcp', 'horde-webmail', 'mail_users', 'mail_pass', '2009-06-20 23:17:18', 'Update');

oder so...

Gruss Joxi
(This post was last modified: 08-24-2010 01:56 AM by joximu.)
08-10-2010 12:18 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Rafioso Offline
Junior Member
*

Posts: 151
Joined: Oct 2009
Reputation: 0
Post: #6
RE: Webmail mit Abwesenheitsfunktion
Hi,

vielen Dank dafür, aber damit kann ich leider nicht viel anfangen :/
Naja, muss dann wohl leider damit zurecht kommen, dass das nicht gehen wird. Schade.

Vll. setzt das ja jemand für die nächste Version um.
08-10-2010 02:31 AM
Find all posts by this user Quote this message in a reply
grisu Offline
Junior Member
*

Posts: 64
Joined: Jun 2009
Reputation: 0
Post: #7
RE: Webmail mit Abwesenheitsfunktion
Hi
Eine Alternative, die auch funktioniert wäre der Upgrade auf Dovecot und MangedSieve sowie Roundcube als Webmail. RC hat zwei Plugins, welche Sieve-Regeln erstellen. Damit ist Vacation-Mail, Mailfilterung, Weiterleitung etc. möglich.
Ausserdem gibts ein weiteres Plugin (zu finden hier im Forum), welches jedem einzelnen Mail-User ermöglicht, sein PW zu wechseln...

@joximu... bei der Gelegenheit, was waren deine Beweggründe auf Horde anstatt auf RC zu setzen? Vllt schreibst ein paar Worte dazu, wäre nett^^

glg
08-11-2010 08:23 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #8
RE: Webmail mit Abwesenheitsfunktion
@grisu
etwas offtopic, warum ich "horde" installiere...

einfacher Grund: mir ist das Projekt schon seit Jahren bekannt (knapp 10 Jahre), mir persönlich gefällt die Anordnung und der Leistungsumfang zB. des Webmail-Groupware Paketes.
Roundcube gabs damals nicht.

Heute sieht es anders aus und vielleicht kann ich den Kunden, denen Horde zu überladen ist, ein Roundcube anbieten (den Squirrel mag ich gar nicht - aber es gibt auch hier Kunden, die das toll finden :-)

Hab auch schonmal atmail versucht (das wird von einem bekannten Anbieter in CH auch benutzt), aber die kommerzielle Version lief nicht auf Anhieb und die OS-Version war schon recht alt....
RC schau ich mir mal an... irgendwann... :-)

/J
08-11-2010 08:40 PM
Visit this user's website Find all posts by this user Quote this message in a reply
sunfire Offline
Junior Member
*

Posts: 11
Joined: Aug 2008
Reputation: 0
Post: #9
RE: Webmail mit Abwesenheitsfunktion
Hallo,

ich muss leider das Post nochmal vor zerren.

Ich habe die besagten Änderungen auch vorgenommen um Vacation an Ispcp zu koppeln.
Allerdings werden, wenn ich in Vacation eine Abwesenheitsmeldung setze, die Umlaute nicht mehr richtig codiert in Ispcp angezeigt.

Woran kann das liegen, wenn doch beides im utf-8 Modus werkelt?

Gruss sunfire
02-23-2011 12:14 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)