]> git.pld-linux.org Git - projects/distfiles.git/blobdiff - file-fetcher.pl
Fix email headers formatting
[projects/distfiles.git] / file-fetcher.pl
index 22462478be73aa03379efc659384e8ef61d5ac83..3b08f279414ce0ec712385e1ea1572310031f0e3 100755 (executable)
@@ -77,7 +77,7 @@ sub read_spool_file()
       $problems .= $_;
       next;
     }
-    if (/^([a-f0-9]{32})\s+((ftp|http|https|no-url|no-url-copy):\/\/([a-z0-9A-Z;:\=\?&\@\+\~\.,\-\/_]|\%[0-9])+(#\/[a-zA-Z0-9\._-]+)?)\s*$/) {
+    if (/^([a-f0-9]{32})\s+((ftp|http|https|no-url|no-url-copy):\/\/([a-z0-9A-Z;:\=\?&\@\+\~\.,\-\/\#_]|\%[0-9])+(#\/[a-zA-Z0-9\._-]+)?)\s*$/) {
       if (/\/$/) {
         $problems .= "$file: cannot fetch dir";
       } else {
@@ -358,9 +358,6 @@ sub fetch_files()
 
 sub send_email()
 {
-  syslog("info","sending email to $requester");
-  open(EMAIL, "| /usr/sbin/sendmail -t");
-  #open(EMAIL, "| cat");
   my $marker = "";
   if ($problems ne "") {
     $marker = "ERRORS: ";
@@ -371,16 +368,13 @@ sub send_email()
   splice(@files, 10, @files - 10, "...")
     if (@files > 10);
 
-  print EMAIL
+  my $message_id = 
+  my $email_head =
 "From: $req_login <$requester>
-To: $commits_list
-Cc: $requester
 Subject: DISTFILES: ${spec}: ${marker}@{files}
-Message-ID: <$$." . time . "\@distfiles.pld-linux.org>
-X-distfiles-program: file-fetcher.pl
-X-distfiles-version: " . '$Id$' . "
-
-$problems
+X-distfiles-program: file-fetcher.pl";
+  my $email_body =
+"$problems
 Files fetched: $fetched_count
 
 $normal_out
@@ -388,6 +382,33 @@ $normal_out
 -- 
 Virtually Yours: distfiles.
 ";
+
+  syslog("info","sending email to $requester");
+  open(EMAIL, "| /usr/sbin/sendmail -t");
+  #open(EMAIL, "| cat");
+
+  print EMAIL
+"To: $requester
+$email_head
+Message-ID: <$$." . time . "\@distfiles.pld-linux.org>
+
+$email_body";
+
+  close(EMAIL) or fatal("close() failed");
+
+  syslog("info","sending email to $commits_list");
+  open(EMAIL, "| /usr/sbin/sendmail -t");
+  #open(EMAIL, "| cat");
+
+  print EMAIL
+"To: $commits_list
+$email_head
+Message-ID: <$$." . time . "\@distfiles.pld-linux.org>
+
+Request by: $requester
+
+$email_body";
+
   close(EMAIL) or fatal("close() failed");
 }
 
This page took 0.109401 seconds and 4 git commands to generate.