ZhangHuangbin wrote:icedevil wrote:i like roundcube filters. i can use it like this, but people from business want separate vacation tab in roundcube settings ...
Agree. Roundcube filter is not user-friendly.
If anyone wants to install a vacation plugin to set "out of office" from a user friendly interface:
I used freeBSD 8.0 in this tutorial.
1)-------------------------------------------------------------------------------
pw groupadd vacation
pw useradd vacation -c Virtual\ Vacation -d /nonexistent -g vacation -s /sbin/nologin
mkdir /var/spool/vacation
cp /usr/local/www/postfixadmin/VIRTUAL_VACATION/vacation.pl /var/spool/vacation/
chown -R vacation:vacation /var/spool/vacation/
chmod 700 /var/spool/vacation/
chmod 750 /var/spool/vacation/vacation.pl
2)-------------------------------------------------------------------------------
edit /var/spool/vacation/vacation.pl
{
$db_type = 'mysql';
$db_host = 'localhost';
$db_user = 'vmail';
$db_pass = 'postfix_sql_password';
$db_name = 'vmail';
$syslog = 1;
}
MYSQL GRANTS
mysql> SHOW GRANTS FOR vmail@localhost;
+--------------------------------------------------------------------------------------------------------------+
| Grants for vmail@localhost |
+--------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'vmail'@'localhost' IDENTIFIED BY PASSWORD 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' |
| GRANT SELECT ON `vmail`.* TO 'vmail'@'localhost' |
| GRANT INSERT, DELETE ON `vmail`.`vacation` TO 'vmail'@'localhost' |
| GRANT SELECT ON `vmail`.`mailbox` TO 'vmail'@'localhost' |
| GRANT SELECT, INSERT, DELETE ON `vmail`.`alias` TO 'vmail'@'localhost' |
| GRANT SELECT, INSERT, DELETE ON `vmail`.`vacation_notification` TO 'vmail'@'localhost' |
+--------------------------------------------------------------------------------------------------------------+
3)-------------------------------------------------------------------------------
append /usr/local/etc/postfix/master.cf with
vacation unix - n n - - pipe
flags=DRhu user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} ${recipient}
edit /usr/local/etc/postfix/main.cf
transport_maps = [...] hash:/usr/local/etc/postfix/vacation
vacation_destination_recipient_limit = 1
[replace autoreply.domain.tld]
echo 'autoreply.domain.tld vacation:' >> /usr/local/etc/postfix/vacation
postmap /usr/local/etc/postfix/vacation
postfix reload
4)-------------------------------------------------------------------------------
- get vacation plugin http://github.com/bhuisgen/rc-vacation/
- copy the plugin to /usr/local/www/roundcube/plugins/
- add ,"vacation" into $rcmail_config['plugins'] - /usr/local/www/roundcube/config/main.inc.php
edit /usr/local/www/roundcube/plugins/vacation/config.inc.php and replace $rcmail_config['vacation_sql_write'] and autoreply.domain.ltd with your needs.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
// write data queries
$rcmail_config['vacation_sql_write'] =
array("DELETE FROM vacation WHERE email=%email AND " .
"domain=%email_domain;",
"DELETE from vacation_notification WHERE on_vacation=%email;",
"DELETE FROM alias WHERE address=%email AND " .
"domain=%email_domain;",
"INSERT INTO vacation (email,domain,subject,body,created," .
"active) " .
"SELECT %email,%email_domain,%vacation_subject," .
"%vacation_message,NOW(),1 FROM mailbox " .
"WHERE username=%email AND domain=%email_domain AND " .
"%vacation_enable=1;",
"INSERT INTO alias (address,goto,domain,created,modified," .
"active) " .
"SELECT %email,CONCAT(%email_local,'#',%email_domain,'@'," .
"'autoreply.domain.ltd,',%email_local,'@',%email_domain),%email_domain,NOW(),NOW(),1 " .
"FROM mailbox WHERE username=%email AND " .
"domain=%email_domain AND %vacation_enable=1;",
"INSERT INTO alias (address,goto,domain,created,modified,active) SELECT %email,CONCAT(%email_local,'@',%email_domain),%email_domain,NOW(),NOW(),1 FROM mailbox WHERE username=%email AND domain=%email_domain AND %vacation_enable=0;"
);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
ee /var/spool/vacation/vacation.pl
replace: 'ctype' => 'text/plain; charset=UTF-8',
with: 'ctype' => 'text/html; charset=UTF-8',
on line: 443
make a test