Andrés Yacopino
2009-Aug-14 20:17 UTC
[Dovecot] Redirecting mail gives 'mail forwarding loop' to the sender - calling for sieve help
Greetings, i am testing: - dovecot-1.2-sieve-0.1.11 - dovecot 1.2.3 - dovecot-1.2-managesieve-0.11.8 (with patch) I am trying to use sieve_after to execute some redirection of mails. I have put in the after script: require "include"; require "fileinto"; if header :contains ["To","Cc"] "userA at acasalud.com.ar" { keep; redirect "userB at acasalud.com.ar"; } The redirection works but the sender user (userA) get the following error: This is the mail system at host acamail.acasalud.com.ar. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. The mail system <userB at acasalud.com.ar <http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.ar>>: mail forwarding loop for userB at acasalud.com.ar <http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.ar> Could somebody can help me. Thanks, -- Andr?s Fernando Yacopino
Mauricio Tavares
2009-Aug-14 20:32 UTC
[Dovecot] Redirecting mail gives 'mail forwarding loop' to the sender - calling for sieve help
Andr?s Yacopino wrote:> Greetings, i am testing: > > - dovecot-1.2-sieve-0.1.11 > - dovecot 1.2.3 > - dovecot-1.2-managesieve-0.11.8 (with patch) > > I am trying to use sieve_after to execute some redirection of mails. > > I have put in the after script: > > require "include"; > require "fileinto"; > > if header :contains ["To","Cc"] "userA at acasalud.com.ar" > { > keep; > redirect "userB at acasalud.com.ar"; > } > > The redirection works but the sender user (userA) get the following error: > > This is the mail system at host acamail.acasalud.com.ar. > > I'm sorry to have to inform you that your message > could not > be delivered to one or more recipients. It's > attached below. > > The mail system > > <userB at acasalud.com.ar > <http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.ar>>: > mail forwarding loop > for userB at acasalud.com.ar > <http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.ar> > > > > > Could somebody can help me. > > Thanks, >What does your log file says? Also, you could cheat and tell it to use copy instead of keep and redirect?
Timo Sirainen
2009-Aug-14 21:46 UTC
[Dovecot] Redirecting mail gives 'mail forwarding loop' to the sender - calling for sieve help
On Fri, 2009-08-14 at 17:17 -0300, Andr?s Yacopino wrote:> I am trying to use sieve_after to execute some redirection of mails. > > I have put in the after script: > > require "include"; > require "fileinto"; > > if header :contains ["To","Cc"] "userA at acasalud.com.ar" > { > keep; > redirect "userB at acasalud.com.ar"; > }So that's a global script, right?> The redirection works but the sender user (userA) get the following error:..> <userB at acasalud.com.ar <http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.ar>>: mail forwarding loopI suppose it's because when usera sends to userb, userb executes the global script again and the mail is redirected to userb again, which triggers the loop detection. Either disable after script from userb or add some check there so that it doesn't get redirected again. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090814/56806a07/attachment-0002.bin>
Andrés Yacopino
2009-Aug-14 22:37 UTC
[Dovecot] Redirecting mail gives 'mail forwarding loop' to the sender - calling for sieve help
Yes, that is a global script. Yes you are the right , the script is executed again but i thought that this line do the verification to avoid this: if header :contains ["To","Cc"] "userA at acasalud.com.ar" It seems it didnt' but why?, can you explain better? Thanks a lot, Andr?s Fernando Yacopino Timo Sirainen escribi?:> On Fri, 2009-08-14 at 17:17 -0300, Andr?s Yacopino wrote: > >> I am trying to use sieve_after to execute some redirection of mails. >> >> I have put in the after script: >> >> require "include"; >> require "fileinto"; >> >> if header :contains ["To","Cc"] "userA at acasalud.com.ar" >> { >> keep; >> redirect "userB at acasalud.com.ar"; >> } >> > > So that's a global script, right? > > >> The redirection works but the sender user (userA) get the following error: >> > .. > >> <userB at acasalud.com.ar <http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.ar>>: mail forwarding loop >> > > I suppose it's because when usera sends to userb, userb executes the > global script again and the mail is redirected to userb again, which > triggers the loop detection. Either disable after script from userb or > add some check there so that it doesn't get redirected again. >
Andrés Yacopino
2009-Aug-15 15:25 UTC
[Dovecot] Redirecting mail gives 'mail forwarding loop' to the sender - calling for sieve help
Yes, the configuration seems odd or interesting as you said. The idea behind this is: - Before scripts will be use for filtering spam, when they have SPAM header. Not problem at it. - User scripts will be used for vacation messages. These are created with Squirrelmail and avelsize plugin (user interaction) - After scripts will be used for doing redirections, such as forwarding mail to a blackberry account(not problem at it) or forwarding to another user account (in the same domain, the problem is here). The reason not to put the redirections or forwarding in users scripts is to avoid users deleting redirections and have in one file all the redirections. I also try to use redirections from avelsieve plugin (0.9.9.9) and it works the forwarding but it didn't work the keep command, the mail is forwarded but the user doesn't have a copy of it. I will investigate your advice for envelope or try to use user's scripts. I didn't know about original headers, if this in RFC sieve documents? Thanks Timo and thanks Stephan for the tips. Greetings, Andr?s. Andr?s Yacopino. Dpto Sistemas AcaSalud
Possibly Parallel Threads
- Compilation of dovecot-1.2-sieve-0.1.3 under Solaris 10 for Sparc
- Dovecot 1.2 beta1 in Solaris 10 for sparc, error reading maildir format?
- Auto discard sieve vacation messages
- Problem with recompiling sieve scripts after migrating to Dovecot 2.0 from 1.2
- Master Users