Reto Glauser
2009-Feb-09 20:32 UTC
[Dovecot] redelivered mail results in mail-forwarding-loop
I try to redeliver mail for the following reason: Once in a while a user receives a mail which isn't correctly recognised as SPAM/HAM. He'll move the mail into a specific folder (say: retrain-as-spam/retrain-as-ham) and a script will retrain the mail. What I'd like to do is to redeliver the mail in order for correct (re)delivery (e.g. sieve scripts). Using sendmail to redeliver the mail I'm able to re-run the spam tests which will add it's SPAM headers and dovecot/sieve will be able to correctly file the message. I tried to just resend the mail: # /usr/sbin/sendmail -f foo at bar -v -oi foo at bar < mail but this results in a Diagnostic-Code: X-Postfix; delivery via dovecot: mail forwarding loop for foo at bar The problem is that the mail already has a "Delivered-To: foo at bar" line. The above is working when the "Delivered-To" line is being removed, and my question is if this can't be done automatically?
Ulrich Zehl
2009-Feb-09 21:06 UTC
[Dovecot] redelivered mail results in mail-forwarding-loop
On Mon, Feb 09, 2009 at 09:32:43PM +0100, Reto Glauser wrote:> The above is working when the "Delivered-To" line is being removed, and my > question is if this can't be done automatically?You can avoid generating a Delivered-To header in the first place by removing "D" from the "flags=..." part of the Postfix master.cf entry for Dovecot. This will, of course, disable this loop avoidance mechanism for all messages. If you don't want this, you'll have to teach the script that reinjects the message to remove the header.