Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I try to use Mail::Box and I want to bounce some message from a Catchall MBox to original destination.

#!/usr/bin/perl use warnings; use strict; use Mail::Box::Manager; # paquet libmail-box-perl my $mailspool = "/var/spool/mail/catch-all"; my $mgr = Mail::Box::Manager->new; my $folder = $mgr->open(folder => $mailspool, remove_when_empty => 0,) or die ("Erreur d'ouverture de $mailspool :\n $!\n +"); foreach my $msg ($folder->messages) { # all messages my $xoriginalto = $msg->study('X-Original-To'); # bounce $msg #my $bounce = $msg->bounce(To => $xoriginalto); #$bounce->send; } $folder->close(); $mgr->closeAllFolders;

Before sending them, I have create user account. I use Postfix for MTA, with this particular parameter

luser_relay = catchall local_recipient_maps =

The bounced emails with this script, go to /var/mail/nobody. The reason seem to be "Forwarding loop to <destination>".

When I bounce from a account to the same destination, it works. Only the script don't work and I don't know why.

Could you help me ?

Thanks

Replies are listed 'Best First'.
Re: Mail::Box message->bounce give me a forwarding loop
by Anonymous Monk on Oct 11, 2011 at 09:03 UTC
    I response to myself, the reason is Postfix drop bounce message. The mutt client remove a field (deliver-to) to pass the bounce thourgh postfix and same mta.