[prev in list] [next in list] [prev in thread] [next in thread] 

List:       subversion-dev
Subject:    [PATCH] commit email includes valid date header
From:       William Pietri <william () scissor ! com>
Date:       2006-09-29 21:01:39
Message-ID: 451D89B3.2030905 () scissor ! com
[Download RAW message or body]

Hi. Here's my first patch for you folks; I hope I've done this correctly.

The current commit-email.pl script sends out a message without a "Date" 
header. That header is mandatory, but most mail servers will add one if 
it's missing. Qmail is not one of those mail servers, so our commit 
notices ended up being sorted into the wrong end of the inbox or nixed 
by spam filters.

Attached is a patch to fix that. This being Perl, there's more than one 
way to do this, so let me know if you'd like it done differently.

Thanks,

William



[[[

* tools/hook-scripts/commit-email.pl.in: Add RFC822-compliant
    date header to emails; header is mandatory per RFC2822.

]]]


["rfc-2822-date-header-patch.txt" (text/plain)]

Index: tools/hook-scripts/commit-email.pl.in
===================================================================
--- tools/hook-scripts/commit-email.pl.in       (revision 21717)
+++ tools/hook-scripts/commit-email.pl.in       (working copy)
@@ -100,7 +100,9 @@
 }
 
 require Net::SMTP if defined $smtp_server;
+use POSIX qw(strftime);
 
+
 ######################################################################
 # Initial setup/command-line handling.
 
@@ -540,6 +542,8 @@
     push(@head, "To: $to\n");
     push(@head, "From: $mail_from\n");
     push(@head, "Subject: $subject\n");
+    push(@head, "Date: " . 
+         strftime("%a, %d %b %Y %H:%M:%S %z", localtime) . "\n");
     push(@head, "Reply-to: $reply_to\n") if $reply_to;
 
     ### Below, we set the content-type etc, but see these comments



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic