Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update #28

Closed
MoonshineSG opened this issue Mar 6, 2015 · 11 comments
Closed

update #28

MoonshineSG opened this issue Mar 6, 2015 · 11 comments

Comments

@MoonshineSG
Copy link

Is this still under development ? seams like hasn't ben updated in a while, and roundcube is now @ version 1.1.0 and the plugin is broken..

@wpoely86
Copy link
Contributor

wpoely86 commented Mar 6, 2015

Well, @bhuisgen seems to have abandoned it? Would you mean if we take over?

I've been using this plugin with 1.1.0 without troubles. What doesn't work for you?

@MoonshineSG
Copy link
Author

there's an error saying the "cache" is not optional, which i "solved" by adding a default value in the db schema
and the from-to dates dont get saved/read from the DB

if you use posfixadmin, you see how it should behave (which is my workaround)

@wpoely86
Copy link
Contributor

wpoely86 commented Mar 6, 2015

Which driver are you using? sql? Can you post your config?

@MoonshineSG
Copy link
Author

yes, mysql backend for my postfix.

the only change to the config i made was the DB config (user/password) and set "vacation_gui_vacationdate" to TRUE

the dates seams that are not save in the DB

mysql> select activefrom, activeuntil from vacation;
+---------------------+---------------------+
| activefrom | activeuntil |
+---------------------+---------------------+
| 2000-01-01 13:00:00 | 2000-01-01 13:00:00 |
+---------------------+---------------------+
1 row in set (0.01 sec)

@jurim76
Copy link

jurim76 commented Apr 2, 2015

Seems that $rcmail_config['vacation_gui_vacationmessage_html'] = TRUE option does not work anymore.

@nightah
Copy link

nightah commented Mar 15, 2016

As per my post in #26:

The values are generated in php as Unix time, however Postfix requires them in 'YYYY-MM-DD HH:MM:SS' format.

Below the write query is converted to the required format for Postfix to store and action.
The read query needs to be converted back to Unix time so when you are interacting with the jquery calendar you get the stored time (if it exists) as opposed to a time of '01-01-1970' in the widget.

Change the following sections in your config.inc.php:

// read data queries
$rcmail_config['vacation_sql_read'] =
// MySQL
array(
"SELECT
subject AS vacation_subject,
body AS vacation_message,
active AS vacation_enable,
UNIX_TIMESTAMP(activefrom) AS vacation_start,
UNIX_TIMESTAMP(activeuntil) AS vacation_end
FROM vacation
WHERE email=%username AND domain=%email_domain;"
);

// write data queries
$rcmail_config['vacation_sql_write'] =
// MySQL
array(
"DELETE FROM vacation WHERE email=%email AND domain=%email_domain;",
"INSERT INTO vacation (email,domain,subject,body,created,active,activefrom,activeuntil)
VALUES (%email,%email_domain,%vacation_subject,%vacation_message,NOW(),%vacation_enable,FROM_UNIXTIME(%vacation_start, '%Y-%m-%d 00:00:00'),FROM_UNIXTIME(%vacation_end, '%Y-%m-%d 23:59:59'));",

@MoonshineSG
Copy link
Author

Although I am no longer using this, it's good to know there's a solution to it.

@jurim76
Copy link

jurim76 commented Mar 15, 2016

Hi,

This solution does not work for LDAP driver.

On Tue, Mar 15, 2016 at 12:43 PM, ovidiu [email protected] wrote:

Although I am no longer using this, it's good to know there's a solution
to it.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#28 (comment)

@nightah
Copy link

nightah commented Mar 15, 2016

This solution is specifically for the SQL Postfix integration as per the comments in the issue.

I believe for your LDAP issue you would have to actually assign attributes to the following:

// Attribute name to map vacation start
$rcmail_config['vacation_ldap_attr_vacationstart'] = null;

// Attribute name to map vacation end
$rcmail_config['vacation_ldap_attr_vacationend'] = null;

and ensure that the following areas are also changed to include the attributes you define above instead of 'null':

// Search attributes to read data
$rcmail_config['vacation_ldap_search_attrs'] = array (
                                                'vacationActive',
                                                'vacationInfo');

// array of DN to use for modify operations required to write data.
$rcmail_config['vacation_ldap_modify_dns'] = array (
 'cn=%email_local,ou=Mailboxes,dc=%email_domain,ou=MailServer,dc=ldap,dc=my,dc=domain'
);

// array of operations required to write data.
$rcmail_config['vacation_ldap_modify_ops'] = array(
    array ('replace' => array(
            $rcmail_config['vacation_ldap_attr_vacationenable'] => '%vacation_enable',
            $rcmail_config['vacation_ldap_attr_vacationmessage'] => '%vacation_message',
            $rcmail_config['vacation_ldap_attr_vacationforwarder'] => '%vacation_forwarder'
          )

Looking at the LDAP driver it looks like if you define those values you should be okay.
Good luck!

Hi,

This solution does not work for LDAP driver.

@jurim76
Copy link

jurim76 commented Mar 16, 2016

The problem is LDAP keeps a date as is, in unix time and jquery calendar
does not work as expected.

On Wed, Mar 16, 2016 at 1:55 AM, Amir Zarrinkafsh [email protected]
wrote:

This solution is specifically for the SQL Postfix integration as per the
comments in the issue.

I believe for your LDAP issue you would have to actually assign attributes
to the following:

// Attribute name to map vacation start
$rcmail_config['vacation_ldap_attr_vacationstart'] = null;

// Attribute name to map vacation end
$rcmail_config['vacation_ldap_attr_vacationend'] = null;

and ensure that the following areas are also changed to include the
attributes you define above instead of 'null':

// Search attributes to read data
$rcmail_config['vacation_ldap_search_attrs'] = array (
'vacationActive',
'vacationInfo');

// array of DN to use for modify operations required to write data.
$rcmail_config['vacation_ldap_modify_dns'] = array (
'cn=%email_local,ou=Mailboxes,dc=%email_domain,ou=MailServer,dc=ldap,dc=my,dc=domain'
);

// array of operations required to write data.
$rcmail_config['vacation_ldap_modify_ops'] = array(
array ('replace' => array(
$rcmail_config['vacation_ldap_attr_vacationenable'] => '%vacation_enable',
$rcmail_config['vacation_ldap_attr_vacationmessage'] => '%vacation_message',
$rcmail_config['vacation_ldap_attr_vacationforwarder'] => '%vacation_forwarder'
)

Looking at the LDAP driver it looks like if you define those values you
should be okay.
Good luck!

Hi,

This solution does not work for LDAP driver.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#28 (comment)

@nightah
Copy link

nightah commented Mar 17, 2016

Based on my testing I noticed that the jquery calendar is expecting the date in unix time though, so I believe the issue might actually be something else.

The problem is LDAP keeps a date as is, in unix time and jquery calendar
does not work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants