[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@acasalud.com.ar" { keep; redirect "userB@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
Could somebody can help me.
Thanks,
--
Andrés Fernando Yacopino
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@acasalud.com.ar" { keep; redirect "userB@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
http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a...>: mail forwarding loop for userB@acasalud.com.ar http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a... 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?
The logs says:
Andrés Fernando YacopinoAug 14 21:13:25 acamail postfix/smtpd[10562]: connect from acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail postfix/smtpd[10562]: 1F9DD6FEE0: client=acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail postfix/cleanup[10564]: 1F9DD6FEE0: message-id=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21 Aug 14 21:13:25 acamail postfix/qmgr[6886]: 1F9DD6FEE0: from=senderuser@acasalud.com.ar, size=1013, nrcpt=1 (queue active) Aug 14 21:13:25 acamail postfix/smtpd[10562]: disconnect from acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail dovecot: imap-login: Login: user=<senderuser>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Aug 14 21:13:25 acamail dovecot: IMAP(senderuser): Disconnected: Logged out bytes=887/439 Aug 14 21:13:25 acamail postfix/smtpd[10568]: connect from acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail postfix/smtpd[10568]: 5E6166FEE1: client=acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail dovecot: imap-login: Login: user=<senderuser>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Aug 14 21:13:25 acamail postfix/cleanup[10564]: 5E6166FEE1: message-id=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21 Aug 14 21:13:25 acamail postfix/qmgr[6886]: 5E6166FEE1: from=senderuser@acasalud.com.ar, size=1445, nrcpt=1 (queue active) Aug 14 21:13:25 acamail postfix/smtpd[10568]: disconnect from acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail dovecot: IMAP(senderuser): Disconnected: Logged out bytes=331/6400 Aug 14 21:13:25 acamail amavis[28907]: (28907-04) Passed CLEAN, MYNETS LOCAL [127.0.0.1] [127.0.0.1] senderuser@acasalud.com.ar -> userA@acasalud.com.ar, Message-ID: f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21, mail_id: pHoDeE6btc60, Hits: -, size: 1013, queued_as: 5E6166FEE1, 226 ms Aug 14 21:13:25 acamail postfix/smtp[10565]: 1F9DD6FEE0: to=userA@acasalud.com.ar, relay=127.0.0.1[127.0.0.1]:10025, delay=0.32, delays=0.07/0.01/0.01/0.23, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=28907-04, from MTA([127.0.0.1]:10026): 250 2.0.0 Ok: queued as 5E6166FEE1) Aug 14 21:13:25 acamail postfix/qmgr[6886]: 1F9DD6FEE0: removed Aug 14 21:13:25 acamail clamsmtpd: 100028: accepted connection from: 127.0.0.1 Aug 14 21:13:25 acamail postfix/smtpd[10572]: connect from acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail postfix/smtpd[10572]: 7B5CF6FEE0: client=acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail postfix/cleanup[10564]: 7B5CF6FEE0: message-id=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21 Aug 14 21:13:25 acamail postfix/qmgr[6886]: 7B5CF6FEE0: from=senderuser@acasalud.com.ar, size=1698, nrcpt=1 (queue active) Aug 14 21:13:25 acamail postfix/smtp[10570]: 5E6166FEE1: to=userA@acasalud.com.ar, relay=127.0.0.1[127.0.0.1]:10027, delay=0.21, delays=0.02/0.02/0.08/0.09, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 7B5CF6FEE0) Aug 14 21:13:25 acamail postfix/qmgr[6886]: 5E6166FEE1: removed Aug 14 21:13:25 acamail clamsmtpd: 100028: from=senderuser@acasalud.com.ar, to=userA@acasalud.com.ar, status=CLEAN Aug 14 21:13:25 acamail postfix/smtpd[10572]: disconnect from acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail postfix/smtpd[10575]: connect from acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail postfix/smtpd[10575]: 981806FEE1: client=acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail postfix/cleanup[10564]: 981806FEE1: message-id=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21 Aug 14 21:13:25 acamail postfix/qmgr[6886]: 981806FEE1: from=senderuser@acasalud.com.ar, size=2131, nrcpt=1 (queue active) Aug 14 21:13:25 acamail postfix/smtpd[10575]: disconnect from acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:13:25 acamail postfix/smtp[10574]: 7B5CF6FEE0: to=userA@acasalud.com.ar, relay=127.0.0.1[127.0.0.1]:10029, delay=0.28, delays=0.09/0.01/0.02/0.17, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 981806FEE1) Aug 14 21:13:25 acamail postfix/qmgr[6886]: 7B5CF6FEE0: removed Aug 14 21:13:25 acamail dovecot: deliver(userA@acasalud.com.ar): sieve: msgid=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21: stored mail into mailbox 'INBOX' Aug 14 21:13:25 acamail postfix/pickup[10414]: CE2986FEE2: uid=40 from=senderuser@acasalud.com.ar Aug 14 21:13:25 acamail postfix/cleanup[10564]: CE2986FEE2: message-id=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21 Aug 14 21:13:25 acamail dovecot: deliver(userA@acasalud.com.ar): sieve: msgid=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21: forwarded to userB@acasalud.com.ar Aug 14 21:13:25 acamail postfix/qmgr[6886]: CE2986FEE2: from=senderuser@acasalud.com.ar, size=2320, nrcpt=1 (queue active) Aug 14 21:13:25 acamail postfix/pipe[10576]: 981806FEE1: to=userA@acasalud.com.ar, relay=dovecot, delay=0.23, delays=0.16/0.01/0/0.05, dsn=2.0.0, status=sent (delivered via dovecot service) Aug 14 21:13:25 acamail postfix/qmgr[6886]: 981806FEE1: removed Aug 14 21:13:25 acamail dovecot: deliver(userB@acasalud.com.ar): sieve: msgid=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21: stored mail into mailbox 'INBOX' Aug 14 21:13:25 acamail postfix/pickup[10414]: E06CF6FEE1: uid=40 from=senderuser@acasalud.com.ar Aug 14 21:13:25 acamail postfix/cleanup[10564]: E06CF6FEE1: message-id=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21 Aug 14 21:13:25 acamail dovecot: deliver(userB@acasalud.com.ar): sieve: msgid=f6b30a3d0ec2b87e332f2b51b5807c56.squirrel@10.11.0.21: forwarded to userB@acasalud.com.ar Aug 14 21:13:25 acamail postfix/pipe[10576]: CE2986FEE2: to=userB@acasalud.com.ar, relay=dovecot, delay=0.09, delays=0.02/0/0/0.07, dsn=2.0.0, status=sent (delivered via dovecot service) Aug 14 21:13:25 acamail postfix/qmgr[6886]: CE2986FEE2: removed Aug 14 21:13:25 acamail postfix/qmgr[6886]: E06CF6FEE1: from=senderuser@acasalud.com.ar, size=2480, nrcpt=1 (queue active) Aug 14 21:13:25 acamail postfix/pipe[10576]: E06CF6FEE1: to=userB@acasalud.com.ar, relay=dovecot, delay=0.06, delays=0.04/0/0/0.02, dsn=5.4.6, status=bounced (mail forwarding loop for userB@acasalud.com.ar) Aug 14 21:13:25 acamail postfix/cleanup[10564]: EC2A56FEE2: message-id=20090815001325.EC2A56FEE2@acamail.acasalud.com.ar Aug 14 21:13:25 acamail postfix/qmgr[6886]: EC2A56FEE2: from=<>, size=4406, nrcpt=1 (queue active) Aug 14 21:13:25 acamail postfix/bounce[10583]: E06CF6FEE1: sender non-delivery notification: EC2A56FEE2 Aug 14 21:13:25 acamail postfix/qmgr[6886]: E06CF6FEE1: removed Aug 14 21:13:26 acamail dovecot: deliver(senderuser@acasalud.com.ar): sieve: msgid=20090815001325.EC2A56FEE2@acamail.acasalud.com.ar: stored mail into mailbox 'INBOX' Aug 14 21:13:26 acamail postfix/pipe[10576]: EC2A56FEE2: to=senderuser@acasalud.com.ar, relay=dovecot, delay=0.05, delays=0.01/0/0/0.05, dsn=2.0.0, status=sent (delivered via dovecot service) Aug 14 21:13:26 acamail postfix/qmgr[6886]: EC2A56FEE2: removed Aug 14 21:13:28 acamail dovecot: imap-login: Login: user=<senderuser>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Aug 14 21:13:28 acamail dovecot: IMAP(senderuser): Disconnected: Logged out bytes=331/7019
Infraestructura - Dpto Sistemas
AcaSalud
Cooperativa de Prestaciones Médico Asistenciales Limitada
Tel: 0341-4208726
userB
Mauricio Tavares escribió:
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@acasalud.com.ar" { keep; redirect "userB@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
http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a...>: mail forwarding loop for userB@acasalud.com.ar http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a... 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?
Well i delete the antispam and antivirus to make a more easy reading logfile:
Aug 14 21:40:23 acamail postfix/smtpd[11036]: 8849C6FEE9:
client=acamail.acasalud.com.ar[127.0.0.1]
Aug 14 21:40:23 acamail postfix/cleanup[11038]: 8849C6FEE9:
message-id=921466190722c1dd536fd75de5756eb4.squirrel@10.11.0.21
Aug 14 21:40:23 acamail postfix/qmgr[10830]: 8849C6FEE9:
from=sender_user@acasalud.com.ar, size=1011, nrcpt=1 (queue active)
Aug 14 21:40:23 acamail postfix/smtpd[11036]: disconnect from
acamail.acasalud.com.ar[127.0.0.1]
Aug 14 21:40:23 acamail dovecot: imap-login: Login: user=
Andrés Fernando Yacopino
Infraestructura - Dpto Sistemas
AcaSalud
Cooperativa de Prestaciones Médico Asistenciales Limitada
Tel: 0341-4208726
ayacopino@acasalud.com.ar
Mauricio Tavares escribió:
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@acasalud.com.ar" { keep; redirect "userB@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
http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a...>: mail forwarding loop for userB@acasalud.com.ar http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a... 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?
Well i delete the antispam and antivirus to make a more easy reading logfile:
Aug 14 21:40:23 acamail postfix/smtpd[11036]: 8849C6FEE9: client=acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:40:23 acamail postfix/cleanup[11038]: 8849C6FEE9: message-id=921466190722c1dd536fd75de5756eb4.squirrel@10.11.0.21 Aug 14 21:40:23 acamail postfix/qmgr[10830]: 8849C6FEE9: from=sender_user@acasalud.com.ar, size=1011, nrcpt=1 (queue active) Aug 14 21:40:23 acamail postfix/smtpd[11036]: disconnect from acamail.acasalud.com.ar[127.0.0.1] Aug 14 21:40:23 acamail dovecot: imap-login: Login: user=
, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Aug 14 21:40:23 acamail dovecot: deliver(usera@acasalud.com.ar): sieve: msgid=921466190722c1dd536fd75de5756eb4.squirrel@10.11.0.21: stored mail into mailbox 'INBOX' Aug 14 21:40:23 acamail postfix/pickup[10831]: A9DA56FEED: uid=40 from=sender_user@acasalud.com.ar Aug 14 21:40:23 acamail postfix/cleanup[11038]: A9DA56FEED: message-id=921466190722c1dd536fd75de5756eb4.squirrel@10.11.0.21 Aug 14 21:40:23 acamail dovecot: deliver(usera@acasalud.com.ar): sieve: msgid=921466190722c1dd536fd75de5756eb4.squirrel@10.11.0.21: forwarded to userb@acasalud.com.ar Aug 14 21:40:23 acamail postfix/pipe[11039]: 8849C6FEE9: to=usera@acasalud.com.ar, relay=dovecot, delay=0.15, delays=0.07/0.03/0/0.06, dsn=2.0.0, status=sent (delivered via dovecot service) Aug 14 21:40:23 acamail postfix/qmgr[10830]: 8849C6FEE9: removed Aug 14 21:40:23 acamail postfix/qmgr[10830]: A9DA56FEED: from=sender_user@acasalud.com.ar, size=1198, nrcpt=1 (queue active) Aug 14 21:40:23 acamail dovecot: IMAP(sender_user): Disconnected: Logged out bytes=887/438 Aug 14 21:40:23 acamail dovecot: imap-login: Login: user= , method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Aug 14 21:40:24 acamail dovecot: deliver(userb@acasalud.com.ar): sieve: msgid=921466190722c1dd536fd75de5756eb4.squirrel@10.11.0.21: stored mail into mailbox 'INBOX' Aug 14 21:40:24 acamail dovecot: IMAP(sender_user): Disconnected: Logged out bytes=139/1580 Aug 14 21:40:24 acamail dovecot: deliver(userb@acasalud.com.ar): sieve: msgid=921466190722c1dd536fd75de5756eb4.squirrel@10.11.0.21: forwarded to userb@acasalud.com.ar Aug 14 21:40:24 acamail postfix/pipe[11039]: A9DA56FEED: to=userb@acasalud.com.ar, relay=dovecot, delay=0.44, delays=0.03/0.03/0/0.39, dsn=2.0.0, status=sent (delivered via dovecot service) Aug 14 21:40:24 acamail postfix/qmgr[10830]: A9DA56FEED: removed Aug 14 21:40:24 acamail postfix/pickup[10831]: 2064C6FEEC: uid=40 from=sender_user@acasalud.com.ar Aug 14 21:40:24 acamail postfix/cleanup[11038]: 2064C6FEEC: message-id=921466190722c1dd536fd75de5756eb4.squirrel@10.11.0.21 Aug 14 21:40:24 acamail postfix/qmgr[10830]: 2064C6FEEC: from=sender_user@acasalud.com.ar, size=1354, nrcpt=1 (queue active) Aug 14 21:40:24 acamail postfix/pipe[11039]: 2064C6FEEC: to=userb@acasalud.com.ar, relay=dovecot, delay=0.07, delays=0.06/0/0/0.01, dsn=5.4.6, status=bounced (mail forwarding loop for userb@acasalud.com.ar) Aug 14 21:40:24 acamail postfix/cleanup[11038]: 262F06FEED: message-id=20090815004024.262F06FEED@acamail.acasalud.com.ar Aug 14 21:40:24 acamail postfix/qmgr[10830]: 262F06FEED: from=<>, size=3282, nrcpt=1 (queue active) Aug 14 21:40:24 acamail postfix/bounce[11050]: 2064C6FEEC: sender non-delivery notification: 262F06FEED Aug 14 21:40:24 acamail postfix/qmgr[10830]: 2064C6FEEC: removed Aug 14 21:40:24 acamail dovecot: deliver(sender_user@acasalud.com.ar): sieve: msgid=20090815004024.262F06FEED@acamail.acasalud.com.ar: stored mail into mailbox 'INBOX' Aug 14 21:40:24 acamail postfix/pipe[11039]: 262F06FEED: to=sender_user@acasalud.com.ar, relay=dovecot, delay=0.04, delays=0.01/0/0/0.03, dsn=2.0.0, status=sent (delivered via dovecot service) Aug 14 21:40:24 acamail postfix/qmgr[10830]: 262F06FEED: removed Andrés Fernando Yacopino
Infraestructura - Dpto Sistemas
AcaSalud
Cooperativa de Prestaciones Médico Asistenciales Limitada
Tel: 0341-4208726
ayacopino@acasalud.com.ar
Mauricio Tavares escribió:
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@acasalud.com.ar" { keep; redirect "userB@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
http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a...>: mail forwarding loop for userB@acasalud.com.ar http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a... 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?
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@acasalud.com.ar" { keep; redirect "userB@acasalud.com.ar"; }
So that's a global script, right?
The redirection works but the sender user (userA) get the following error: ..
http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a...>: 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.
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@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@acasalud.com.ar" { keep; redirect "userB@acasalud.com.ar"; }
So that's a global script, right?
The redirection works but the sender user (userA) get the following error:
..
http://10.11.0.21/webmail/src/compose.php?send_to=ayacopino%40acasalud.com.a...>: 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.
On Fri, 2009-08-14 at 19:37 -0300, Andrés Yacopino wrote:
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@acasalud.com.ar"
It seems it didnt' but why?, can you explain better?
Redirection doesn't modify To or Cc headers.
If you want this redirection to work only for userA, why is it in a global after script anyway, instead of userA's own script?
Timo Sirainen wrote:
On Fri, 2009-08-14 at 19:37 -0300, Andrés Yacopino wrote:
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@acasalud.com.ar"
It seems it didnt' but why?, can you explain better?
Redirection doesn't modify To or Cc headers.
If you want this redirection to work only for userA, why is it in a global after script anyway, instead of userA's own script?
You could use the envelope test, but I agree: what is the reason for this odd/interesting setup?
Regards,
Stephan.
participants (5)
-
Andrés Yacopino
-
Charles Marcus
-
Mauricio Tavares
-
Stephan Bosch
-
Timo Sirainen