Roundcube webmail – Auto reply plugin
Sun, Jul 5, 2009
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.
Tags: auto-reply, MySQL, PHP, roundcube, sendmail, vacation, webmail



July 7th, 2009 at 13:49
Brilliant. That’s what I love about open source. Adopt, adapt or improve!
I agree it’s ridiculous that a mail client (especially a web mail client) does not support out-of-office replies.
Even your run-of-the-mill webmail that comes with your provider supports it. Not to mention the fact that regular (l)users do not have access to webmin or usermin. Let alone they understand how that would work.
By the way: I like Zimbra a lot, but it’s more ‘groupware’ (what’s in a name) and as such a (serious) replacement for Micro$ucks products.
July 8th, 2009 at 20:14
Wow! Thank you! I always wanted to write in my site something like that. Can I take part of your post to my blog?
July 10th, 2009 at 04:12
I stumbled across your site I’ve enjoyed it very much that is why stumble upon is a great tool In terms of gems like this.
July 11th, 2009 at 03:36
Please could you describe the process to install this plugin
thx
July 11th, 2009 at 09:26
@MSM – Of course: This is an API based plugin so you have to have the latest RoundCube installed (0.3) to let this work. While the website stated it is still in beta you can rest assure that this is a very stable release.
Once you have that installed you can drop the entire vacation folder in the plugin folder. Then you just add the word ‘vacation’ to the plugin array ($rcmail_config['plugins']) inside the main config file.
Thats it
July 11th, 2009 at 13:32
@ Albert 9 – Thanks for your feedback. Really appreciate it.
July 11th, 2009 at 13:33
@Markez Linda – Sure you can. Would be nice if you link back to me when you copy a part of my post.
July 11th, 2009 at 23:02
Very nice information. Thanks for this.
July 12th, 2009 at 01:44
It’s a very interesting subject I was looking around about more information but you got really what i was looking for in your article so thanks and keep it up you have a great blog .
I’m very interested in CMS and all its related subjects.
July 12th, 2009 at 03:26
@Martin Hemmer – Thanks for the feedback. I will soon post some more about different CMS systems.
July 13th, 2009 at 12:05
I found your blog on google and read a few of your other posts. I just added you to my Google News Reader. Keep up the good work. Look forward to reading more from you in the future.
July 13th, 2009 at 15:42
thx PeterRuiter for your response,
another question please,
If I’m not wrong this pluging require files from “squiremail” and “vacation_local” (/usr/bin/vacation, squirrelmail_vacation_proxy)
could you plz attach those files to run this plugin without installing “squiremail” and “vacation_local”, I mean to put those files in the vacation folder and run plugin directly
thx a lot, you’ve done an excellent work
July 13th, 2009 at 23:15
@MSM – You do not need any files from the squirellmail package. You DO need to have the ‘Vacation’ program installed. This is a standalone program that you can download from
http://vacation.sourceforge.net
July 14th, 2009 at 03:35
Looks very good.
Just installed it. It look that all works fine.
Files at the home directories are created correct.
But i never get a out-of-office reply when i send a mail to my account.
The only log at /var/log/mail.log is this:
status=sent (delivered to command: /usr/bin/vacation user)
Is it a problem to have procmail installed?
Can anybody help me?
July 14th, 2009 at 04:20
@Andreas – If the files are created correctly then your vacation program should do the rest when delivering the mail to your users home dir. Do you have the vacation plugin installed? And is the users e-mail also being delivered to the directory where you create the forward messages?
July 14th, 2009 at 04:42
I can answer with yes to all your questions
After i do a
su -c “vacation -I” user
it works fine
Maybe i have to do this for every user in my system?
July 14th, 2009 at 05:18
Don´t ask me what i have done.
Now it works for all my users…..
Strange
Thanks a lot for this simple but great plugin.
July 14th, 2009 at 05:27
@Andreas – Great to hear that you got it to work for you. Thanks for the update.
July 14th, 2009 at 06:45
Hey, love the vacation plugin you made… but only one small complaint — can you make it give some sort of acknowledgement that it worked when the user hits the Save button? For example, when you hit save in the preferences tab of Personal Settings it comes up with a box on top of Roundcube that says “saved successfully”… can this plugin do that when clicking save as well? Else, users aren’t really sure if it “took”…
Many thanks for a nifty plugin!
July 14th, 2009 at 06:49
@Eric – Thanks for your feedback. I will put the notification in there. I am also putting support in there for multiple identities under one account. I’m not in the country for the next three weeks, but will post the update as soon as I’m back.
July 14th, 2009 at 15:04
hi PeterRuiter,
in the config file there are a section about “mail_vacation_binary”
$mail_vacation_binary = ‘./squirrelmail_vacation_proxy’;
please from where I can get squirrelmail_vacation_proxy file
July 15th, 2009 at 00:28
thx for your answers,
in the the config file there is a section about “mail_vacation_binary”
$mail_vacation_binary = ‘./squirrelmail_vacation_proxy’;
Please from where I can get this file, I didn’t found it in the NET
thx a lot
July 15th, 2009 at 09:26
i’m stucked in the same problem as MSM is, cant use FTP protocol so i need to config with siud, but SUID configuration request a
$mail_vacation_binary = ‘./squirrelmail_vacation_proxy’;
and i don’t know how to get rid of it.
i got postfix/dovecot/virtualmboxes wit passwd file autentication. (will switch to mysql when everything is working)
tnx.
July 15th, 2009 at 11:57
It seems that many people are stuck since they cannot use FTP to put the forward files there. Then you need the squirellmail proxy program.
I’ll look it up from my server and put it up here for download in a few min. Note that that is not my program and I do not give any support on the SquirellMail proxy program.
July 16th, 2009 at 12:24
I suggest to move bracket “}” from line 96 to line 208 in vac_init.php.
July 20th, 2009 at 04:51
Hi Peter, nice plugin, but I’m stucked with squirelmail_vacation_proxy too. The plugin doesn’t create the files in the home of the users. This is the proxy with bit suid:
# ls -al /usr/local/sbin/squirrelmail_vacation_proxy
-rwsr-xr-x 1 root root 23197 Jul 20 13:45 /usr/local/sbin/squirrelmail_vacation_proxy
This is the configuration of vacation:
// Choose the method to be used when connecting to your
// server to maintain vacation files: “ftp” or “suid”
//
$vacation_backend = ‘suid’;
//$vacation_backend = ‘ftp’;
// If you are using the suid backend, this is the location
// of the binary that writes vacation messages to local disk.
// If you change this, don’t forget to change the same setting
// to match in vacation_binary/config.mk as well
//
$mail_vacation_binary = ‘/usr/local/sbin/squirrelmail_vacation_proxy’;
//$mail_vacation_binary = ‘./squirrelmail_vacation_proxy’;
And I try to put a vacation message for user sergio, and the message is not stored in his homedir:
# ls -al ~sergio/
total 296
drwxr-xr-x 22 sergio users 4096 Jul 20 13:50 .
drwxr-xr-x 5 root root 4096 Jul 16 12:20 ..
-rw——- 1 sergio users 0 Jul 16 15:54 .Xauthority
-rw——- 1 sergio users 203 Jul 17 14:25 .bash_history
-rw-r–r– 1 sergio users 1177 Jul 16 12:00 .bashrc
drwxr-xr-x 3 sergio users 4096 Jul 16 13:20 .config
drwx—— 3 sergio users 4096 Jul 16 15:09 .dbus
-rw——- 1 sergio users 26 Jul 16 15:09 .dmrc
-rw-r–r– 1 sergio users 1637 Jul 16 12:00 .emacs
-rw——- 1 sergio users 16 Jul 16 15:09 .esd_auth
drwxr-xr-x 2 sergio users 4096 Jul 16 15:09 .fontconfig
drwxr-xr-x 2 sergio users 4096 Jul 16 15:09 .fonts
-rw——- 1 sergio users 37 Jul 17 11:01 .forward
drwx—— 2 sergio users 4096 Jul 16 13:20 .gconf
drwx—— 2 sergio users 4096 Jul 16 15:54 .gconfd
drwx—— 2 sergio users 4096 Jul 16 15:09 .gnome2
-rw-r–r– 1 sergio users 18251 Jul 16 12:00 .gnu-emacs
drwx—— 2 sergio users 4096 Jul 16 15:37 .gnupg
drwxr-xr-x 2 sergio users 4096 Jul 16 15:09 .gstreamer-0.10
drwx—— 2 sergio users 4096 Jul 16 15:09 .gvfs
drwxr—– 2 sergio users 4096 Jul 16 15:09 .hplip
-rw-r–r– 1 sergio users 861 Jul 16 12:00 .inputrc
drwx—— 3 sergio users 4096 Jul 16 15:09 .kde
drwx—— 4 sergio users 4096 Jul 16 15:09 .kde4
drwx—— 3 sergio users 4096 Jul 16 15:10 .local
-rw-r–r– 1 sergio users 36 Jul 17 13:10 .mailboxlist
drwxr-xr-x 4 sergio users 4096 Jul 16 13:20 .mozilla
-rw-r–r– 1 sergio users 6043 Jul 16 12:00 .muttrc
-rw-r–r– 1 sergio users 1028 Jul 16 12:00 .profile
drwx—— 2 sergio users 4096 Jul 16 15:09 .pulse
-rw——- 1 sergio users 256 Jul 16 15:09 .pulse-cookie
drwxr-xr-x 2 sergio users 4096 Jul 16 15:09 .skel
drwx—— 2 sergio users 4096 Jul 17 08:59 .ssh
-rw——- 1 sergio users 643 Jul 17 11:02 .viminfo
-rw-r–r– 1 sergio users 849 Jul 16 12:00 .vimrc
-rw-r–r– 1 sergio users 1940 Jul 16 12:00 .xim.template
-rwxr-xr-x 1 sergio users 1446 Jul 16 12:00 .xinitrc.template
-rw——- 1 sergio users 106600 Jul 16 15:54 .xsession-errors
drwxr-xr-x 2 sergio users 4096 Jul 17 11:13 Desktop
-rw——- 1 sergio users 504 Jul 17 08:49 INBOX.Drafts
-rw——- 1 sergio users 504 Jul 17 08:49 INBOX.Sent
-rw——- 1 sergio users 546 Jul 17 13:11 INBOX.Trash
drwxr-xr-x 2 sergio users 4096 Jul 16 12:00 bin
Any idea?
July 22nd, 2009 at 08:51
Peter (or whoever)
I’m a bit of a noob at mail servers so i want to be a bit careful not to rush in and do it completely wrong. Running Fedora, Postfix, dovecot, and Roundcube 0.3.
This addon is just the thing i need for my users but the documentation available for the ‘Vacation’ program is a bit slim as far as i can find. It says it requires a compile. Generally i stick to RPM based installs but it looks like i’ll have to venture out on a limb a bit. I was expecting it to be a few php or perl scripts, but obviously not.
The Squirrelmail webserver has been compromised so all the addons are currently off-line, so i can’t check the docs there.
I did find a document re Postfix and Procmail for auto responding.
http://www.opensourcehowto.org/how-to/procmail/postfix-with-procmail-vacation-auto-reply.html
Does the “Vacation” program do the same functions as procmail ?
Does the Vacation Program work with Postfix ? and if so, could someone give a brief synopsis on installing it on an RPM based LAMP server ?
Cal Gordon
July 25th, 2009 at 08:43
@All – I´m currently on vacation and will answer all your questions in 2 weeks when I´m back. In the meanwhile you can post questions at the Roundcube forums and hope for some community feedback.
July 27th, 2009 at 14:08
Update to my previous post.
Fedora server, postfix. dovecot, Roundcube 0.3.
Installed the Vacation Program from [url=http://sourceforge.net/projects/vacation/]
Installed The vacation / Auto Reply Plugin for RoundCube from [url=http://peterruiter.com/2009/07/05/roundcube-webmail-auto-reply-plugin/]
The Auto Reply Tab now appears under the Personal Settings page, and seems to be there and working.
I did a “vacation -I” as a user and “.vacation.db” appears in the home dir. I used the webbased tool to invoke auto reply in Roundcube, then emailed that account but did not get a reply.
the maillog shows:
[root@mailserver someuser]# tail -f -n 10 /var/log/maillog | grep someuser@somecompany
Jul 22 16:28:01 mailserver postfix/local[22263]: E881C2E6C410: to=, relay=local, delay=3.3, delays=3.3/0/0/0, dsn=2.0.0, status=sent (delivered to maildir)
How does postfix know that it should be doing something different than before ? where’s the hook ?
I see mention of a message file required in the users home dir. How does this get created ?
How can i read the .vacation.db from a text based ssh terminal to know if it’s contents are actually what i asked them to be ?
Cal G
August 4th, 2009 at 11:05
Thanks for the great vacation plugin. It works great on Firefox, but I cannot see the tab to get to the plugin on Safari, IE 7, or Opera 9. Accessing the proper URL in the above browsers *does* work, but there is no way for the end user, who does not know the URL, to get to the settings.
August 16th, 2009 at 05:28
@Calvin Gordon – The vacation program is definitely not the same as procmail. Procmail allows you to filter things whereas the vacation plugin just reads files from the users home dir and acts accordingly.
The vacation plugin is something that I didn’t develop. If you have troubles with the vacation program I suggest that you follow the sourceforge link a few posts up to the authors website.
This Vacation Roundcube plugin merely uses the vacation program to trigger the auto-reply.
August 16th, 2009 at 05:30
@ Allison – That’s weird. I use IE7, IE8, Safari and Firefox at work and they all seem to display the plugin correctly. Are there any faults showing up in your inspector window of you browser?
August 18th, 2009 at 11:37
@Peter
Thanks for the response. After much head-scratching, I realized I had uncommented the html at line 5, resulting in an error in Opera, Safari, and IE. Once I re-commented the code, it was working fine! So thank you very much! I’m happily using the plugin now.
August 18th, 2009 at 11:53
Thanks Peter
I’m off to do some more snooping re the vacation program but i’m having trouble understanding why vacation responders are not more common as default install, and more mature, in the variety of LAMP servers out there. I can’t imagine a corporate office not wanting an auto responder.
The last forum post at “Web Frontend for Vacation Program” was 1,455 days ago.
The Vacation program was commited to SF.net over a year ago and only has 3,800 downloads. The last forum post was 147 days ago.
Usermin::Vacation went inactive 6 years ago.
The download page for php-outofoffice project is empty, with zero forum posts.
Openvacation was abandoned 1000 days ago.
Am i missing something very obvious here ? What the heck are people using ?
Calvin Gordon
August 18th, 2009 at 12:39
Peter (or whoever)
Just in case you have any suggestions for me, here is an update to my current status on the plugin.
I have installed the vacation program, and it works. Currently I just do the following:
To create an out Of Office Auto Reply
usermod -s /bin/bash username
su username
vacation -i (creates the .vacation.db file)
vacation (creates the .vacation.msg and .forward files)
(edit the message file as desired)
vacation -r 1 (sets the autoreply funtion to one day of no repeats)
-d to exit back to root
usermod -s /sbin/nologin username
To delete the out-of office Auto-Reply:
rename the .forward file to .forward.save
I have installed the plugin into roundcube, and it looks like it is there and ready to roll, under Personal Settings – Auto Reply. I can type in a message and hit the SAVE button but the required files do not appear in the user’s home dir.
I realize that you are not paid to support this, and that you have very generously donated this plugin to the open source world. Thanks a ton.
If you have any suggestions as to log files to watch, items to snoop into, i would sure appreciate it.
I’d be delighted to send a free lunch wherever if i can resolve this as it has driven me just a little bit wacko.
Calvin Gordon
August 18th, 2009 at 12:53
@Allison – Great that you have it working now. If you have any more questions or difficulties please let me know.
August 18th, 2009 at 12:57
@Calvin Gordon – I had the same questions Calvin. I looked all over the internet for a corporate solution to do auto-reply. There are very few solutions out there. Most of the solutions I’ve seen are using php with some sort of cron. They run a cron every 5 min and when a message is found in the database (yes they also use MySQL for mail storage) they trigger the auto reply.
In my case we didn’t want a MySQL based storage for mail and just wanted to use the SendMail server with procmail so I ended up doing this myself using the vacation plugin. I certainly think it is up for major improvement, but it fits my needs and hopefully some of yours.
August 18th, 2009 at 13:05
@Calvin Gordon – Basically the problem with your setup is that you do not have userdirs to store the messages in. (It’s not a problem of course, just a different set-up / approach).
In my setup I use SendMail server which uses homedirs for users. These users also have access via FTP with their username/password they also use for their e-mail (IMAP). That is how I connect and write the files to that particular dir for that particular user with the correct rights.
In your setup you need to run those commands under your root account to work right? Maybe we can adjust the plugin to fit your needs. For example save the settings and message in the roundcube database and then run a cron php script under root that executes those command for all the users that have their vacation message activated.
It shouldn’t be to hard, just needs some tailor-made adjustments. If I can help you in any way just let me know. You can also mail me directly or add me on MSN, GMail, AIM or ICQ
August 18th, 2009 at 13:24
Peter
My users do have home dirs. Mail is stored in Maildir format under the user’s ~home/Maildir.
I use postfix which acts as a direct replacement for sendmail
My users do not currently have Login privelage as it is just a mail server, no other function. The users have real system accounts. I do not currently store mail in a database or use LDAP for anything on this server.
I do have a virtual domain in addition to the actual domain, but these people just aliases back to real system accounts also.
I run those commands to:
1. grant login privelage to the user.
(required to su to an account)
2. su to the user
3. get vacation working
4. su back to root
5. disable user login
If you are willing, i’d like to keep this conversation public, as i know i wish i could have found a dozen or so like it during my web searches.
Any clues as to where to look to see what privileges are getting in the way of actually letting the pluging write the required files to the users home dir ? (so far, in my experience, if i have a problem
on a linux box, it’s something to do with permissions)
Thanks Peter
August 18th, 2009 at 14:39
ahhhh, the light shines a little brighter.
Not sure how i missed this before but there is a config.php file included with the plugin that may need some tweaks depending on your system.
Out of office for a couple days now but looking at that when i return. Now if only i had an out of office auto responder.
August 18th, 2009 at 15:16
config.php
// Choose the method to be used when connecting to your
// server to maintain vacation files: “ftp” or “suid”
//
//$vacation_backend = ‘suid’;
$vacation_backend = ‘ftp’;
Definitions of suid on the Web:
The SUID permission causes a script to run as the user who is the owner of the script, rather than the user who started it. …
I do not currently run an ftp server on my mail server. If i change this to ‘suid’ and it runs as the user who is the owner of the file, that will be root. Will this still place the vacation files into the users’s ~home directories ? And if so, who will own those files ?
I’m also dubious that a user and/or apache can run a script as root (the owner of the file).
How does this work ?
Calvin Gordon
August 18th, 2009 at 22:40
@Calvin Gordon – It works via the SquirellMail proxy program that I just lend from the SquirellMail project. It is attached to the original post. The proxy program should write the files with a uid that has access to those folders.
August 20th, 2009 at 04:51
If Roundcube wants to mature, it really needs to have a vacation/auto-reply plugin. In corporate environments it’s usually a requirement and you do not want to bother either sysadmins or users with just another tool to manage out of office settings.
But it’s hard to have a generic implementation as there are many mail server configurations (ldap,mysql,postgresql,userdb with different dbase schemes) out there.
I used to manage some domains with approx 900 b2b mailboxes. I didn’t like Squirrelmail for the same reasons as you stated and Horde/IMP looked fancy enough and provided the required functionality.
Roundcube was around back then (I even contributed to the first Dutch translation and managed the IRC channel at Freenode for a while), but it lacked tools to import addressbooks and other settings from Horde. The icon based GUI was too confusing for users was the feedback I got back then (2005 I reckon).
However, Horde’s vacation plugin was incompatible with my existing database setup so I had to hack the SQL statements generated so Postfix’s vacation plugin was only invoked for users with autoreply enabled.
The webmail application creates a alias like: joe@domain.org => joe@domain.org@vacation.yourfqdn.org
That @vacation.yourfqdn.org is a transport for the vacation program which is called with $sender,$recipient and the mail as parameters.
The vacation binary fetches the out of office message (and subject) and the ‘seen’ list from the database and sends the out of office mail to the sender.
The nice thing about this is that it’s tailored for virtual users. System users (with an entry in /etc/passwd) are ok if you manage like 5 mailboxes with a single domain. But it doesn’t scale well and it’s undesirable from a security point of view.
Virtual vacation mail programs don’t need setuid or FTP to be enabled and it does not depend on procmail or or any other LDA. It seems that the recommended ‘vacation’ program only deals with system users. An excellent virtual user aware vacation program is shipped with Postfixadmin. It probably involves hacking the queries to match the current installation, but it’s fairly easy.
Maybe you can consider storing the vacation information in the database? Afaik sendmail does not support true virtual users like Postfix does.
Jasper
August 20th, 2009 at 05:27
@Jasper Slits – Thanks for your info on this matter. And I’m still waiting for your vacation photo’s btw
August 20th, 2009 at 06:45
@Peter: it takes forever to upload all those pictures with just 1mbit of upstream at home.
But i’ll see what I can do, but who cares for more pictures of the same parrots etc.
Maybe I even give hacking your PHP script a try so it supports an SQL dbase as a backend if I get PHP5,MySQL and Apache2 to behave nicely on the Mac.
August 20th, 2009 at 06:51
@Jasper Slits – Brilliant. Would love to see that addition. That’s also the reason why I love open-source.
And about your pictures; Not that interested in parrots, but if you have any pictures of Kim and me that we could use in our own digital album, that would be great.
August 20th, 2009 at 07:12
@Peter: the 56 pictures I uploaded like a week ago were the ones with mostly people on it. But I’ll see if there any other interesting pictures.
I made my last patch (behaviour change for sorting mail by subject) for RoundCube almost 4 years ago, so it’s time to contribute again I guess.
After graduating I got a non-tech fulltime job, so I hardly keep track of updates / features of new Linux kernel releases, mailservers,webservers etc. Now I even have to RTFM to configure Postfix for example.
August 20th, 2009 at 08:51
ha
Whgen i first read “If you can’t use FTP to put the forward files” I assumed it was just bad engrish referring to putting the plugin onto a hosted server that you did not have root access to.
I may need to learn to read a bit more carefully. Now the original post makes way more sense.
Cal Gordon
August 20th, 2009 at 11:46
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…
August 20th, 2009 at 12:00
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
August 20th, 2009 at 12:47
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
August 20th, 2009 at 23:12
@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.
August 21st, 2009 at 03:21
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
August 21st, 2009 at 03:34
@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”?
August 21st, 2009 at 04:50
@Peter,
yes the path is correct.
I didn’t manage to use the program manually, usual the usage message appear, any help plz
August 21st, 2009 at 06:28
@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.
August 21st, 2009 at 06:34
@Jasper – Correct
August 21st, 2009 at 12:45
@ 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?
August 22nd, 2009 at 00:18
@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.
August 22nd, 2009 at 07:50
@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
August 24th, 2009 at 02:42
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,
August 24th, 2009 at 02:47
@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.
August 24th, 2009 at 03:01
@Peter,
version of vacation program: vacation-1.2.7.0
version of vacation plugin: vacation_v1 (attached in your update)
August 24th, 2009 at 04:09
@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.
August 24th, 2009 at 05:59
thx a lot, it works very well (-t 0 for response for evry mail)
thx again
August 24th, 2009 at 07:15
@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
August 24th, 2009 at 07:20
@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.
August 27th, 2009 at 05:01
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
August 27th, 2009 at 05:05
@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.
August 27th, 2009 at 05:12
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
August 27th, 2009 at 06:10
Hi Peter,
) the file .vacation.msg changes.
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é
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
August 27th, 2009 at 06:18
@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?
August 27th, 2009 at 07:25
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
August 27th, 2009 at 07:29
@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.
August 28th, 2009 at 02:29
@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]
September 7th, 2009 at 11:35
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))
September 7th, 2009 at 11:57
@Suttichai – Thanks for the fix. I’ll apply it to the trunk tomorrow.
September 10th, 2009 at 14:15
@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″
October 5th, 2009 at 00:22
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
October 6th, 2009 at 04:22
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.
October 23rd, 2009 at 02:07
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
October 23rd, 2009 at 02:23
@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)?
October 23rd, 2009 at 05:31
My users are virtual, the are not system users but I’ve a vmailbox file with all email account.
November 3rd, 2009 at 03:08
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.
November 3rd, 2009 at 11:11
@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.
November 3rd, 2009 at 20:26
noted & thanks
December 1st, 2009 at 02:34
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
December 1st, 2009 at 02:39
sheesh. nevermind my question about unpacking tar files. I’ve been awake too long…
December 1st, 2009 at 02:40
@kc – No problem. I have that too sometimes
December 19th, 2009 at 15:03
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
December 20th, 2009 at 02:49
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.
December 20th, 2009 at 03:52
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
December 22nd, 2009 at 19:42
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
December 24th, 2009 at 00:37
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.
December 24th, 2009 at 04:21
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
December 24th, 2009 at 04:32
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
December 24th, 2009 at 04:38
@rick – http://rcubevacation.svn.sourceforge.net/viewvc/rcubevacation/trunk/
December 24th, 2009 at 04:52
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
January 3rd, 2010 at 05:35
For virtual users and vacation / out of office replies have a look at http://feurix.org/projects/response/
January 11th, 2010 at 15:52
Peter, Jasper Slits from http://feurix.org/projects/response/ has resolved my problem for me.
In the vacation config file we have replaced the default settings with the below and the plugin now dynamically picks up the selected site from roundcube when a specific site is selected using the multiple site dropdown box.
$rcmail_config['ftp']['server'] = $_SESSION['imap_host'];
if (empty($_SESSION['imap_host'])) {
die(“imap_host is empty”);
}
The if statement is just to make we have the right variable.
regards Rick
January 12th, 2010 at 09:36
@Rick – Great to hear that Jasper allready picked this up. When I see him next week irl then I’ll give him a pat on the back for you
January 13th, 2010 at 17:27
Peter I have another query. It seems that the vacation response is not handling aliases.. In the squirrelmail vacation plugin it does have an option to add email aliases that the user may use and so in the .forward file you will see
\rick
“|/usr/bin/vacation -a rick.saul -a tom.jones rick”
where rick.saul and tom.jones are both aliases for this email address.
Is it possible to have this implemented in your plugin?
thanks Rick
January 13th, 2010 at 20:00
Peter I have just installed the version from here to try and resolve alias issues. http://rcubevacation.svn.sourceforge.net/viewvc/rcubevacation/trunk/
However I get a whitescreen when trying to access my roundcube and the error log has
[14-Jan-2010 00:35:10] PHP Parse error: syntax error, unexpected ‘}’ in /var/www/html/safe/roundcubemail-0.3.1/plugins/vacation/lib/dotforward.class.php on line 68
Also in trying to set up the RSS feed
While trying to retrieve the URL: feed://http//peterruiter.com/2009/07/05/roundcube-webmail-auto-reply-plugin/feed/
The following error was encountered:
* Invalid URL
Replacing feed://http//peterruiter... with feed://http://peterruite….
did not help.
regards Rick
January 13th, 2010 at 23:58
@Rick – Could you please copy past this question in the Sourceforge forums? Jasper is currently maintaining the trunk version and I believe that he allready had this fixed.
Anyway, when you get it on that forum then he’ll get the message automatically as well.
January 14th, 2010 at 01:06
thanks Peter. Will do. Rick
January 23rd, 2010 at 11:18
I’ve been trying to get this plugin to work with 0.3.1 of Roundcube running on CentOS 5.4 with PHP 5.1.6. The tab shows up, but clicking it presents a blank page when trying to access the URL: http://x.x.x.x/webmail/?_task=settings&_action=plugin.vacation
Is there a limitation on the PHP version or something that requires me to upgrade? Any help would be appreciated.
January 25th, 2010 at 18:43
@PeterRuiter
I have sent You Polish translation pl_PL.inc file. I found an e-mail address in README.txt. You didn’t respond. Is this address up to date?
I have new version and I would like to send the file again.
January 25th, 2010 at 22:49
@Rafal – Sorry, but I haven’t seen it before. I think it might have ended up in my spamfolder.
Could you please send it to the info [at] peterruiter.com e-mail address. Then I’ll add it to the trunk right away.
January 25th, 2010 at 22:50
@Edmund – That setup should work perfectly. We just fixed some bugs, so if you please could check out the svn version from the sourceforge repo and test that.
July 20th, 2010 at 07:48
Hey,
Just installed the plugin and am getting the new tab in Roundcube but when i click on it I get
CONFIGURATION ERROR
Vacation plugin: Cannot login to FTP-server ‘localhost’ with username: marc.xxx@xxx.xx.xx
Please read the INSTALL instructions!
August 5th, 2010 at 04:48
@Marc, Please post your questions at the Sourceforge forums of this project. Jasper Slits is maintaining this version of the plugin and he can help you with this.
August 18th, 2010 at 14:15
Hey
I am wondering whether there is a way to make this plugin use the Postfixadmin vacation program (vacation.pl). I can successfully set the vacation messages from Postfixadmin, but i would want my users to be able to do it via Roundcube rather than having to login to two different web email programs.
August 18th, 2010 at 21:47
@clemo: That shouldn’t be to hard at all. As long as you know the vacation.pl commandline parameters to set a vacation message you can easily adjust the php (exec)code.
August 31st, 2010 at 11:17
I realised that there is not much writeup for the sieve driver. I have successfully configured managesieve with dovecot and can even set a filter for vacation message using it. But now i want to use your vacation plugin. Can you kindly guide me (and others) with some step by step instructions to achieve this. I read the INSTALL.TXT and README.TXT but the instructions for sieve driver are not there. I would gratefully appreciate this. Thanks for the great work.
August 31st, 2010 at 11:28
@Erik – sure we can guide you trough it. Could you please repost your question at the sourceforge project forums?
Then other proiectmembers can answer your questions and other users can benefit from the answer.