6.0.0-git
2019-11-13

Diff for SorkVacationWithVpopmail between 4 and 5

+ Vacation with Vpopmail in SORK



The software used is:



* MTA: qmail/vpopmail with !MySQL backend - all domains loaded in vpopmail.vpopmail table

* vacation program: Autorespond

* Horde version: 3.1.3

* vacation version: 3.0



These changes will make sork vacations compatible with qmailadmin vacation changes.  So you can modify your vacation message from either location.



Like
Like the original Qmail Driver,driver, It still uses ftp to put the data into the user's 'home' directory. Personally, I use Pureftp it will do SQL auths and grab the home dir from SQL, you can also specify a uid (89 is usually vpopmail), and set the users chroot.   All your users will have ftp access to their Maildir with the own vpopmail username/password. I would suggest only binding Pureftp to 127.0.0.1 if you don't want your users to do that externally.



First,

First, get the vpopmailsql.php Driver,driver (attached to this page), and place into vacation/lib/Driver/ directory. Currently, it's located:  http://www.havokmon.com/stuff/horde/vacation/vpopmailsql.php.txt

Thisit in vacation/lib/Driver/. This file will do all the heavy lifting, but you will need to make a couple of changes to it. Change the vpopmail/vpoppass to be your Vpopmail !MySQL username password. Ultimately this driver should include  the code from sql.php driver to connect to the database, and your username/password will be in {{conf.php}}.



<code

<code type="php">

        if
if (!empty($alias)) {

            $alias
    $alias = $this->_makeEmailAddress($alias, $realm);

            if
    if ($alias === false) {

                return
        return false;

            }

        }



        $link
    }
}

$link = mysql_connect('localhost', 'vpopmail', 'vpoppass');

        if
if (!$link) {

                die('Could
    die('Could not connect: ' . mysql_error());

        }

</code>


}
</code>

Next, add the following to conf.php:

<code type="php">

$conf['server']['params']['default']['table'] = 'vpopmail.vpopmail';

$conf['server']['params']['default']['path_col'] = 'pw_dir';

$conf['server']['params']['default']['user_col'] = 'pw_name';

$conf['server']['params']['default']['domain_col'] = 'pw_domain';

$conf['vacation']['path'] = '/usr/local/bin/autorespond';

</code>

</code>

Make sure your autorespond is actually in the path. 



Finally, main.php needs to be modified to work with the vacation message format that autorespond uses.

An autorespond vacation message looks like:

<code>

From: email@home.com <newline>

Subject: Vacation <newline>

<newline>
<newline>
Text

<newline>
</code>

</code>



Finally,Download {{main155.diff}} from this page's attachment list and apply the following diffthe patch to main.php v1.55.(revision 1.55 from CVS). This will fix the display of the existing vacationvacation notice, andand properly submit a new one.



Diff is also here:

http://www.havokmon.com/stuff/horde/vacation/main155.diff



<code>

--- main.php    Thu May 31 09:32:42 2007

+++ mainold.php Fri Jun 22 07:42:45 2007

@@ -70,11 +70,10 @@

             }

         }

         $vacationmsg = Util::getFormData('mess', false);

+

         // Include the mail subject if the driver supports it.

-        $my_email = Auth::getAuth();

-        if ($conf['vacation']['subject']) {

-            $vacationtxt = 'From: ' . $my_email . "\n";

-            $vacationtxt .= 'Subject: ' . Util::getFormData('subject') . "\n\n" . $vacationmsg;

+        if ($conf['vacation']['subject']) {

+            $vacationtxt = 'Subject: ' . Util::getFormData('subject') . "\n" . $vacationmsg;

         } else {

             $vacationtxt = $vacationmsg;

         }

@@ -124,11 +123,11 @@

 $onVacation = false;

 if ($status == 'Y') {

     $curmessage = $driver->currentMessage($user, $realm, $pass);

-    $notification->push(_("Your vacation notice is currently enabled."), 'horde.success');

+    $notification->push(_("Your vacation notice is currently enabled."), 'horde.message');

     $onVacation = true;

 } elseif ($status == 'N') {

     $curmessage = $driver->currentMessage($user, $realm, $pass);

-    $notification->push(_("Your vacation notice is currently disabled."), 'horde.warning');

+    $notification->push(_("Your vacation notice is currently disabled."), 'horde.message');

 } else {

     // If the driver can't tell the difference between "disabled" and

     // "unknown", be inscrutable.

@@ -142,19 +141,11 @@

     if (preg_match('/^Subject: ([^\n]+)\n(.+)$/s', $curmessage, $matches)) {

         $cursubject = $matches[1];

         $curmessage = $matches[2];

-

     } else {

         $cursubject = '';

     }

 }



-if ($cursubject == ""){

-    if (empty($cursubject)){

-        list($curFrom,$cursubject,$curmessage)=split("[\n]",$curmessage,3);

-    }

-    list($subheader,$cursubject)=split(":",$cursubject,2);

-}

-

 $alias = Util::getFormData('alias');

 if (is_null($alias)) {

     $aliases = &Vacation_AliasDriver::singleton();

</code>