[ic] Error handling in Util::send_mail()

JT Justman jt-lists at sirius.airdelights.com
Tue Apr 18 11:11:08 EDT 2006

Hi, everyone!

I've been having an intermittent problem the last couple days where I see:

> Error during creation of order routing copy_user:
> Error while interpolating page etc/mail_receipt:
>  Can't call method "mail" on an undefined value at
/usr/lib/interchange/lib/Vend/Util.pm line 1981.
> Error sending mail to order at airdelights.com:
> Can't call method "mail" on an undefined value at
/usr/lib/interchange/lib/Vend/Util.pm line 1981.

When a customer places an order. This is a hard failure; I think the
customer sees a 500 error, but the rest of the routes do not complete.

I have enabled debugging and I expect that I will find that this is a
local issue, but it seems to me that if the Net::SMTP object is not
constructed, we should catch it before reaching that mail($from) call;
probably even with a soft error as with failure at other points in the
function. I.e.,

my $smtp = Net::SMTP->new($mhost, Debug => $Global::Variable->{DEBUG},
Hello => $helo)
	or last SMTP;

Is there a reason not to do this?

(FC3/IC 5.5.0-200603020727 in RPC mode/site Perl v5.8.6/Apache
2.0.53/vlink/MySQL 4.1.14/qmail with goodies)

	|Waiting to fix the world since 1995|
"Progress isn't made by early risers. It's made by lazy men trying to
find easier ways to do something."
	- Robert Heinlein

More information about the interchange-users mailing list