From 03f41cd0ba2b74656648235fba17d4ffefdd89a4 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 16 Jan 2006 10:25:53 +0000 Subject: [PATCH] Bugfixing --- SMS.pm | 1 + mail2sms.pl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/SMS.pm b/SMS.pm index 4737782..97dc138 100644 --- a/SMS.pm +++ b/SMS.pm @@ -267,6 +267,7 @@ sub parse_from_gammu { } + $body = '' unless defined $body; $body =~ s/\s+$//; $self->body( $body ); diff --git a/mail2sms.pl b/mail2sms.pl index 41c0ab7..d7aeba8 100755 --- a/mail2sms.pl +++ b/mail2sms.pl @@ -17,6 +17,7 @@ $| = 1; my $sendmail = "/usr/lib/sendmail"; my $rcpt = 'brehm@strato.de'; +my $from = 'SMS Daemon '; my $dir = "/var/spool/sms/outbox/"; #my $dir = "/tmp/"; my $filepat = $dir . "mail2sms_" . time() . "-" . $$ . '_%d.txt'; @@ -64,6 +65,7 @@ $text = substr( $text, 0, $maxlen ); $subject .= "'" . join( "', '", @Rcpts ) . "'"; open MAIL, "| $sendmail $rcpt" or die "Konnte $sendmail nicht starten.\n"; +print MAIL "From: " . $from . "\n"; print MAIL "To: " . $rcpt . "\n"; print MAIL "Subject: $subject\n\n"; -- 2.39.5