summaryrefslogtreecommitdiff
path: root/Echolot/Tools.pm
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2002-07-10 21:46:28 +0000
committerPeter Palfrader <peter@palfrader.org>2002-07-10 21:46:28 +0000
commita532aec4ebe68b712a74ba9bad0839b90d4ef7a9 (patch)
treeb2778522e045e0b476eda113514b9a7c2950f343 /Echolot/Tools.pm
parentab769e4e8e9fb8d6fec70dbd9704819988b70de6 (diff)
Did away with Mail::Internet. Using local sendmail binary only
Diffstat (limited to 'Echolot/Tools.pm')
-rw-r--r--Echolot/Tools.pm25
1 files changed, 13 insertions, 12 deletions
diff --git a/Echolot/Tools.pm b/Echolot/Tools.pm
index 448b198..17a5980 100644
--- a/Echolot/Tools.pm
+++ b/Echolot/Tools.pm
@@ -1,7 +1,7 @@
package Echolot::Tools;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Tools.pm,v 1.3 2002/06/18 17:20:34 weasel Exp $
+# $Id: Tools.pm,v 1.4 2002/07/10 21:46:28 weasel Exp $
#
=pod
@@ -19,7 +19,6 @@ use strict;
use warnings;
use Carp qw{cluck};
use Digest::MD5 qw{};
-use Mail::Internet;
sub hash($) {
my ($data) = @_;
@@ -117,17 +116,19 @@ sub send_message(%) {
};
$args{'Subject'} = 'none' unless (defined $args{'Subject'});
- my $head = new Mail::Header;
- $head->add ( 'To', $args{'To'} );
- $head->add ( 'From', $args{'From'} );
- $head->add ( 'Subject', $args{'Subject'} );
-
- my @lines = map { $_."\n" } split (/\r?\n/, $args{'Body'});
- my $mail = new Mail::Internet (
- Header => $head,
- Body => \@lines );
+ open(SENDMAIL, '|'.Echolot::Config::get()->{'sendmail'}.' -f '.$args{'From'}.' -t')
+ or cluck("Cannot run sendmail: $!"),
+ return 0;
+ printf SENDMAIL "From: %s\n", $args{'From'};
+ printf SENDMAIL "To: %s\n", $args{'To'};
+ printf SENDMAIL "Subject: %s\n", $args{'Subject'};
+ printf SENDMAIL "\n";
+ for my $line (@lines) {
+ print SENDMAIL $line;
+ };
+ close SENDMAIL;
- $mail->smtpsend( Host => Echolot::Config::get()->{'smarthost'} );
+ return 1;
};
1;