]> git.pld-linux.org Git - packages/cvsspam.git/blame - cvsspam-module_email_header.diff
- issue xxx patch, rel 6
[packages/cvsspam.git] / cvsspam-module_email_header.diff
CommitLineData
aef0eb33
ER
1Index: cvsspam.rb
2===================================================================
3--- cvsspam.rb (revision 231)
4+++ cvsspam.rb (working copy)
5@@ -1301,6 +1301,7 @@
6 # 2MiB limit on attached diffs,
7 $mail_size_limit = 1024 * 1024 * 2
8 $arg_charset = nil
9+$cvsroot_email_header = false
10
11 require 'getoptlong'
12
13@@ -1735,6 +1736,8 @@
14 # sensible header formatting, and for ensuring that the body is seperated
15 # from the message headers by a blank line (as it is required to be).
16 class MailContext
17+ ENCODE_HEADERS = ["Subject", "X-CVSspam-Module-Path"]
18+
19 def initialize(io)
20 @done_headers = false
21 @io = io
22@@ -1744,8 +1747,8 @@
23 # called
24 def header(name, value)
25 raise "headers already commited" if @done_headers
26- if name == "Subject"
27- $encoder.encode_header(@io, "Subject", value)
28+ if ENCODE_HEADERS.include?(name)
29+ $encoder.encode_header(@io, name, value)
30 else
31 @io.puts("#{name}: #{value}")
32 end
33@@ -1883,6 +1886,14 @@
34 end
35 end
36 mail.header("X-Mailer", "CVSspam #{$version} <http://www.badgers-in-foil.co.uk/projects/cvsspam/>")
37+ if $cvsroot_email_header
38+ mod = '/'
39+ if Repository.count == 1
40+ rep = Repository.array.first
d691287c 41+ mod << "#{rep.common_prefix}"
aef0eb33
ER
42+ end
43+ mail.header("X-CVSspam-Module-Path", mod)
44+ end
45
46 mail.body do |body|
47 make_html_email(body)
This page took 0.191997 seconds and 4 git commands to generate.