diff -ur w3ml-0.4-20020625/list.rb w3ml-0.4-20020625.new/list.rb --- w3ml-0.4-20020625/list.rb 2002-04-15 13:16:41.000000000 +0900 +++ w3ml-0.4-20020625.new/list.rb 2004-07-05 22:27:15.000000000 +0900 @@ -69,9 +69,11 @@ puts < - + + #{ml}:#{s}-#{e} diff -ur w3ml-0.4-20020625/list_ml.rb w3ml-0.4-20020625.new/list_ml.rb --- w3ml-0.4-20020625/list_ml.rb 2002-04-15 13:16:41.000000000 +0900 +++ w3ml-0.4-20020625.new/list_ml.rb 2004-07-05 22:27:15.000000000 +0900 @@ -5,9 +5,11 @@ puts < - + + W3ml diff -ur w3ml-0.4-20020625/msg.rb w3ml-0.4-20020625.new/msg.rb --- w3ml-0.4-20020625/msg.rb 2002-06-11 21:34:03.000000000 +0900 +++ w3ml-0.4-20020625.new/msg.rb 2004-07-05 22:27:15.000000000 +0900 @@ -41,21 +41,23 @@ header = escapeHTML(m.header).gsub(/\n/, "
\n"). sub(/\A(.*\<)(.*)(\>)/){"#{$1}#{$2}#{$3}"} - body = m.body.sub(/\n+\z/, "\n") + header = nospam(escapeHTML(m.header).gsub(/\n/, "
\n")) prev_html = m.prev ? "#{$PrevHTML}" : $PrevHTML next_html = m.next ? "#{$NextHTML}" : $NextHTML s = (n-1)/$Step*$Step+1 e = s + $Step - 1 buttons = "#{prev_html}#{next_html}#{$ListHTML}#{$ThreadHTML}" - buttons << "#{$RawHTML}" if $StoreRaw + buttons << "#{$RawHTML}" if $GetRaw puts < - + + #{ml}:#{n} @@ -71,7 +73,7 @@
-#{add_tag to_html_body(m.body), ml}
+#{add_tag to_html_body(nospam(m.body)), ml}
 
