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
11 $body=''; # as description field in req
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]:'';
20 $header=join "\n",@header;
21 -$body=join "\n",@body;
23 +if (grep(/^MIME-Version: /, @header)) {
24 + my ($typeline) = grep(/^Content-Type: /i, @header);
25 + ($mimetype) = $typeline =~ m/Content-Type:\s+([^;]+)/i;
28 ###parse header for email:
31 ###########################################################
32 }elsif(/^Date:\s+(.*\S)/){ # Date: a b
34 + }elsif(/^Subject:\s+(.*\S)/){ # Subject: line
37 ###########################################################
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.";
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" .
59 +if ('' eq $mimetype || 'text/plain' eq $mimetype) {
65 + $body=join "\n",@body[0..$bodylines-1];
67 + $body=join "\n",@body;
70 ###send the request to the web server