26

Re: Mail Headers difference between iRedmail and sureserver

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.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

27 (edited by kiran 2013-05-24 14:51:08)

Re: Mail Headers difference between iRedmail and sureserver

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

28

Re: Mail Headers difference between iRedmail and sureserver

kiran wrote:

Oh ok fine "sieve_before =" and "sieve_after =" meaning while incoming message and while outgoing message.

NO. Please do your homework first, if you don't know what it's used for or what it means, please just Google, don't wait for answers here, so that you can solve issue quickly: http://wiki2.dovecot.org/Pigeonhole/Sie … n#line-124

kiran wrote:

but the script which you have gave me is not working I am getting below error message can you please give me proper script.

Please, check my old replies in this topic thread, did i mention you have to add "variables" in "require" line?

require ["variables", "editheader"];
if header :matches "X-Original-To" "*" {set "deliverto" "${1}";}
if true {
    addheader :last "Deliver-To" "${deliverto}";
}

29 (edited by kiran 2013-05-24 20:05:53)

Re: Mail Headers difference between iRedmail and sureserver

ZhangHuangbin wrote:
kiran wrote:

Oh ok fine "sieve_before =" and "sieve_after =" meaning while incoming message and while outgoing message.

NO. Please do your homework first, if you don't know what it's used for or what it means, please just Google, don't wait for answers here, so that you can solve issue quickly: http://wiki2.dovecot.org/Pigeonhole/Sie … n#line-124

kiran wrote:

but the script which you have gave me is not working I am getting below error message can you please give me proper script.

Please, check my old replies in this topic thread, did i mention you have to add "variables" in "require" line?

require ["variables", "editheader"];
if header :matches "X-Original-To" "*" {set "deliverto" "${1}";}
if true {
    addheader :last "Deliver-To" "${deliverto}";
}

Hi Thanks for reply and quick help. I am very thank full to you to resolve my issue.

My issue solved.

I have used below script which i have got from Dovecot mailinglist which is working well.

#
require "editheader";
require "variables";

# Take value from first header occurrence
if header :matches "X-Original-To" "*" {
    # delete existing headers to  prevent creating duplicate (optional)
    deleteheader "X-Original-To";

    # add the new header
    addheader "Delivered-To" "${1}";

}

Thanks,
Kiran Reddy

30

Re: Mail Headers difference between iRedmail and sureserver

Glad to hear that. smile