summaryrefslogtreecommitdiff
path: root/Echolot
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
parentab769e4e8e9fb8d6fec70dbd9704819988b70de6 (diff)
Did away with Mail::Internet. Using local sendmail binary only
Diffstat (limited to 'Echolot')
-rw-r--r--Echolot/Config.pm4
-rw-r--r--Echolot/Tools.pm25
2 files changed, 15 insertions, 14 deletions
diff --git a/Echolot/Config.pm b/Echolot/Config.pm
index 4d2f07a..b651d81 100644
--- a/Echolot/Config.pm
+++ b/Echolot/Config.pm
@@ -1,7 +1,7 @@
package Echolot::Config;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Config.pm,v 1.21 2002/07/10 17:58:05 weasel Exp $
+# $Id: Config.pm,v 1.22 2002/07/10 21:46:28 weasel Exp $
#
=pod
@@ -62,7 +62,7 @@ sub init($) {
hash_len => 8,
addresses_default_ttl => 5, # getkeyconf seconds (days)
check_resurrection_ttl => 8, # check_resurrection seconds (weeks)
- smarthost => 'localhost',
+ sendmail => '/usr/sbin/sendmail',
mailindir => 'mail',
mailerrordir => 'mail-errors',
fetch_new => 1,
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;