Autoresponder with Roundcube and Goldfish

geschrieben von David Müller am 16.03.2011 in Kategorie Web Entwicklung | 9 Kommentare

When you use the famous Goldfish autoresponder and got the webmail client Roundcube installed, you might realize that there is no native option in roundcube where users are able to configure the autoresponder by themselves. We have extended a roundcube plugin that is able to do this very task. Once installed, the plugin will be available under settings in roundcube and looks like this:

auto-responder

Originally, Eugene Sklyar wrote a tutorial in which he described the installation of his self-written roundcube autoresponder plugin. Now, we have extended and improved this plugin. Futhermore, some (rather severe) bugs have been fixed and some features were added - but of course, all props for the original plugin go to Eugene Sklyar!

Installation

At first, you have to modify the autoresponder - table where all auto replies are being saved. We will add a force_disabled field that activates / deactivates the autoresponder for a user.

For that, we use the following sql-query (there is also a CREATE-table statement included in the download archive that you find at the very bottom of this post):

ALTER TABLE autoresponder ADD `force_disabled` tinyint(4) NOT NULL default '1' AFTER enabled;

Now, the goldfish-script has to be changed (in our case located at /root/goldfish.php). Search for $conf['q_forwardings'] and replace that line with

$conf['q_forwardings'] = "SELECT * FROM `autoresponder` WHERE `enabled` = 1 AND `force_disabled` = 0";

Next, the line with $conf['q_enable_forwarding'] has to be changed to

$conf['q_enable_forwarding'] = "UPDATE `autoresponder` SET `enabled` = 1 WHERE `from` <= CURDATE() AND (`to` >= CURDATE() OR `to`='0000-00-00');";

At next, download the package and move the autoreply-folder to your roundcube plugins-directory.

Now, the config.inc.php - file of the plugin has to be edited. Make sure that you change the $rcmail_config['autoreply_db_dsn'] line to reflect your situation.

The last configuration step is to edit the roundcube config at config/main.inc.php. Here you have to add the autoresponder-plugin to $rcmail_config['plugins']

In our case, it looks like this:   

$rcmail_config['plugins'] = array('myothercoolplugin', 'autoreply');

That's it!

Okay, the setup is done. After login, you will find a new tab "Auto Reply" under Settings. A German translation is available. Feel free to ask / criticize / use the plugin. Again, special thanks to Eugene for his useful script.

Empfehlen Sie den Artikel weiter!

Kommentare als RSS Feed abonnieren Kommentare

  1. Sevket Sevket
    Geschrieben am 22.03.2011 14:23
    Antworten
    Thanks for the post in English and I hope you keep posting in English sometimes. I should learn some Deutsch I guess, living in Frankfurt without Deutsch is hard :)
  2. Geschrieben am 30.07.2011 10:38
    Antworten
    Being a newbie with linux and having finally made the modified goldfish autoreplywork with this modified plugin, using roundcube .5.3, I find the ability to create ordinary folders vanishes. To confirm I removed all plugins except the autoreply, and then took this out as well to show things corrected. What do I need to do? Is it because of some difference in the hooks in the 0.5.3 release?
  3. Geschrieben am 30.07.2011 10:45
    Antworten
    I am a linux newbie. Having finally made the modified goldfish autoreplywork with this modified plugin, using roundcube .5.3, I find the ability to create ordinary folders vanishes. To confirm I removed all plugins except the autoreply. Then took that out as well to show the folders creation reappeared. Is this due to a change in the program in roundcube 0.5.3? Do I need to change something to allow it to sit happily with the autoresponder? Thanks
  4. Tom Tom
    Geschrieben am 25.08.2011 12:36
    Antworten
    I'm having the same problem. When autoreply plugin is enabled, the 'create folder' input field is disabled.

    Maybe some code from autoreply plugin that is overzealous and also disabled other fields?
  5. Tom Tom
    Geschrieben am 25.08.2011 12:59
    Antworten
    I found the solution:
    there is a javascript file that changes all class="boxcontent" fields to be disabled/enabled.

    You can change the code in autoreply module to use "autoreplyboxcontent" as class instead.
    And then also copy/paste the CSS info for "boxcontent" class to "autoreplyboxcontent" class




    1) change line 165 of autoreply.php:
    ------------------------
    html::div(array('class' => 'autoreplyboxcontent'), html::p(null, $this->gettext('plugin_explanation')) .$table->show() .
    ------------------------




    2) change line 15 of autoreply.js:
    ------------------------
    var fields = $(".autoreplyboxcontent input[type=text], .autoreplyboxcontent textarea");
    ------------------------


    3) in skins/default/common.css (or whatever skin you're using)
    you copy/paste all CSS code for .boxcontent to the same for .autoreplyboxcontent:
    ------------------------
    .autoreplyboxcontent
    {
    padding: 15px 10px 10px 10px;
    background-color: #F2F2F2;
    }

    .autoreplyboxcontent table td.title
    {
    color: #666;
    padding-right: 10px;
    }
    ------------------------

  6. Adrianh Adrianh
    Geschrieben am 26.08.2011 08:16
    Antworten
    Thanks. I would never have worked that out.
  7. Adrianh Adrianh
    Geschrieben am 29.08.2011 14:25
    Antworten
    OK. So I had it all working. It has suddenly stopped and the logs show that the return email address is now foreshortened leaving the laste letter off the address and includes the "rom:" from "from:" preceding it. I presume this is all something to do with the parsing of the address. I have moved to roundcube 0.6, and am just using the autoreply plugin. It was working with this but has now stopped and shows this abnormal return address for the autoresponder. I wish I knew more about the programming I am afraid.
  8. Adrianh Adrianh
    Geschrieben am 31.08.2011 20:58
    Antworten
    Ok. It seems that this occurs when emails are just using the local domain. If I send an email from an address outside the local domain, then the response is addressed correctly and is returned , but not if emails are from the same localhost domain, in-house so to speak. Ideas?
  9. Adrian Heagerty Adrian Heagerty
    Über Facebook Connect authentifiziert | Geschrieben am 03.09.2011 18:26
    Antworten
    The same was reported in a query in 2009 here:-
    http://groups.google.com/group/goldfish-user/browse_thread/thread/be60a8b0ca8fa5dd#. However there was no reponse to the questions I am afraid

Schreiben Sie einen Kommentar:

Gravatar

Wenn Sie sich nicht über Facebook Connect anmelden, verwenden wir als Profilbild den Gravatar Ihrer E-Mail Adresse. Klicken Sie hier, um mehr über Gravatare zu erfahren.

Avatar