Roundcube Community Forum

Release Support => Requests => Topic started by: Dshow on April 23, 2007, 10:43:54 AM

Title: Autoresponder
Post by: Dshow on April 23, 2007, 10:43:54 AM
Hi,
is there planned an autoresponder function in the near future (within next months)?

Thanks

Dshow
Title: Re: Autoresponder
Post by: Julien on May 26, 2007, 04:12:11 PM
Quote from: Dshow
Hi,
is there planned an autoresponder function in the near future (within next months)?

Thanks

Dshow

This is not a webmail-side function, but mail server side !
Title: Re: Autoresponder
Post by: sardzent on June 19, 2007, 04:25:24 AM
ok but plugin which will be able to connect to proper database and enable some field and enter autoreply text ?

it would be very nice to have something like this
Title: Re: Autoresponder
Post by: varver on July 04, 2007, 05:18:32 PM
Well, as far as I know it is implemented on postfix admin.
vacation they call it. Easy to activate.
I like roundcube cus most och the major basic funktions are handled by the smtp/imap server.
Roundcube only hooks up to it.

// Varver
Title: Re: Autoresponder
Post by: sardzent on July 05, 2007, 07:56:32 AM
I wrote my own plugin which connect direct to SQL database.
Now clients can manage almost all settings via RC
(http://)
Title: Re: Autoresponder
Post by: SKaero on July 05, 2007, 07:27:49 PM
Nice! Can you post this?
Title: Re: Autoresponder
Post by: sardzent on July 06, 2007, 04:53:47 AM
No problem
http://daniel.blogs.jebiemnieto.org/2007/07/06/roundcube-autoresponder-plugin/ (http://daniel.blogs.jebiemnieto.org/2007/07/06/roundcube-autoresponder-plugin/)

All written in polish language but if some info needed please just contact or as a comment or as a reply at this forum
Title: Re: Autoresponder
Post by: SKaero on July 06, 2007, 05:07:36 AM
Wow Thanks! looks good! ;)
Title: Re: Autoresponder
Post by: santanna on July 15, 2007, 08:05:50 PM
Hi, i don't understand this part:

Tutaj mała uwaga ponieważ pojawiła się tajemnicza zmienna $_SESSION['adnet_id']. Jest to zmienna sesyjna przypisywana w funkcji function rcmail_login($user, $pass, $host=NULL) w pliku program/include/main.inc, przechowuje ona unikalny id użytkownika w tableli mail_accounts z wszystkimi ustawieniami, w tym autoodpowiedzi (kolumny autoreplay_set oraz autoreplay_value).

thanks.

Title: Re: Autoresponder
Post by: sardzent on July 16, 2007, 10:10:46 AM
$_SESSION['adnet_id'] is my variable in which I store uniq ID in table with all users. This value is set in function rcmail_login after succesfull login (in file program/include/main.inc). Having quick access to user id (in table with user accounts i have no email, domain makes easy to update table setting autoreplay_set and autoreplay_value.
Title: Re: Autoresponder
Post by: tille on July 22, 2007, 11:21:55 AM
hi there,
this autoresponder would be exacly what I am looking for - but now I'm only wondering if it actually would also work, if roundcube is not open..? Or asked differently: does the plugin take care of incoming mails 'in the background'..? ..so would it be possible to send something like a 'out of office' auto-remail even if I'm not logged in to roundcube..?

..sorry, if my question sounds a bit desperate - but I am acually quite a bit desperate about this..:]

greetz, till..
Title: Re: Autoresponder
Post by: sardzent on July 22, 2007, 12:52:50 PM
Yes
Autoresponder function is not made by RC but by mail server, and this plugin only updates fileds in database from which mta (exim in my case) "reads" user accounts. As you see RC doesn't have to be open, because RoundCube isn't sending replys
Title: Re: Autoresponder
Post by: tille on July 23, 2007, 08:53:41 AM
I just checked with my provider - but they won't give me much support on implementing the plugin.. and even though I am actually living quite close to Poland (Berlin) I don't know much Polish - my Polish language knowledge is not really existing.. - well - ..sooo anyways - would there be any chance you would/could provide something like a 'how-to' or 'install.txt' or whatever instructions are needed to install/implement this plugin in English..? If don't like the idea of writing long texts in English I might even try to hire some friend of a friend who could probably help translating.. - ..hmm. What do you think..?

