Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending mail from a pipe avoiding loop

1 view
Skip to first unread message

Cherny D. C. Berbesí I.

unread,
Jun 30, 2009, 2:25:11 PM6/30/09
to
Hi, I'm using a pipe to rewrite some recipient address, this is the
code:

#!/usr/bin/perl -w
@MAILOPTS = ("-oi", "-t");
while ( <> ) {
$cuerpo .= $_;
}
$cuerpo =~ s/domain.com/domain.com.ve/gi;
open(MAIL, "|-") || exec("/usr/sbin/sendmail", @MAILOPTS);
print MAIL $cuerpo;
close(MAIL);

The problem is that sending again the mail creates a loop, how can I
avoid it?.

Thanks.

Cherny D. C. Berbesí I.

unread,
Jul 12, 2009, 7:34:20 AM7/12/09
to
On Jul 1, 1:25 pm, Cherny D. C. Berbesí I. <cherny.berb...@gmail.com>
wrote:

Resolved, I created a chroot postfix, in the main postfix I set
transport maps for external mail to chroot postfix. In the chroot I
set smtp generics maps to some address. That's all.

0 new messages