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

[1242 byte] By [giovanni.romaneghia] at [2007-11-27 3:59:52]
# 1
Hi,What you have provided looks like a filter that UWC creates - which is designed to go on a users entry and not in a channel filter. Rather then trying to debug this particular filter, how about you tell us what you are trying to do?Regards,Shane.
shane_hjortha at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 2
My problem is:I want create a filter on tcp_local that when receive a mail from external user I want forward this mail to other 3 user. What is the correct procedure ?
giovanni.romaneghia at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 3
From ANY external user?To any particular internal user?Please give more detail for what you want.
jay_plesseta at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 4
I rewrite: I want that when the user giovanni@test.it receive email only from internet user forward this email to 3 o 4 external user.When the user giovanni@test.it receive mail local domain not forward. Bye Giovanni
giovanni.romaneghia at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 5
Only for 4 o 5 internal user. ex: giovanni@test.it test@test.ittest2@test.it Bye Giovanni
giovanni.romaneghia at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 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.

shane_hjortha at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 7
In this mode don't work !!! Giovanni
giovanni.romaneghia at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 8
Hi,Apologies, you need to also add "addtag" to your require list i.e.require "addtag";Regards,Shane.
shane_hjortha at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 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

giovanni.romaneghia at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 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.

shane_hjortha at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 11
WORK !!! Thank you very much !!!Thank's Giovanni
giovanni.romaneghia at 2007-7-12 9:04:27 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...