sieve filter redirect problem with 2 redirect
I install
Sun Java(tm) System Messaging Server 6.2-8.04 (built Feb 28 2007)
libimta.so 6.2-8.04 (built 19:20:35, Feb 28 2007)
SunOS sunmail 5.10 Generic_125101-01 i86pc i386 i86pc
I configure imta.cnf tcp_local channel with this parameter:
sourcefilter file:///opt/SUNWmsgsr/config/tcp_local.filter
I create the tcp_local.filter with this entry:
require "fileinto";
require "notify";
require "variables";
#BEGINFILTER
if allof(
allof(
header :contains ["To","Cc","Bcc","Resent-to","Resent-cc","Resent-bcc"] "servizio-edp@test.it",
not header :contains ["From","Sender","Resent-from","Resent-sender","Return-path"] "test.it"
),
anyof(
allof(
not header :matches ["Subject"," Comments"," Keywords"] ["SERVIZIO-EDP:*","postmaster-auto-fw:*"],
header :matches ["Subject"," Comments"," Keywords"] "*"
)
)
)
{
keep;
redirect "topolino@test.it";
redirect "pluto@test.it";
}
If I comment 1 redirect all work if I use 2 redirect this filter loop and send 10 email to topolino@test.it e 10 email to pluto@test.it
What is the problem ?
Thank's
Bye Giovanni
# 6
Hi,
Two options to fix this off the top of my head - I have got access to a messaging box at the moment so I couldn't test option (2):
1. Add the rule to a user instead of as a channel-based sieve - I explained this in your other sieve posting.
2. Use the addtag sieve extension to add "SERVIZIO-EDP:" to the front of the Subject so that the following rule matches and stops the loop:
not header :matches ["Subject"," Comments"," Keywords"] ["SERVIZIO-EDP:*","postmaster-auto-fw:*"],
e.g.
keep;
addtag "SERVIZIO-EDP:"
redirect "topolino@test.it";
redirect "pluto@test.it";
Regards,
Shane.
# 9
Excuse me for my english ....
Now my filter is this:
require "fileinto";
require "notify";
require "variables";
require "addtag";
if allof(
header :contains ["To","Cc","Bcc","Resent-to","Resent-cc","Resent-bcc"]
"servizio-edp@test.com",
not header :contains ["From","Sender","Resent-from","Resent-sender","Return-path"] "test.com",
not header :matches ["Subject"," Comments"," Keywords"] ["SERVIZIO-EDP:*","postmaster-auto-fw:*"]
)
{
keep;
addtag "SERVIZIO-EDP:";
redirect "pluto@test.com";
redirect "topolino@test.com";
};
Now I receive 10 email but with the subject not correctly changed.
1 email:
subject: SERVIZIO-EDP: SERVIZIO-EDP: subject
2 email: SERVIZIO-EDP: SERVIZIO-EDP: SERVIZIO-EDP: subject
I think that the first email must is :
1email:
subject: SERVIZIO-EDP: subject
Bye Giovanni
# 10
Hi,
Change of plan - I'm using an envelope recipient check to stop the loop. Worked fine for my limited testing.
e.g:
require "envelope";
if allof (header :contains
["To","Cc","Bcc","Resent-to","Resent-cc","Resent-bcc"] "servizio-edp@test.com",
not header :contains
["From","Sender","Resent-from","Resent-sender","Return-path"] "test.com")
{
if allof (not envelope :is "to" "pluto@test.com",
not envelope :is "to" "topolino@test.com")
{
keep;
redirect "pluto@test.com";
redirect "topolino@test.com";
};
};
Regards,
Shane.