geektron has asked for the wisdom of the Perl Monks concerning the following question:
Seems that processes that use Mail::Internet end up running out of memory. The error isn't reported from the script itself; it comes from the mailserver attempting to contact the alias that handles the auto-responder.
The error message is below ( with the obvious 'violation of security info' changed to protect the innocent, and the guilty):
and the code in question:The original message was received at Tue, 10 Oct 2000 06:05:03 -0700 ( +PDT) from mailer.foo.com [xxx.xxx.xxx.xxx] ----- The following addresses had permanent fatal errors ----- "|<full path removed>autorespond.pl responder" (expanded from: <responder@appserv.foo.com>) ----- Transcript of session follows ----- Out of memory! 554 "|< full path removed>autorespond.pl responder"... unknown mailer error 1
my $mail = Mail::Internet->new(\*STDIN); my $header = $mail->head; my $to = $mail->get('To'); my $subject = $mail->get('Subject'); my $from = $mail->get('From'); chomp( $to, $subject, $from ); ### some processing logic that says "don't send if =~ /stuff/ my $newbody = &loadMessage; my $rply = Mail::Internet->new(); $rply=$mail->reply(); $rply->replace('From',"nobody\@foo.com"); $rply->replace('Reply-To',"nobody\@foo.com"); $rply->replace('X-Loop','already_processed'); $rply->body("$newbody"); $rply->smtpsend() or die "COuldn't send $!"; undef $rply;
sub loadMessage is just an 'open' statement that returns a text string.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Mail::Internet memory leaks??
by geektron (Curate) on Oct 11, 2000 at 07:09 UTC | |
|
(jcwren) RE: Mail::Internet memory leaks??
by jcwren (Prior) on Oct 11, 2000 at 21:30 UTC | |
by geektron (Curate) on Oct 11, 2000 at 22:00 UTC | |
by geektron (Curate) on Oct 12, 2000 at 02:42 UTC | |
|
Re: Mail::Internet memory leaks??
by AgentM (Curate) on Oct 11, 2000 at 21:20 UTC | |
by Fastolfe (Vicar) on Oct 11, 2000 at 21:29 UTC | |
by AgentM (Curate) on Oct 11, 2000 at 23:28 UTC |