greetings, till..
Title: Re: Autoresponder
Post by: sardzent on July 23, 2007, 01:01:52 PM
hmmm ok if you insist :)
i'll try to find some time tommorow after work
Title: Re: Autoresponder
Post by: tille on July 23, 2007, 02:15:40 PM
after work..? ..so what do you then work - if you do things like this after work..? anyways - sounds very promissing.. :D

I think you could actually even also try to get some donations out from this - at least after my opinion I can't be the only one waiting for something like this - and if you put it on your website next to some PayPal-donate button or something similar.. - ..who knows..:]

I was even wondering if I could/should then also provide a german translation..?

well- whatever.. - ..I am probably just a bit too curious at this very moment.. `.´

greetings, till..
Title: Re: Autoresponder
Post by: sardzent on July 23, 2007, 02:36:52 PM
:) no no no no money it's for the community :)

as translations ... well you just have to modify two files
   program/localization/en_US/labels.inc
          $labels[’autoreply’]
          $labels[’titleautoreply’]
          $labels[’activeautoreply’]
          $labels[’textautoreply’]
and
   program/localization/en_US/messages.inc
          $messages[’autoreplymodified’]
          $messages[’noautoreply’]

but you have to remember to encode it using UTF-8

ehh what do i do at work ? :) let me say i'm not a php programmer so please don't blame me for dirty hacks :)
Title: Re: Autoresponder
Post by: sardzent on July 23, 2007, 03:24:54 PM
tada :)

http://daniel.blogs.jebiemnieto.org/files/2007/07/rc_autoreplyhowto.txt
Title: Re: Autoresponder
Post by: tille on July 23, 2007, 09:30:32 PM
hi sardzent,

first of all: thank you very much that you took some of your 'after work time' already today..!

..I tried - but could not really succeed.. yet.
When I click on the Autoreply-Tab in the RC-Interface it sends me to a completely empty page - no error message, no nothing in the source code - just blank....

I actually followed step 0 to 9 and I think I did everything ok - only two or actually three questions arose on the way.. the first question would be a very small/minor problem, the second one already a bit larger - and the third one I don't really understand at all.. - ..here we go:

1) under step2 you suggest to edit the code of func.inc - I fear/suppose there' one comma ->,<- too much at the end of the line
   'autoreply' => 'rcmail_autoreply_form',
 and I suggest that in the end it should probably look like this:

// register UI objects
$OUTPUT->add_handlers(array(
 'userprefs' => 'rcmail_user_prefs_form',
 'itentitieslist' => 'rcmail_identities_list',
 'autoreply' => 'rcmail_autoreply_form'
));

2) under step5 I was editing both functions function rcmail_save_autoreply and rcmail_autoreply_form($attrib) in autoreply.inc so that it suits my db-login like something like this:

   @ $DB_1 = new mysqli('localhost', 'dbusername', 'dbpassword', 'dbname');

..actually dbusername and dbname are the same at my db - so it didn't really matter if I mixed them..

anyways - I am not sure if I should also change

   $adnet_id = $_SESSION['adnet_id'];

to something else..? is 'adnet_id' used everywhere else..? ..or do I need to change even more in these two functions..?

3) and last but not least - I still don't really have the slightest idea how this plug-in actually works - does it still need it's own db-tables..? Or does it actually try to contact/update the actual mailserver-db-tables..? The reason I'm asking are these lines:

   $RESULT_1 = $DB_1->query('SELECT autoreplay_set , autoreplay_value FROM mail_accounts WHERE id = \'' . $adnet_id . '\'');

..where a db-table 'mail_accounts' is needed....

Well well well.. - ..I hope you still got the nerves and some 'after work time' left..?

greetings from berlin, till..
Title: Re: Autoresponder
Post by: sardzent on July 24, 2007, 02:31:19 AM
hello again ;D

1. you are right it shuld be

// register UI objects
$OUTPUT->add_handlers(array(
 'userprefs' => 'rcmail_user_prefs_form',
 'itentitieslist' => 'rcmail_identities_list',
 'autoreply' => 'rcmail_autoreply_form'
));

i made a mistake, because i have few more plugins so ... it was my mistake :)

2. $adnet_id = $_SESSION['adnet_id'];
this is variable in which i store user id in mta table, it's there only to make easy to update my table, if you have simmilar table or relations in database just edit this, if you have in mta table email address then just skip it ;)

3. this plugin connects direct to mta database and updates one table (mail_accounts), changes rows "autoreplay_set" and "autoreplay_value", but to edit/change this values first i'm getting it from table and puts on template.

As you can see you have to modify not only SELECT but also UPDATE query

P.S. yes if there is a blank page there's php error, this comma you wrote about.

greetings from warsaw

Title: Re: Autoresponder
Post by: tille on July 24, 2007, 05:11:23 AM
hello again  :)

well well welll - I think this is now the right moment to contact+ask my provider again.. my problems might arise from the mta table you mentioned - which I cant even see.. so I don't know if the plugin can connect to it - and if the field names are correct and so on..

I'll keep you updated and write whatever comes out from this.. - ..I just hope so much that I'll get it workin somehow.. :D

greetings, t..
Title: Re: Autoresponder
Post by: sardzent on July 24, 2007, 05:26:04 AM
no problem :)
I glad to hear that i was usefull ;)
Title: Re: Autoresponder
Post by: tille on July 24, 2007, 08:27:07 PM
well - still not there yet......

now the support team of my provider said, that they're using a config-file to do the autoresponder trick.. So basically it would be necessary to modify that - which on the other hand they would not allow me.

If I understood them correctly One way/possibility could still be that we're trying to do the trick through a bridge like db-table.. which I could modify through your your script and which would then write to their config-file..

Well - would it be possible that you could tell me/ send me the structure of that db-table you're writing to..? And/or maybe you could also tell me a little bit more about the "mta database" you were mentioning.. I think neither I nor them know what that is and what mta stands for (I suppose it's not the http://www.mta.info ;) )

greetings again, till..

PS: one idea just popped up: do you think using a cron job for a 'fake' responder could be prommissing/practical..? ..I am basically going to develop some more drupal websites - and I would anyways need the webmail+responder for those only.. and there seems to be a rc-module and also some other webmail-modules already -- maybe that could be some way around the 'bridge'-problem..:]
Title: Re: Autoresponder
Post by: sardzent on July 25, 2007, 03:52:59 AM
Hello again :)

Hmm autoresponder content in file and mta daemon checks if the file is present and then serve a content of it .. i suppose

My database ... needed tables and views

-- users mailboxes
CREATE TABLE mail_accounts (
    id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    admin_id INT(11) UNSIGNED NOT NULL,
    active INT(1) NOT NULL DEFAULT '1',
    locked INT(1) NOT NULL DEFAULT '0',
    user_name VARCHAR(255) NOT NULL DEFAULT '',
    domain_id INT(11) UNSIGNED NOT NULL,
    forward_value VARCHAR(255) NOT NULL DEFAULT '',
    alias_value TEXT NOT NULL DEFAULT '',
    permited_mode INT(1) NOT NULL DEFAULT '0',
    permited_senders TEXT NOT NULL DEFAULT '',
    autoreplay_set INT(1) NOT NULL DEFAULT '0',
    autoreplay_days INT(5) NOT NULL DEFAULT '1',
    autoreplay_value TEXT NOT NULL DEFAULT '',
    homedir VARCHAR(512) NOT NULL DEFAULT '/var/mail/boxes',
    maildir VARCHAR(512) NOT NULL DEFAULT '/var/mail/boxes',
    spam_scan INT(1) NOT NULL DEFAULT '1',
    spam_purge INT(1) NOT NULL DEFAULT '1',
    spam_folder INT(1) NOT NULL DEFAULT '0',
    spam_report_days INT(2) NOT NULL DEFAULT '0',
    remote_account INT(1) NOT NULL DEFAULT '0',
    remote_server VARCHAR(128) NOT NULL DEFAULT '',
    fullname VARCHAR(255) NOT NULL DEFAULT '',
    description TEXT NOT NULL DEFAULT '',
    uid INT(6) UNSIGNED NOT NULL DEFAULT '79',
    gid INT(6) UNSIGNED NOT NULL DEFAULT '79',
    passwd_crypt VARCHAR(128) NOT NULL DEFAULT '',
    passwd_plain VARCHAR(128) NOT NULL DEFAULT '',
    bandwidth_limit INT(5) UNSIGNED NOT NULL DEFAULT '1',
    message_limit INT(5) UNSIGNED NOT NULL DEFAULT '1',
    quota_limit INT(5) UNSIGNED NOT NULL DEFAULT '1',
    quota_usage INT(16) NOT NULL DEFAULT '0',
    quota_warning INT(3) NOT NULL DEFAULT '95',
    transfer_speed INT(5) UNSIGNED NOT NULL DEFAULT '1',
    forget_question VARCHAR(255) NOT NULL DEFAULT 'Favorite ISP',
    forget_anwser TEXT,
    imap_enabled INT(1) NOT NULL DEFAULT '1',
    pop3_enabled INT(1) NOT NULL DEFAULT '1',
    webmail_enabled INT(1) NOT NULL DEFAULT '1',
    add_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mod_date TIMESTAMP NOT NULL DEFAULT '2020-01-01 23:59:00',
    exp_date TIMESTAMP NOT NULL DEFAULT '2020-01-01 23:59:00',
    CHECK ( active IN ('1','0') ),
    CHECK ( locked IN ('1','0') ),
    CHECK ( permited_mode IN ('1','0') ),
    CHECK ( autoreplay_set IN ('1','0') ),
    CHECK ( spam_scan IN ('1','0') ),
    CHECK ( spam_purge IN ('1','0') ),
    CHECK ( spam_folder IN ('1','0') ),
    CHECK ( remote_account IN ('1','0') ),
    CHECK ( imap_enabled IN ('1','0') ),
    CHECK ( pop3_enabled IN ('1','0') ),
    CHECK ( webmail_enabled IN ('1','0') ),
    PRIMARY KEY(id),
    CONSTRAINT mail_accounts_key1 FOREIGN KEY (admin_id) REFERENCES user_accounts(id) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT mail_accounts_key2 FOREIGN KEY (domain_id) REFERENCES mail_domains(id) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT mail_accounts_key3 FOREIGN KEY (bandwidth_limit) REFERENCES bandwidth_limits(id) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT mail_accounts_key4 FOREIGN KEY (message_limit) REFERENCES quota_space(id) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT mail_accounts_key5 FOREIGN KEY (quota_limit) REFERENCES quota_space(id) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT mail_accounts_key6 FOREIGN KEY (transfer_speed) REFERENCES transfer_limits(id) ON DELETE CASCADE ON UPDATE CASCADE,
    UNIQUE KEY mail_accounts_UIDX1(user_name,domain_id)
) TYPE=InnoDB COMMENT='Mail Accounts';


-- imap
CREATE VIEW v_daemon AS SELECT mail_accounts.id AS id , mail_accounts.user_name AS account , v_domain_real.domain AS domain , mail_accounts.passwd_crypt AS passwd_crypt , mail_accounts.passwd_plain AS passwd_plain , mail_accounts.uid AS uid , mail_accounts.gid AS gid , CONCAT(mail_accounts.user_name,'@',v_domain_real.domain) AS email , mail_accounts.homedir AS homedir ,mail_accounts.fullname AS fullname , mail_accounts.maildir AS maildir , IF(quota_space.value !='0',CONCAT(quota_space.value,'M'),quota_space.value) AS quota , mail_accounts.locked AS locked FROM mail_accounts JOIN ( v_domain_real , quota_space ) ON ( mail_accounts.domain_id = v_domain_real.id AND mail_accounts.quota_limit = quota_space.id ) WHERE mail_accounts.exp_date > NOW() AND mail_accounts.active = '1' AND mail_accounts.alias_value = '' ;


first one is a table where to i save autoresponder settings and the second one is used for getting user is (in RC plugin called $adnet_id)

mta stands for "message transfer agent" :)
"mta database" in my case means that all settings needed to handle mail processing are stored in database (MySQL) and MTA daemon (exim) is "reading" whole configuration of accounts from database (no need to reload after changes for example)

you wrote about some "bridge", parsing from database to file ... it's nice beacuse you don't have to develop your own tools to handle autoresponse (all done by mta daemon), but parsing takes some time, and have to be done every 5 min for example, which is not the best solution, beacuse it needs cron, memory, cpu and temporary database / table.

maybe (if apache have access to path where autoresponder config files are stored) you should modify RC plugin to direct create / edit autoreponder files? get some template from your hoster and try :)
Title: Re: Autoresponder
Post by: tille on July 25, 2007, 11:43:04 AM
thank you very very much for all you efforts - at the moment I just can't see how I'm going to be able to implement your plugin with my website/provider.. Now they even have installed RC and the plugin on some test account - but the problem seems to be that the config-file is not reachable for the script - probably due to security reasons... :-\

Well - now I really don't know what to do - maybe I'll try to find someone who could write some 'fake autoresponder' that would work through a dedicated cron job...? ..we'll see..... - ..I'll keep you updated..

greetings +best wishes, till..

Title: Re: Autoresponder
Post by: sardzent on July 25, 2007, 12:17:37 PM
fake autoresponder in cron is not a good idea,
maybe better set some store and forward to another account and at this account run via procmail for example script which will parse incoming message and then send replay to sender ?
Title: Re: Autoresponder
Post by: tille on July 25, 2007, 12:54:21 PM
"fake autoresponder in cron is not a good idea" - that's also what my provider said - but why should it not be a good idea..?! ..if I just check for new mail twice an hour..? ..at least I would hope that this would be a working alternative...:]

the other option you suggested is probably not really practicable for my purpose: having dozends (one day maybe even hundrets) of users that would want to take controll of their autoresponders.. I fear that I would end up having the same problem I have right now: either I have one interface with one password which I would have to hand out to all the users - or I would need one person that would take care of all the users' autoresponder wishes - or did I understand something wrong..?

greetings, till..
Title: Re: Autoresponder
Post by: sardzent on July 25, 2007, 03:24:47 PM
why it's not good idea ? hmmm let suppose you checked new emails via pop3 and send response. user did not download email, you checking once again and sending new message or you will have to manage other database with ids of messages that response you already send, whats more you should also manage how offen mta daemon should send messages as a respond (for example once per day to every sender), and of couse to ignore bounces and mailing lists. and the most important is that cron task will have rewrite / set sender address while sending emails, and this may be disallowed by your hoster :) every time getting username, password then do smtp auth and send or maybe you would like to use as a render address one global address (for example out@domain.foo) for emails.

hmmm forwarding do "special" account maybe isn't so bad ofter all.
one selected email account with procmail to manage all autoresponses. i don't know how does you database look like, but maybe you cat update direct via php script table with this setting (then mod my plugin), and that would be easy to do.

greeting from windy warsaw
Title: Re: Autoresponder
Post by: Florianer on July 30, 2007, 06:39:01 AM
@Tille: Just a little question: Who is your provider?
I'm also interested in an autoresponder and I'm working on it... OK, at first, on the background info. I'm writing with the All-Inkl.com Support and maybe I have something I/we can work with. But don't expect it tomorrow ^^ - just, if you are interested in progress: I'm working on the AXAJ Head Rush book and I'm now on page 167 of 400. Hope, I get it soon. If so and I have enough time, I may try to do my first RC work starting with this autoresponder. (And go on to help with these nice calendar plug in.)
Title: Re: Autoresponder
Post by: bradyjfrey on August 01, 2007, 01:35:36 PM
Daniel, I just sent you an email from my corporate office - we'd be willing to pay your time to customize this into english, with a how-to, install instructions, and stability testing. Caveat of course is that you give it right back to the open source community:) Please contact me here or from the email I sent if you're interested. Thank you, I've been waiting for something like this - especially since Postfix AutoResponder implementation leaves little to be desired on the user end.

FYI, more information on me:
http://dotfive.com/talent/
http://www.google.com/search?client=safari&rls=en&q=%22brady+J+frey%22&ie=UTF-8&oe=UTF-8

This would be for the large client I referenced in the email - we're located in San Francisco California.
Title: Re: Autoresponder
Post by: tille on August 01, 2007, 03:34:29 PM
@ Florianer: Hello +hallo to Karlsruhe - from Berlin..:]

..wellwellwell - my provider is also all-inkl..!! :D
Since Daniel's script won't work over there - or actually 'they' won't let it work - I am very much interested in a workaround that would work with all-inkl.. They also suggested that I could do 'my own' implementation - and I actually thought of learning from Daniel's approach - but actually at the moment I am still stuck in a pile of unpaid bills on the one side and unfinished projects on the other side - so I hardly have the time and space I'd love to have to get into this....

But maybe I can let you already know what I got from the all-inkls: if one would provide them with a scrip (form) that would send the username, the password, the autoresponder-subject and -text then they would be able to 'catch' this input and 'forward' it to the appropriate script.. - ..at least that's what they told me..:]

Hope you'll be more successful with this than I was so far..?¿ ..and yes - I won't expect much anything for tomorrow anyways.. :)

greeetings, till..
Title: Re: Autoresponder
Post by: sardzent on August 01, 2007, 04:23:59 PM
to bradyjfrey

     thank you for contact and i send email :)

to tille
 
    maybe you should think about dedicated vserver and set up your own system with postfix or exim with mysql database and as a webmail RC :)
Title: Re: Autoresponder
Post by: marinero.f on November 15, 2007, 04:56:50 PM
thanks Sardzent for your work ... i succeed installing the auto-response tab but i have some problems and after a lot of hours i decided to post here. Hoping you could help me ....

i ve followed your instructions , but i've always the same message :'Autoreponder active but no text provided.'
I succedeed connecting your pluggin with Hmail server . On roundcube i can see my vacation settings ("message" and "checkbox") but what ever i do, when i press save button i get this message.

I'm working with Rcube RC2 maybe it's the problem , well i've tried many times but without success...
On my test i've noticed that it could came from the check box (how we know if the checkbox is checked or not ?) the return answer seem to be always unchecked.
Or The other option could came from this line
if (rcmail_sauve_autoreply(get_input_value('activation_autoreply', RCUBE_INPUT_POST), get_input_value('message_autoreply', RCUBE_INPUT_POST)))

I have another question : where can i find the definition of rc functions (like "RCUBE_INPUT_POST").

Below my code it could help:


  /////////FONCTION DE SAUVEGARDE ET INJECTION DES DONNEES///////

function rcmail_sauve_autoreply($active, $message){
   global $DB, $CONFIG, $OUTPUT;
   $id_autorep= $_SESSION['username'];
   @ $DB_1 = new mysqli('localhost', 'userdatabase', 'pass_secure', 'hmail');
         if (mysqli_connect_errno()) {
      return false;
   }
   $RESULT_1 = $DB_1->query('UPDATE hm_accounts SET accountvacationmessageon =\'' . $active . '\', accountvacationmessage =\'' . $message . '\', mod_date=NOW() WHERE accountaddress = \'' . $id_autorep . '\'');
   if ( $RESULT_1 ) {
      return true;
   } else {
      return false;
   }
   $DB_1->close();
}
  /////////FORMULAIRE TEMPLATE///////
 
function rcmail_autoreply_form($attrib){
   global $DB, $CONFIG, $OUTPUT;
   $id_autorep= $_SESSION['username'];

   list($form_start, $form_end) = get_form_tags($attrib, 'sauve-autoreply');
   unset($attrib['form']);
   if (!$attrib['id'])
      $attrib['id'] = 'rcmSavautoreply';

  /////////RECUPERATION DES DONNEES///////       
      
   @ $DB_1 = new mysqli('localhost', 'userdatabase', 'pass_secure', 'hmail');
   $RESULT_1 = $DB_1->query('SELECT accountvacationmessageon , accountvacationmessage FROM hm_accounts WHERE accountaddress = \'' . $id_autorep . '\'');
   $ROWS_1 = $RESULT_1->num_rows;
   if ( $ROWS_1 == 1 ) {
      $ROW_3 = $RESULT_1->fetch_assoc();
      $got_accountvacationmessageon = $ROW_3['accountvacationmessageon'];
      $got_accountvacationmessage = $ROW_3['accountvacationmessage'];
   } else {
      $got_accountvacationmessageon = 0;
      $got_accountvacationmessage = '';
   }
   $DB_1->close();



   $attrib['name'] = $attrib['id'];

   $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'cellpadding', 'cellspacing', 'border', 'summary'));

   $a_show_cols = array('activation_autoreply'   => array('type' => 'checkbox', 'label' => 'activation_autoreply'),
            'message_autoreply'   => array('type' => 'textarea', 'size' => "300", 'rows' => "6")
         );


   $out = "$form_start\n\n";
      
   $field_id = 'activation_autoreply';
   $attrib['id'] = $field_id;
  $value = rcmail_get_edit_field($field_id, $got_accountvacationmessageon, $attrib, 'checkbox');
  $out .= sprintf("%s\n",
   $field_id,
      Q(rcube_label('activeautoreply')),
          $value);

   //
   $field_id = 'message_autoreply';
   $attrib['size'] = "60";
   $attrib['rows'] = "8";
   $attrib['id'] = $field_id;
   $value = rcmail_get_edit_field($field_id, $got_accountvacationmessage, $attrib, 'textarea');
   $out .= sprintf("%s\n",
      $field_id,
      Q(rcube_label('textautoreply')),
      $value);

   $out .= "\n$form_end";

   return $out;
}
  /////////CONTROLE DU BOUTON ENVOIE ///////
if ($_action=='sauve-autoreply') {

   if ( (($_POST['activation_autoreply']) == 1) && (strlen($_POST['message_autoreply']) < 2 ) ) {
      $OUTPUT->show_message('autoreplytoolow', 'error');
   } else {
      if (rcmail_sauve_autoreply(get_input_value('activation_autoreply', RCUBE_INPUT_POST), get_input_value('message_autoreply', RCUBE_INPUT_POST)))
         $OUTPUT->show_message('autoreplymodified', 'confirmation');
      else
         $OUTPUT->show_message('noautoreply', 'error');
   }
   
   rcmail_overwrite_action('autoreply');
}

parse_template('autoreply');
?>


Many users are looking for this pluggin to use it with Hmail server , it could help many users....
thanks for your help .... :)


running RC2/Hmail Server
Title: Re: Autoresponder
Post by: blair.sawler on February 26, 2008, 11:11:39 PM
Hi

This is great, I have been looking for this functionality. I am having a couple of issues though.

When I login, I get the following errors:

Line: 302
Char: 7
Error: Expected '}'

Line: 36
Char: 1
Error: 'rcube_webmail' is undefined
Code: 0

Any assistance would be appreciated!
Title: Re: Autoresponder
Post by: blair.sawler on February 27, 2008, 07:21:01 AM
Sorry I spoke to soon, I missed a "}"

Now I just have to fix the error where it does not think I typed any text in....
Title: Re: Autoresponder
Post by: sardzent on March 25, 2008, 09:13:38 AM
Quote from: blair.sawler
Sorry I spoke to soon, I missed a "}"

Now I just have to fix the error where it does not think I typed any text in....

This is only a problem about conditions with value in textfield, check the checkbox and then check amount of characters places as a autorespond text.
Title: Re: Autoresponder
Post by: climaxy on March 26, 2008, 11:27:16 AM
This is really great but unfortunately, after I've followed the steps according the how to, I face now the problem that the db connection within autoreply.inc is done via mysql....but I've a PostgreSQL DB running in the background....

As I'm not that proficient in php, my question is, if it's possible for someone, to provide the autoreply.inc also for PostgreSQL or in general with a SQL abstraction layer, so that in the end effect you've just to choose at the beginning of the config, which db type is used.....

I'm searchin' already desperately for an Autoresponder plugin and this one seems to be perfect (if it would work also with Pgsql :'( )
Please help!

thx&greetz,
climaxy
Title: Re: Autoresponder
Post by: sardzent on March 27, 2008, 10:23:42 AM
hmmm but there are only two connection to mysql, all do via mysqli (yep i should use more flexible mechanism but ... :)
please just have a look for http://pl2.php.net/manual/en/ref.pgsql.php (http://pl2.php.net/manual/en/ref.pgsql.php) there are examples how to write some simple functions.
If any big troubles just ask :)
Title: Re: Autoresponder
Post by: blair.sawler on April 07, 2008, 08:28:19 PM
Don't think that is the issue sardznet,

I had this typed in:

test 12345 Hello!

Nice to see you!

You mentioned to me that we need a connection to the MTA database, has anyone gotten this working on a shared hosting platform?


Quote from: sardzent
Quote from: blair.sawler
Sorry I spoke to soon, I missed a "}"

Now I just have to fix the error where it does not think I typed any text in....

This is only a problem about conditions with value in textfield, check the checkbox and then check amount of characters places as a autorespond text.
Title: Latest release of RoundCube?
Post by: jcip on June 12, 2008, 10:06:59 AM
Does this autoresponder still work with the latest version of RoundCube v0.1.1?
Title: Autoresponder
Post by: sardzent on June 20, 2008, 11:32:56 AM
Quote from: jcip;12538
Does this autoresponder still work with the latest version of RoundCube v0.1.1?


I don't know but I supose it does (maybe some small tuneup is needed)