EOS @@ -112,3 +114,14 @@ EOS end + +def nospam(txt) + return txt unless $NoSpam + address_regex = + /(("?)[-0-9a-zA-Z_.+?\/]+\2@[-0-9a-zA-Z]+\.[-0-9a-zA-Z.]+)/ # from quickml + return txt.gsub(address_regex){|add| obfuscate_address($1)} +end + +def obfuscate_address (address) # from quickml + address.sub(/(@.).*/, '\1...') +end diff -ur w3ml-0.4-20020625/search.rb w3ml-0.4-20020625.new/search.rb --- w3ml-0.4-20020625/search.rb 2002-04-15 13:16:41.000000000 +0900 +++ w3ml-0.4-20020625.new/search.rb 2004-07-05 22:27:15.000000000 +0900 @@ -24,13 +24,13 @@ limit = 50 offset = 0 - sdate = cgi['sdate'][0] if cgi.has_key? 'sdate' - edate = cgi['edate'][0] if cgi.has_key? 'edate' - subj = cgi['subject'][0] if cgi.has_key? 'subject' - from = cgi['from'][0] if cgi.has_key? 'from' - body = cgi['body'][0] if cgi.has_key? 'body' - limit = cgi['limit'][0].to_i if cgi.has_key? 'limit' - offset = cgi['offset'][0].to_i if cgi.has_key? 'offset' + sdate = cgi.params['sdate'][0] if cgi.has_key? 'sdate' + edate = cgi.params['edate'][0] if cgi.has_key? 'edate' + subj = cgi.params['subject'][0] if cgi.has_key? 'subject' + from = cgi.params['from'][0] if cgi.has_key? 'from' + body = cgi.params['body'][0] if cgi.has_key? 'body' + limit = cgi.params['limit'][0].to_i if cgi.has_key? 'limit' + offset = cgi.params['offset'][0].to_i if cgi.has_key? 'offset' if cgi.params.length > 0 then n = h.count(parse_date(sdate, 0), parse_date(edate, 24*60*60-1), parse_string(subj), parse_string(from), parse_string(body)) @@ -63,9 +63,11 @@ puts < - + + #{$mlname} diff -ur w3ml-0.4-20020625/top.rb w3ml-0.4-20020625.new/top.rb --- w3ml-0.4-20020625/top.rb 2002-04-15 11:36:21.000000000 +0900 +++ w3ml-0.4-20020625.new/top.rb 2004-07-05 22:27:15.000000000 +0900 @@ -10,9 +10,11 @@ puts < - + + #{ml}:ML diff -ur w3ml-0.4-20020625/umail.rb w3ml-0.4-20020625.new/umail.rb --- w3ml-0.4-20020625/umail.rb 2002-05-06 02:34:57.000000000 +0900 +++ w3ml-0.4-20020625.new/umail.rb 2004-07-05 22:32:44.000000000 +0900 @@ -136,7 +136,7 @@ Zone['JST'] = 9 Specials = "()<>@,;:\\\".[]".split(//) - TokenDelimiterRe = /[][()<>@,;:\\.]|\s+|\"(?:[^\\\"]|\\.)*\"/ + TokenDelimiterRe = /[\[\]()<>@,;:\\.]|\s+|\"(?:[^\\\"]|\\.)*\"/ def parse() @tokens = split_array_token(@raw_body) @@ -193,7 +193,7 @@ cnt = 1 com = [m] while cnt > 0 - if s == '' then raise ParseError::new s0 end + if s == '' then raise ParseError::new(s0) end if s =~ /\A\s+|\A([^()\\\s]|\\.)*/o then com << $& s = $' #' @@ -316,7 +316,7 @@ phrase = a[0 .. i-1] if i > 0 addr = a[i+1 .. -1] addr.delete ' ' - if addr[-1] != '>' then raise ParseError::new "invalid '<'" end + if addr[-1] != '>' then raise ParseError::new("invalid '<'") end addr[-1,1] = nil else phrase = nil @@ -328,7 +328,7 @@ if strictly? then phrase.each do |p| if Specials.include? p then - raise ParseError::new "invalid phrase (#{p})" + raise ParseError::new("invalid phrase (#{p})") end end end @@ -337,7 +337,7 @@ addr.delete ' ' if strictly? then if not addr.include? '@' then - raise ParseError::new "'@' not in address" + raise ParseError::new("'@' not in address") end end @addrs << MailAddr::new(addr.join, phrase) @@ -417,7 +417,7 @@ end class CTypeH < StructH - TokenDelimiterRe = /[][()<>@,;:\\\/=.]|\s+|\"(?:[^\\\"]|\\.)*\"/ + TokenDelimiterRe = /[\[\]()<>@,;:\\\/=.]|\s+|\"(?:[^\\\"]|\\.)*\"/ def split_token(s) super(s, TokenDelimiterRe) end @@ -467,7 +467,7 @@ end class CDispositionH < StructH - TokenDelimiterRe = /[][()<>@,;:\\\/=.]|\s+|\"(?:[^\\\"]|\\.)*\"/ + TokenDelimiterRe = /[\[\]()<>@,;:\\\/=.]|\s+|\"(?:[^\\\"]|\\.)*\"/ def split_token(s) super(s, TokenDelimiterRe) end @@ -638,7 +638,7 @@ @epilogue = "" else b = @header['content-type'].params['boundary'] - if b == nil then raise ParseError::new "no boundary in content-type" end + if b == nil then raise ParseError::new("no boundary in content-type") end bre = Regexp::new '^'+Regexp::quote("--#{b}")+'[ \t]*\n' cre = Regexp::new '^'+Regexp::quote("--#{b}--")+'[ \t]*(\n|\Z)' a = @body_s.split(bre) @@ -646,7 +646,7 @@ a[-1] = $` epi = $' else - raise ParseError::new 'no close-delimiter' + raise ParseError::new('no close-delimiter') end pre = a.shift @body = @preamble = pre diff -ur w3ml-0.4-20020625/w3ml.conf.en w3ml-0.4-20020625.new/w3ml.conf.en --- w3ml-0.4-20020625/w3ml.conf.en 2002-05-06 01:46:57.000000000 +0900 +++ w3ml-0.4-20020625.new/w3ml.conf.en 2004-07-05 22:06:04.000000000 +0900 @@ -1,5 +1,7 @@ $Step = 100 $StoreRaw = true +$GetRaw = false +$NoSpam = true $Database = 'gdbm' diff -ur w3ml-0.4-20020625/w3ml.conf.in w3ml-0.4-20020625.new/w3ml.conf.in --- w3ml-0.4-20020625/w3ml.conf.in 2002-06-12 00:33:47.000000000 +0900 +++ w3ml-0.4-20020625.new/w3ml.conf.in 2004-07-05 22:04:58.000000000 +0900 @@ -1,5 +1,7 @@ $Step = 100 $StoreRaw = true +$GetRaw = false +$NoSpam = true $Require = /Subject:\s*\[#{$mlname}\W\d+\]/i $Database = 'gdbm' diff -ur w3ml-0.4-20020625/w3ml.in w3ml-0.4-20020625.new/w3ml.in --- w3ml-0.4-20020625/w3ml.in 2002-06-25 23:37:51.000000000 +0900 +++ w3ml-0.4-20020625.new/w3ml.in 2004-07-05 21:59:30.000000000 +0900 @@ -12,7 +12,7 @@ require LIB_DIR+'w3ml' require_slash end -path_info.squeeze! '/' +path_info.dup.squeeze! '/' ml, cmd, arg = path_info.split('/', 4)[1..-1] if ml == nil or ml == '' then require LIB_DIR+'w3ml' @@ -55,8 +55,12 @@ attach ml, a, b end when 'raw' - require LIB_DIR+'raw' - raw ml, arg + if $GetRaw + require LIB_DIR+'raw' + raw ml, arg + else + not_found + end else not_found end