]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - scripts/makemail
2.6.22 network patches
[thirdparty/kernel/stable-queue.git] / scripts / makemail
CommitLineData
7d2ce6f7
GKH
1#!/usr/bin/perl -w
2
3#-----------------------------------------------------------------------------
4# All this does is generate RFC 822 headers and then copy standard input
5# to standard output. You determine what headers it generates with
6# command options.
7#
8# You can feed the output of this program to 'smtpsend' to send the mail
9# message somewhere via SMTP.
10#-----------------------------------------------------------------------------
11
12use strict;
13
14my $TRUE=1; my $FALSE = 0;
15
16use Getopt::Long;
17
18
19my %options;
20
21GetOptions(\%options,
22 "from=s",
23 "to=s",
24 "cc=s",
25 "subject=s",
26 "date=s",
27 "reply_to=s"
28 );
29
30if (defined($options{"subject"})) {
31 print("Subject: " . $options{"subject"} . "\n");
32}
33if (defined($options{"to"})) {
34 print("To: " . $options{"to"} . "\n");
35}
36if (defined($options{"cc"})) {
37 print("Cc: " . $options{"cc"} . "\n");
38}
39if (defined($options{"from"})) {
40 print("From: " . $options{"from"} . "\n");
41}
42if (defined($options{"date"})) {
43 print("Date: " . $options{"date"} . "\n");
44}
45if (defined($options{"reply_to"})) {
46 print("In-Reply-To: <" . $options{"reply_to"} . ">\n");
47}
48
49print("\n");
50
51while (<STDIN>) {
52 print;
53}