perl-MIME-Tools/MIME-tools-5.420-mimesend_add_from.patch

42 lines
1.3 KiB
Diff

diff -Nru MIME-tools-5.420.orig/examples/mimesend MIME-tools-5.420/examples/mimesend
--- MIME-tools-5.420.orig/examples/mimesend 2004-09-07 17:09:55.000000000 +0200
+++ MIME-tools-5.420/examples/mimesend 2007-03-01 17:47:04.000000000 +0100
@@ -50,8 +50,9 @@
# Usage:
@ARGV or die <<EOF;
Usage:
- mimesend [-t to] [-s subj] (-f file [-m type])+
+ mimesend [F from] [-t to] [-s subj] (-f file [-m type])+
-n Don't actually send it; just print it to stdout.
+ -F from The "from" address.
-t to The "to" address.
-s subj The subject of the message.
-f file Path to attached file.
@@ -77,6 +78,10 @@
$nosend = 1;
next ARG;
};
+ /^-F(.*)/ and do {
+ $from = $1 || shift @ARGV;
+ next ARG;
+ };
/^-t(.*)/ and do {
$to = $1 || shift @ARGV;
next ARG;
@@ -115,6 +120,7 @@
Type => ($type || type_for($path)),
Path => $path,
Encoding => '-SUGGEST';
+ $from and $top->head->add('From', $from);
$top->head->add('To', $to);
$top->head->add('Subject', $subj);
}
@@ -122,6 +128,7 @@
# Start with top:
$top = build MIME::Entity Type=>"multipart/mixed";
+ $from and $top->head->add('From', $from);
$top->head->add('To', $to);
$top->head->add('Subject', $subj);