]> pere.pagekite.me Git - homepage.git/blob - linux/wreq/no-sig-no-mime.diff
Switch all blog links to https.
[homepage.git] / linux / wreq / no-sig-no-mime.diff
1 Index: req-mail
2 ===================================================================
3 RCS file: /cvsroot/its/sw/wreq/req-mail,v
4 retrieving revision 1.4
5 retrieving revision 1.6
6 diff -u -w -u -r1.4 -r1.6
7 --- req-mail 1999/05/15 10:41:24 1.4
8 +++ req-mail 1999/05/15 11:12:45 1.6
9 @@ -51,6 +51,7 @@
10 @body=();
11 $body=''; # as description field in req
12 $date='';
13 +$mimetype=''; # If this a mime message, place the type here
14 $warn=''; # error message. if set, no auto reply will be sent to sender
15 # carry along the group name if given as the 1st arg to the alias:
16 $group=defined($ARGV[0])?$ARGV[0]:'';
17 @@ -69,7 +70,11 @@
18 }
19
20 $header=join "\n",@header;
21 -$body=join "\n",@body;
22 +
23 +if (grep(/^MIME-Version: /, @header)) {
24 + my ($typeline) = grep(/^Content-Type: /i, @header);
25 + ($mimetype) = $typeline =~ m/Content-Type:\s+([^;]+)/i;
26 +}
27
28 ###parse header for email:
29 foreach (@header){
30 @@ -79,6 +84,8 @@
31 ###########################################################
32 }elsif(/^Date:\s+(.*\S)/){ # Date: a b
33 $date=$1;
34 + }elsif(/^Subject:\s+(.*\S)/){ # Subject: line
35 + $subject=$1;
36 }
37 ###########################################################
38 }
39 @@ -139,6 +146,31 @@
40 if($uid =~ /^(root|diag|sys|adm|lp|nobody|MAILER-DAEMON|postmaster|\
41 daemon|bin|uucp|powerdown)/i){
42 #$warn.=" Not send auto-reply to uid $uid.";
43 +}
44 +
45 +# XXX Should parse/unpack MIME mail here. We only handle text/plain for now.
46 +if ($mimetype && 'text/plain' ne $mimetype) {
47 + # send error back to user
48 + &sendMail("$error_from", "", "$email", "",
49 + "Error in sending your request",
50 + "Your request with subject\n\n$subject\n\n" .
51 + "was NOT included in bug list!\n\n".
52 + "We only handle MIME type text/plain or non-MIME for the moment\n" .
53 + "Please resend your request like that, or use the web form.\n\n" .
54 + "Thank you\n");
55 + exit 0;
56 +}
57 +
58 +# Skip signature
59 +if ('' eq $mimetype || 'text/plain' eq $mimetype) {
60 + $bodylines = 0;
61 + foreach (@body) {
62 + last if (/^-- $/);
63 + $bodylines++;
64 + }
65 + $body=join "\n",@body[0..$bodylines-1];
66 +} else {
67 + $body=join "\n",@body;
68 }
69
70 ###send the request to the web server