Roundcube webmail β Auto reply plugin
At the office we use a standard mailserver config with POP3, IMAP, SpamAssassin and Squirellmail for webmail on linux. At the place where I previously worked we had a default PLESK installation with Horde for webmail.
I usually just use IMAP for my e-mail within Outlook on my office computer and IMAP with Thunderbird when I’m home on my laptop with Ubuntu, but my laptop gave me some troubles at home so I took my girlfriends laptop and fired up my webmail.
Damn!, Squirellmail is so incredibly ugly and gui-unfriendly compared to Horde or any other webmail project you come across. Not only do the themes stink, but it misses out on several basic functionality like sieve filtering and per-user SpamAssassin preferences.
I had some spare time on my hands so I went looking for a Squirellmail alternative. Very quickly you will find that there aren’t that many (good) webmail clients around. There is GoogleMail, Horde, Roundcube, Zimbra and a few lesser known ones. GoogleMail isn’t an option since we don’t like to host our e-mail elsewhere, Zimbra isn’t because it is more of an collaboration suite then it is a webmail client and Horde isn’t an option once you compare it to Roundcube π
RoundCube is an excellent open source experience for an AJAX webmail, and what will really attract you to Roundcube is its advanced user interface with drag and drop functionnalities which make it very easy to organize your email. RoundCube Webmail is written in PHP and requires a MySQL database. The user interface is fully skinnable using XHTML and CSS 2. Roundcube also offers extensions in the form of plugins. This enables you to use SpamAssassin options per-user, Sievefiltering per-user, etc.
Roundcube was definitely the webmail program the fitted our needs most. We quickly installed it next to our Squirellmail installation. The installation was super-easy and super-fast. Then installed the ManageSieve and SpamAssassin plugins and I thought we were good to go.
Then a colleague mentioned that he couldn’t set a auto-reply from within RoundCube. He was planning to take a few days off and wanted to set an out-of-the-office notification. I quickly looked in the RoundCube repository for a auto-reply function but it is only available for a specific Windows mailserver. On the forums of RoundCube the programmers state that there will be no such official plugin or feature made available since they think it is not something the webmail program should manage.
I disagree.
I think users should be able to set their auto-reply message from within their webmail and not having to go trough Usermin or Webmin to do so.
Since SquirellMail DID have the auto-reply functionality available and SquirellMail also runs on PHP and MySQL I decided to just take that plugin and port it to RoundCube. I wrapped the whole thing in a RoundCube plugin format and voila, it works brilliantly.
The plugin writes a file to the users homedir where the SendMail server picks it up and fires the ‘Vacation’ plugin that sends an auto-reply.
Anyone who wants the plugin can download it here.
Update – If you can’t use FTP to put the forward files you may try using the squirrelmail_vacation_proxy program. Not that I do not support this program nor the use of it.
You may download it here.
Update – There is now a SourceForge project concerning this plugin. You can download the files there and contribute to it as well.
Support and questions can also be put in the projects forum.
I made a first attempt at redesigning the code: http://www.xs4all.nl/~jaspersl/vacation.txt . It’s far from being done but it gives you an idea about the structure of the code. I hope you like it so far.
I noticed there is already an hMail auto-reply plugin based on SQL but I want to have something more generic.
The idea is that each backend extends from Vacation. So one class per backend to keep clean code. I use the factory pattern to load the right class. The base class determines what needs to be done and works as a dispatcher.
The abstract base class garantuees that each deriving class implements certain methods. An interface could have been used if it wasn’t for the fact that those methods are required to be public.
I probably need to revamp vac_init.php as I’ll try to get rid of global variables.
Expect more in a few days…
Copied your updated plugin over the existing one, and saw the improvements, very sweet.
did a “yum install vsftpd”, “chkconfig vsftpd on”, and “service vsftpd restart” and the files started appearing in the home directories like magic, but no mail would deliver to that account anymore.
Mail log showed:
status=deferred (temporary failure. Command output: local: fatal: xecvp /usr/bin/vacation: No such file or directory )
Changed a line in config.php from:
$vacation_path = ‘/usr/bin/vacation’
to:
$vacation_path = ‘/usr/local/bin/vacation’
and the crowds started cheering. Everything works. Thanks a ton Peter for the plugin and the assistance. Lunch coming your way soon as i figure out where you live.
Hint: email me or post here your favorite hangout name and contact info.
Calvin Gordon
BTW Peter, i think you just cost the M$ Corp the sale of 2 MS Exchange servers. This plugin turns roundcubemail from an unacceptable solution to a very acceptable one for my users.
Calvin Gordon
@Calvin Gordon – Great that you have it working. Reminds me that I probably should make a little README file to go with the plugin :).
You can always e-mail me, contact me on any IM, etc.. Details are on the about page.
Hi,
1- I’ve installed vacation program and it works
2- I’ve installed vacation plugin on roundcube and I see “Vacation” in settings
3- I’ve installed the squirrelmail_vacation_proxy under /usr/local/sbin/ (I work with $vacation_backend = ‘suid’;)
here is the config file http://beytouna.com/test/config
but, the vacation plugin still doesn’t work, when I write a message and save it, the files (.forward, .vacation.msg,…) doesn’t apear in the user home directory and it doesn’t send a reply mail
Plz is there some adjustment of the configuration to make it work
my configuration: Ubuntu, Postfix, dovecote, roundcube
@MSM – Is the vacation binary path also correct?
Does the vacation binary write the files correctly if you login by SSH and execute the command as “root”?
@Peter,
yes the path is correct.
I didn’t manage to use the program manually, usual the usage message appear, any help plz
@MSM: there is no code in vac_init.php that actually do something with $mail_vacation_binary or I am missing something here.
@Peter: can you confirm this?
The current code only works with ftp as a backend.
So the squirrelmail_vacation_proxy is the program that should copy the .vacation.msg etc to the homedir.
It seems that all code related to suid is stripped from vac_init.php
The code taken from Squirrelmail is really ugly which is why I started to rewrite both vac_init.php and the related configuration file.
@Jasper – Correct
@ Peter, Jasper
I thought that is the work of squirrelmail_vacation_proxy if we work with suid backend
So you mean that there are no solutions to let this plugin work with suid backend yet?
@MSM – The code was in there in the first place, but I stripped it for my needs. I’ll hack it in there for you tomorrow. Check back here on Monday for the updated version.
@Peter: I am almost done with rewriting the vacation plugin in order to prepare it for integrating other backends such as Virtual and Setuid.
All references to Squirrelmail code is gone, backend code is revamped and the integration with Roundcube is improved.
Works needs to be done on forwarding mails to other people (updating the .forward file) and fixing some bugs.
Configuration file is also changed to better support the different backends.
Getting the other backends to work shouldn’t be rocket science as they only need to implement 4 protected methods.
I hope you like it so far.
Grab a copy of the code at http://www.xs4all.nl/~jaspersl/vacation.zip
It’s a shame that Roundcube needs E_ALL & ~E_NOTICE to be excluded from the error_reporting mask because I use
Sorry I’m bothering you with my questions,
I’ve installed vsftpd and it works for FTP backend,
For automatic forwarding it works very well, but for vacation it works just for the first email for an user
For every account, the pluggin send an autoreply for the first email received from an user and ignore all other email, even if I resave
Is there any adjustment to do on the vacation pluggin or on the vacation program?
Sorry again,
@MSM – Which version did you use? My version or the version Jasper attached in his comment.
Just to inform you: We are setting up this plug-in on SourceForge to get everything a bit more structured and put the rewritten version on it as well.
@Peter,
version of vacation program: vacation-1.2.7.0
version of vacation plugin: vacation_v1 (attached in your update)
@MSM: as you could/should have figured out yourself the manual of ‘vacation’ tells you this:
-t N
Change the interval between repeat replies to the same sender.
N is the number of days between replies. Default is one week.
You could add this flag in Peter’s code where it’s actually creating the .forward file. So the .forward contains something like:
\yourname |”vacation -t 1 yourname”
You do not want to auto-reply to every single mail from a person who already got an auto-reply 5 minutes earlier.
Resaving means that the ‘.vacation.db’ needs to be deleted so Vacation forgets it never sent mail to a person. This behaviour is currently not implemented in neither Peter’s code or mine.
thx a lot, it works very well (-t 0 for response for evry mail)
thx again
@MSM: good to hear it works π
It seems like a good idea to be able to configure vacation flags like -t in the config.php
Maybe we should delete the .vacation.db if exists and the user updates his out of office text or make it configurable.
Damn it, I shouldn’t have read this post about Roundcube on Peter’s blog in the first place. π It’s gonna be a full blown project before you know it π
@MSM – Indeed good to hear it works for you. We better include this in the config file
@Jasper – Yep. That’s what you get when you are eager to help out others π
I will close this thread down now and update the post to link to the SourceForge project that I created this morning. The SVN repo is allready filled and I think it’s best to also handle support and questions there.
I just checked out rev 4 from svn and installed it.
And besides the settings openeing in extra window (or actually fully replacing the webmail window) and that “save” can only be used once I have an issue with suid backend
I installed (confidured and compiled before) the squirrelmail_vacation_proxy programm .. which works fine when using locally, but everytime i try to use it via the plugin nothing happens and apache writes an error :
File does not exist: /var/vwww/my.webmail.site/plugins/jquery-ui, referer: https://my.webmail.site/?_task=settings&_action=plugin.vacation
?? where does this come from … i searched for that jquery in the whole code but could not find anything
I actually checked the config severyl times and i am sure everything is ok there .. but i canΒ΄t get it to work.
.. will try virtual backend now
@Marcus – That’s correct. The Squirellmail_proxy is not yet supported by the plugin and is just added to the package for completeness.
The next release of the plugin will support working via this proxy. The only thing working now is the FTP and the virtual way.
aaah ok .. that explains π
Thx for the info.
but the GUI-thing remains .. tried old version from here which looks fine .. current svn checkout is somehow broken (as explained – i get the extra window/screen instead of integrating in settings page.
But anyway. keep up the good work .. i am sure the plugin will evolve π
Hi Peter,
thx for this plugin it is very useful,
I’ve installed it and it works fine, but there are a buggs
when I save an autoreply (subject and message), files are stored correctly and I can read the message which I wrote in .vacation.msg
but I’ve noticed that if I click on vacation menu (next to identitΓ© π ) the file .vacation.msg changes.
before clicking on vacation menu:
root@condor66:/home/test12# cat .vacation.msg
From: Test12
Subject: test auto reply by test12
test vacation message
after clicking on vacation menu:
root@condor66:/home/test12# cat .vacation.msg
“|/usr/bin/vacation test12”
\test12
@med – Which version did you use? The SF.net version or the one that is included in the post above? Jasper made adjustments to the plugins backend and that is what’s currently in SF.net and isn’t fully tested.
We decided to extend the plug-in from this development version.
The version in the post above is a whole different structure and is well tested. Could you please try that version if you didn’t already?
Hi,
you may haven’t noticed that Sieve supports “vacation” type autoresponders out of the box. This is also available through the managesieve plugin that is incluced in 0.3-rc1. (create a filter for “all messages”, and select “reply with message” as action).
Just installed the thing, as you wrote, super easy, and the plugin seems to work nicely. Only drawback IMO: the signature from the “identity” is not included automatically, and there is no option to just disable the rule when it’s not needed (to save some work on your next vacation).
Anyway, always good to have a choice, so please don’t get this as an assault against your plugin.
Cheers
Sascha
@Sascha – Absolutely true, the drawback from the managesieve plug-in is that you have to run a sieve server / deamon and that isn’t always an option.
As for your comment on disabling the plug-in when you no longer need it, that was standard functionality in the plug-in that you can still download in my post above. The version that is now in SF.net is currently under heavily development.
And please keep up commenting / give your opinion on the plug-in as it is very helpful in developing it further.
@Peter,
I use your version vacation_v1.zip
I’ve downloaded the SF.net version but I’ve got this error when I click on vacation menu:
SERVICE CURRENTLY NOT AVAILABLE!
Error No. [0x01F5]
I use roundcube with vacation plugin on CentOS 5.3 with amavis package
I got a problem with amavis
WARNING: bad headers – Improper use of control character (char 0D hex):
I fix this problem by edit vac_init.php
in upload_data function
repladce
if (ftp_put($FTP,$remoteFile,$localFile,FTP_ASCII))
by
if (ftp_put($FTP,$remoteFile,$localFile,FTP_BINARY))
@Suttichai – Thanks for the fix. I’ll apply it to the trunk tomorrow.
@med
with first version of vacation plugin (before moving to SF.net)
move bracket β}β from line 96 to line 208 in vac_init.php it will correct the problem
“after clicking on vacation menu:
root@condor66:/home/test12# cat .vacation.msg
β|/usr/bin/vacation test12β³
\test12”
Hi Peter,
Very useful plugin. Thanks for sharing.
Am I right in thinking the Squirellmail_proxy setuid backend is from the old Vacation Local plugin or is this from the newer Local User Autoresponder and Mail Forwarder plugin ?
Many thanks
Gen
The Squirellmail proxy is indeed from the old vacation plugin. However it will be implemented on a cleaner way in the new one as well. Just check out the svn from sourceforge for the latest version.
Hi Peter,
I’ve install your plugin but it don’t save, when i write the message in roundcube and click save button, all field become empty…
Thanks
@Shork – Then the plugin probably can’t write the vacation file. Can you check if the file is being created on the server? Can you login with the usercredentials of the mailbox user yourself (via ftp)?
My users are virtual, the are not system users but I’ve a vmailbox file with all email account.
hello Peter and all,
Sorry to bother, i’m not a program or developer, after fresh
install rc 3, all work fine, vacation is a must. however i don’t really understand what you telling accordingly to the readme.txt
my current config
fc 11
mysql 5x
roundcube 3 (with virtuser)
sendmail 8.14 (link virtusertable to rc3)
here is my question
1. you see i’m using sendmaiil, not the postfix, what should i do ?
2. also for create DB table, if must nameed “postfix” ? or what should i do ? create custom vacation and vacation_aliases table ? with single row row for each table?
3. nothing about squirrelmail, or squirrelmail_vacation_proxy… etc i needed to install. ?
thanks you very much.
@Billy & @Shork – You need to check out the SVN for the version that supports virt users. Please check the threads on the sourceforge forums of this project for other users that have the same setup.
noted & thanks
okay, feeling very dumb here. I can’t *find* the ‘vacation folder’ in the download. I extracted the .tar file in 7-zip and am at a stupid loss as to what to do with it. Oy.
If anyone can help me with this simple task, I’d be grateful
sheesh. nevermind my question about unpacking tar files. I’ve been awake too long…
@kc – No problem. I have that too sometimes π
Peter I am trying to install the auto responder on a centos “mail-relay” server that does not host any mail. I have multiple domains set up in the roundcube config and can log in to each imap site ok. I have the auto-responder working with ftp however you have to hard code the address of the imap server into the plugin. this does not work with multiple domains.. Is there a better way to handle this ??
regards Rick
Rick,
I’m not sure what you are trying to do here..
When you have multiple identities (could be different domains) then you can set this up easily under the user prefs / identities page within roundcube.
The SVN version should work with multiple identities.
When you have completely seperate domains that you want to run you can or have 1 roundcube install per domain π
or I can make some adjustments for you to handle this issue. Shouldn’t be that difficult I think.
HI Peter..
I have multiple domains in roundcube
$rcmail_config[‘default_host’] = array(
‘mail.remoteserver1.org.au’ => ‘My First site’,
‘mail.remoteserver2.org.au’ => ‘My second site’,
);
This works fine and when I login and select each site from the dropdown box then I log into each of my remote sites.
However the vacation plugin using FTP is hard coded
FTP backend parameters
*/
$rcmail_config[‘ftp’][‘server’] = ‘mail.remoteserver1.org.au’;
$rcmail_config[‘ftp’][‘passive’] = true;
…
any therefore never works for any of my other sites.. Does that make any more sense ??
thanks Rick
Hi Peter .. I am a bit stuck with auto-responder not able to work with multiple sites.. CAn you offer any help with this one above ?
thanks Rick
Rick,
Can you tell me wich version you downloaded? Did you use the download button or did you check out the latest SVN version.
They are very different versions as the SVN version is a complete rewrite with more features. If I’m gonna make you a patch then it’s handy to know which version to write it for.
Peter i used roundcubemail-0.3.1.tar.gz and vacation-1.6.3.tar.gz and I am fairly sure that I used the green download button. Interestingly I have the same issue with sieve filters as far as I can see where the filters point to a static address set up in config and do not dynamically pick up the selected address when a different domain is chosen. I am new to roundcube and still learning how it works.
thanks for your help. Rick
Peter I have looked for a diffent “SVN” version but cannot find one on the sourceforge site at all. Can you point me in the right direction. rick
@rick – http://rcubevacation.svn.sourceforge.net/viewvc/rcubevacation/trunk/
Thanks Peter. I have downloaded and had a quick look at the config. I believe the same problem would exist for me in needing to hard code in the ftp/imap server settings in the config.. Please correct me if I am wrong.
Rick