From be25aa03e6c6cf7c9156b1b05f11c672c5c423be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Tue, 6 Aug 2002 13:04:51 +0000 Subject: [PATCH] delete the spool file when we are done with it git-svn-id: https://svn.perl.org/qpsmtpd/branches/v010@44 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd/Transaction.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Qpsmtpd/Transaction.pm b/lib/Qpsmtpd/Transaction.pm index 0ce8db9..3e17bb5 100644 --- a/lib/Qpsmtpd/Transaction.pm +++ b/lib/Qpsmtpd/Transaction.pm @@ -102,4 +102,16 @@ sub body_getline { } +sub DESTROY { + my $self = shift; + # would we save some disk flushing if we unlinked the file before + # closing it? + + undef $self->{_body_file} if $self->{_body_file}; + if ($self->{_filename} and -e $self->{_filename}) { + unlink $self->{_filename} or $self->log(0, "Could not unlink ", $self->{_filename}, ": $!"); + } +} + + 1;