]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - scripts/makemail
make it easier to specify the version number for added-to-stable script
[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",
b326741b
GKH
27 "reply_to=s",
28 "message_id=s"
7d2ce6f7
GKH
29 );
30
31if (defined($options{"subject"})) {
32 print("Subject: " . $options{"subject"} . "\n");
33}
34if (defined($options{"to"})) {
35 print("To: " . $options{"to"} . "\n");
36}
37if (defined($options{"cc"})) {
38 print("Cc: " . $options{"cc"} . "\n");
39}
40if (defined($options{"from"})) {
41 print("From: " . $options{"from"} . "\n");
42}
43if (defined($options{"date"})) {
44 print("Date: " . $options{"date"} . "\n");
45}
46if (defined($options{"reply_to"})) {
47 print("In-Reply-To: <" . $options{"reply_to"} . ">\n");
48}
b326741b
GKH
49if (defined($options{"message_id"})) {
50 print("Message-ID: <" . $options{"message_id"} . ">\n");
51}
7d2ce6f7
GKH
52
53print("\n");
54
55while (<STDIN>) {
56 print;
57}