]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - scripts/makemail
make it easier to specify the version number for added-to-stable script
[thirdparty/kernel/stable-queue.git] / scripts / makemail
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
12 use strict;
13
14 my $TRUE=1; my $FALSE = 0;
15
16 use Getopt::Long;
17
18
19 my %options;
20
21 GetOptions(\%options,
22 "from=s",
23 "to=s",
24 "cc=s",
25 "subject=s",
26 "date=s",
27 "reply_to=s",
28 "message_id=s"
29 );
30
31 if (defined($options{"subject"})) {
32 print("Subject: " . $options{"subject"} . "\n");
33 }
34 if (defined($options{"to"})) {
35 print("To: " . $options{"to"} . "\n");
36 }
37 if (defined($options{"cc"})) {
38 print("Cc: " . $options{"cc"} . "\n");
39 }
40 if (defined($options{"from"})) {
41 print("From: " . $options{"from"} . "\n");
42 }
43 if (defined($options{"date"})) {
44 print("Date: " . $options{"date"} . "\n");
45 }
46 if (defined($options{"reply_to"})) {
47 print("In-Reply-To: <" . $options{"reply_to"} . ">\n");
48 }
49 if (defined($options{"message_id"})) {
50 print("Message-ID: <" . $options{"message_id"} . ">\n");
51 }
52
53 print("\n");
54
55 while (<STDIN>) {
56 print;
57 }