Roundcube Community Forum

 

PostfixAdmin Vacation plugin (again!?)

Started by k1piee, September 09, 2010, 04:55:42 AM

Previous topic - Next topic

k1piee

Hi!

I've been searching around for a simple plugin that sort of integrates the Postfixadmin vacation/autoreply in Roundcube.
I found this: Roundcube and postfixadmin
But I can't really get it to work properly.. I get an error message every time I try to save the vacation messge, either [internalerror] or just that the message couldn't be saved.

If I check the database I can see that it doesn't add information to the "domain" and "created" fields. Also, it seems to work fine to save the message a first time, but if I try to update it thats when I get the error messages. And he has modified the vacation.pl script too to add the "active from" and "active to" which for me isn't really necessary to have. Just a simple "Subject","Message" and "Active" will do just like in Postfixadmin.

I'm no programmer and barely understands PHP, but wouldn't it be kind of simple to just take some code from the Postfixadmin vacation and make a simple plugin for Roundcube? Or is it more than that that has to be done?


I would really appreciate if someone could help me out here!

I also found a "postfixadmin to roundcube bridge" but that project was discontinued and doesn't seem to work anymore, and I've been searching around for a good plugin but can't seem to find one that just do the trick..

Thanks,
-Patric

k1piee

I checked arround a little bit what database modifications Postfixadmin does when vacation/autoreply is activated.

This is the database "postfix":

+-----------------------+
| Tables_in_postfix     |
+-----------------------+
| admin                 |
| alias                 |
| alias_domain          |
| config                |
| domain                |
| domain_admins         |
| fetchmail             |
| log                   |
| mailbox               |
| quota                 |
| quota2                |
| transport             |
| transport_copyto      |
| transport_mail        |
| vacation              |
| vacation_notification |
+-----------------------+


The "alias" table looks like this:

+----------+--------------+------+-----+---------------------+-------+
| Field    | Type         | Null | Key | Default             | Extra |
+----------+--------------+------+-----+---------------------+-------+
| address  | varchar(255) | NO   | PRI | NULL                |       |
| goto     | text         | NO   |     | NULL                |       |
| domain   | varchar(255) | NO   | MUL | NULL                |       |
| created  | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| modified | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| active   | tinyint(1)   | NO   |     | 1                   |       |
+----------+--------------+------+-----+---------------------+-------+


When vacation/autoreply is activated the "goto" field is added a new adress.
At first it's: "[email protected]" and after it's "[email protected],test#[email protected]"

The "autoreply.domain.com" is specified in the configuration.

The vacation table looks like this:

+---------+--------------+------+-----+---------------------+-------+
| Field   | Type         | Null | Key | Default             | Extra |
+---------+--------------+------+-----+---------------------+-------+
| email   | varchar(255) | NO   | PRI | NULL                |       |
| subject | varchar(255) | NO   |     | NULL                |       |
| body    | text         | NO   |     | NULL                |       |
| cache   | text         | NO   |     | NULL                |       |
| domain  | varchar(255) | NO   |     | NULL                |       |
| created | datetime     | NO   |     | 0000-00-00 00:00:00 |       |
| active  | tinyint(1)   | NO   |     | 1                   |       |
+---------+--------------+------+-----+---------------------+-------+


And the information is added/modified like this:

email: "[email protected]"
subject: "autoreply" (or whatever you write)
body: "On vacation" (or whatever autoreply you want to send)
cache: this is empty, don't know what it's for.
domain: "domain.com" the domain name from the email-adress.
created: "2010-09-10 12:30:21" current date when activated.
active: "1" 1 if active, 0 if not.

I'm no expert but that doesn't look so hard to make a simple plugin that modifies those database entries with two simple text fields and maybe a checkbox for active/not-active..

Someone who's feeling they can manage the task? :D
It would seriously be frigign awesome if it would be done and I would be forever grateful!

Thanks,
-Patric

k1piee

Bump!

I asked over at Postfixadmin forums and they told me that I should use XMLRPC instead of modifying the actual database itself. Apparently it's easier to use XMLRPC too, though I have seriously No programming skills when it comes to PHP and XMLRPC, the only skills I have is some "hello world" apps written in Java 5 years ago so..

Anyone who wants to help out? :)

thanks,
-Patric