2 ===================================================================
3 --- cvsspam.rb (revision 231)
4 +++ cvsspam.rb (working copy)
6 # 2MiB limit on attached diffs,
7 $mail_size_limit = 1024 * 1024 * 2
9 +$cvsroot_email_header = false
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).
17 + ENCODE_HEADERS = ["Subject", "X-CVSspam-Module-Path"]
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)
31 @io.puts("#{name}: #{value}")
33 @@ -1883,6 +1886,14 @@
36 mail.header("X-Mailer", "CVSspam #{$version} <http://www.badgers-in-foil.co.uk/projects/cvsspam/>")
37 + if $cvsroot_email_header
39 + if Repository.count == 1
40 + rep = Repository.array.first
41 + mod << "#{rep.common_prefix}"
43 + mail.header("X-CVSspam-Module-Path", mod)