Hi, I'd like to keep all emails coming from alom-alert@anydomain and not forward those but rest of the emails will be kept and forwarded as well.
I put following in the .dovecot.sieve
if header :contains "Sender" "alom-alert@" { keep; if not header :contains "Sender" "alom-alert@" { redirect "my@emailid on server"; redirect "xyz@gmail.com"; redirect "abc@tbc.edu"; stop; } }
Is this correct?
Thanks, UG
Upendra Gandhi wrote:
I'd like to keep all emails coming from alom-alert@anydomain and not forward those but rest of the emails will be kept and forwarded as well.
I put following in the .dovecot.sieve
if header :contains "Sender" "alom-alert@" { keep; if not header :contains "Sender" "alom-alert@" { redirect "my@emailid on server"; redirect "xyz@gmail.com"; redirect "abc@tbc.edu"; stop; } }
You can find a list of available extensions in Dovecot wiki http://wiki2.dovecot.org/Pigeonhole/Sieve and include such extensions like this: require ["fileinto","regex","vacation"];
The nesting of the curly brackets seems to be wrong: The inner branch which should trigger the redirects will never be reached, since it resides inside of the bracket of condition 'if header :contains "Sender" "alom-alert@"'.
I'm thinking of something like this (without having checked syntax):
if header :contains "Sender" "alom-alert@" { keep; } redirect "my@emailid on server"; redirect "xyz@gmail.com"; redirect "abc@tbc.edu"; stop;
Regards, Daniel
On Tue, May 22, 2012 at 3:37 PM, Daniel Parthey daniel.parthey@informatik.tu-chemnitz.de wrote:
Upendra Gandhi wrote:
I'd like to keep all emails coming from alom-alert@anydomain and not forward those but rest of the emails will be kept and forwarded as well.
I put following in the .dovecot.sieve
if header :contains "Sender" "alom-alert@" { keep; if not header :contains "Sender" "alom-alert@" { redirect "my@emailid on server"; redirect "xyz@gmail.com"; redirect "abc@tbc.edu"; stop; } }
You can find a list of available extensions in Dovecot wiki http://wiki2.dovecot.org/Pigeonhole/Sieve and include such extensions like this: require ["fileinto","regex","vacation"];
The nesting of the curly brackets seems to be wrong: The inner branch which should trigger the redirects will never be reached, since it resides inside of the bracket of condition 'if header :contains "Sender" "alom-alert@"'.
I'm thinking of something like this (without having checked syntax):
if header :contains "Sender" "alom-alert@" { keep; } redirect "my@emailid on server"; redirect "xyz@gmail.com"; redirect "abc@tbc.edu"; stop;
Thanks Daniel. It worked flawlessly. I didn't need to add require statement, script worked even without it.
participants (2)
-
Daniel Parthey
-
upen