Hi guys,
New idea to achieve this:
*) We need Dovecot Master User, and store its username/password in iRedAdmin-Pro config file. e.g. libs/settings.py, so that iRedAdmin-Pro can login to manage users' sieve rules.
*) Show tab "Vacation" in iRedAdmin-Pro user profile page to let domain admin manage vacation settings.
*) Login as Dovecot Master User while you trying to update vacation setting
*) Create a new sieve rule, e.g. vacation-iredadmin-pro.sieve. A sample (and seems perfect) one:
require ["variables", "vacation", "include"];
# Get mail subject
if header :matches "Subject" "*" {
set "old_subject" "${1}";
}
# rule:[on_vacation]
if true
{
vacation :days 1 :subject "Vacation Auto Reply: ${old_subject}" "I am on vacation";
}
# Include previous active sieve file
include :personal "managesieve";
*) Active this new sieve file (vacation-iredadmin-pro.sieve), so that Dovecot will use it instead of old one (user defined one).
As commented in sieve file above, it will get subject of received email, and allow you to use it in auto-reply message. It will use user defined sieve rules with "include" sieve command, so that we won't mess up their mailboxes. For example, user may define filter rule to move emails from mailing lists to special mail folders.
Tested and works fine for me.
Let me know your opinions and testing results.
== UPDATE ==
*) Still need to confirm whether "include" command works with Dovecot-1.2 (RHEL/CentOS/Scientific Linux 5). Anyway, we're close to the final success.
*) We need to parse user-defined sieve file to get current vacation status, parse the one we created to get existing vacation settings.