ZhangHuangbin wrote:With Dovecot-2, you can find "sieve_before =" and "sieve_after =" in Dovecot config file, just set path to your sieve script in one of them.
Oh ok fine "sieve_before =" and "sieve_after =" meaning while incoming message and while outgoing message.
Ok sure yesterday instead of adding .sieve @ sieve_before/after i have added path to global.
And one more thing i have upgraded dovecot 2.2 and Pigeonhole 0.4.0 and now editheader is working fine when i telnet i am getting below results.
[root@kiran ~]# rpm -aq "dovecot*"
dovecot-2.2.1-0_134.el6.x86_64
dovecot-pigeonhole-0.4.0-24.el6.x86_64
dovecot-pigeonhole-devel-0.4.0-24.el6.x86_64
dovecot-managesieve-0.4.0-24.el6.x86_64
[root@kiran ~]# telnet 127.0.0.1 4190
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
"IMPLEMENTATION" "Dovecot Pigeonhole"
"SIEVE" "fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date editheader"
"NOTIFY" "mailto"
"SASL" "PLAIN LOGIN"
"STARTTLS"
"VERSION" "1.0"
OK "Dovecot ready."
What I did was I have simply added these extensions @ dovecot.conf
# Global sieve settings.
sieve_global_dir = /var/vmail/sieve
sieve_global_path = /var/vmail/sieve/dovecot.sieve
sieve_extensions = editheader fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include var
iables body enotify environment mailbox date
#sieve_before =
#sieve_after =
}
Now i am able to use editheader.
but the script which you have gave me is not working I am getting below error message can you please give me proper script.
The script which you have gave me is as below with compile error.
#
require ["editheader"];
if header :matches "X-Original-To" "*" {set "deliverto" "${1}";}
if true {
addheader :last "Deliver-To" "${deliverto}";
}
[root@kiran ~]# sievec kiran.sieve
kiran: line 3: error: unknown command 'set' (only reported once at first occurence).
kiran: error: validation failed.
sievec(root): Error: failed to compile sieve script 'kiran.sieve'
Thanks,
Kiran Reddy