qwikdoc 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/.rspec +2 -0
- data/CHANGES +3 -0
- data/COPYING +340 -0
- data/Gemfile +3 -0
- data/README.md +10 -0
- data/Rakefile +10 -0
- data/TextFormattingRules +137 -0
- data/TextFormattingRules.ja +143 -0
- data/bin/qwikdoc +34 -0
- data/lib/qwik_doc.rb +15 -0
- data/lib/qwik_doc/hack.rb +184 -0
- data/qwikdoc.gemspec +26 -0
- data/spec/qwik_doc_spec.rb +305 -0
- data/spec/spec_helper.rb +12 -0
- data/vendor/qwik/Makefile +63 -0
- data/vendor/qwik/Rakefile +17 -0
- data/vendor/qwik/act-aa.rb +83 -0
- data/vendor/qwik/act-archive.rb +386 -0
- data/vendor/qwik/act-attach.rb +304 -0
- data/vendor/qwik/act-backup.rb +236 -0
- data/vendor/qwik/act-basic.rb +325 -0
- data/vendor/qwik/act-book.rb +161 -0
- data/vendor/qwik/act-calc.rb +371 -0
- data/vendor/qwik/act-charset.rb +251 -0
- data/vendor/qwik/act-christel.rb +112 -0
- data/vendor/qwik/act-chronology.rb +149 -0
- data/vendor/qwik/act-code.rb +155 -0
- data/vendor/qwik/act-comment.rb +554 -0
- data/vendor/qwik/act-config.rb +49 -0
- data/vendor/qwik/act-counter.rb +125 -0
- data/vendor/qwik/act-day.rb +96 -0
- data/vendor/qwik/act-describe.rb +135 -0
- data/vendor/qwik/act-diary.rb +109 -0
- data/vendor/qwik/act-edit.rb +317 -0
- data/vendor/qwik/act-embed-html.rb +296 -0
- data/vendor/qwik/act-emode.rb +150 -0
- data/vendor/qwik/act-event.rb +187 -0
- data/vendor/qwik/act-file.rb +303 -0
- data/vendor/qwik/act-files.rb +771 -0
- data/vendor/qwik/act-getpass.rb +295 -0
- data/vendor/qwik/act-history.rb +136 -0
- data/vendor/qwik/act-html.rb +204 -0
- data/vendor/qwik/act-httpauth.rb +147 -0
- data/vendor/qwik/act-include.rb +142 -0
- data/vendor/qwik/act-interwiki.rb +189 -0
- data/vendor/qwik/act-isearch.rb +109 -0
- data/vendor/qwik/act-keywords.rb +137 -0
- data/vendor/qwik/act-lang.rb +81 -0
- data/vendor/qwik/act-license.rb +63 -0
- data/vendor/qwik/act-list.rb +287 -0
- data/vendor/qwik/act-login.rb +410 -0
- data/vendor/qwik/act-logout.rb +60 -0
- data/vendor/qwik/act-mail.rb +159 -0
- data/vendor/qwik/act-map.rb +292 -0
- data/vendor/qwik/act-md5.rb +42 -0
- data/vendor/qwik/act-mdlb.rb +741 -0
- data/vendor/qwik/act-media.rb +416 -0
- data/vendor/qwik/act-member.rb +157 -0
- data/vendor/qwik/act-menu.rb +142 -0
- data/vendor/qwik/act-metadata.rb +323 -0
- data/vendor/qwik/act-mlsubmitform.rb +49 -0
- data/vendor/qwik/act-monitor.rb +167 -0
- data/vendor/qwik/act-new.rb +418 -0
- data/vendor/qwik/act-pagelist.rb +248 -0
- data/vendor/qwik/act-password.rb +145 -0
- data/vendor/qwik/act-plan.rb +210 -0
- data/vendor/qwik/act-povray.rb +230 -0
- data/vendor/qwik/act-presen.rb +380 -0
- data/vendor/qwik/act-redirect.rb +133 -0
- data/vendor/qwik/act-ring.rb +1071 -0
- data/vendor/qwik/act-rrefs.rb +255 -0
- data/vendor/qwik/act-ruby.rb +116 -0
- data/vendor/qwik/act-sample.rb +170 -0
- data/vendor/qwik/act-save.rb +295 -0
- data/vendor/qwik/act-schedule.rb +374 -0
- data/vendor/qwik/act-search.rb +180 -0
- data/vendor/qwik/act-searchwords.rb +51 -0
- data/vendor/qwik/act-sendpass.rb +83 -0
- data/vendor/qwik/act-site.rb +89 -0
- data/vendor/qwik/act-sitebackup.rb +419 -0
- data/vendor/qwik/act-sitelog.rb +118 -0
- data/vendor/qwik/act-smil.rb +299 -0
- data/vendor/qwik/act-status.rb +220 -0
- data/vendor/qwik/act-style.rb +608 -0
- data/vendor/qwik/act-table.rb +263 -0
- data/vendor/qwik/act-tableform.rb +241 -0
- data/vendor/qwik/act-tag.rb +103 -0
- data/vendor/qwik/act-text.rb +70 -0
- data/vendor/qwik/act-textarea.rb +164 -0
- data/vendor/qwik/act-theme.rb +346 -0
- data/vendor/qwik/act-toc.rb +112 -0
- data/vendor/qwik/act-typekey.rb +198 -0
- data/vendor/qwik/act-under-const.rb +94 -0
- data/vendor/qwik/act-webservice.rb +321 -0
- data/vendor/qwik/act-wema.rb +558 -0
- data/vendor/qwik/act-wysiwyg.rb +238 -0
- data/vendor/qwik/action.rb +325 -0
- data/vendor/qwik/autoreload.rb +98 -0
- data/vendor/qwik/bench-bench.rb +28 -0
- data/vendor/qwik/bench-emode.rb +47 -0
- data/vendor/qwik/bench-format-xml.rb +70 -0
- data/vendor/qwik/bench-large-table.rb +62 -0
- data/vendor/qwik/bench-md5.rb +14 -0
- data/vendor/qwik/bench-module-session.rb +19 -0
- data/vendor/qwik/bench-page.rb +50 -0
- data/vendor/qwik/bench-s-md5.rb +28 -0
- data/vendor/qwik/bench-session.rb +25 -0
- data/vendor/qwik/bench-textformat.rb +31 -0
- data/vendor/qwik/catalog-factory.rb +91 -0
- data/vendor/qwik/catalog-ja.rb +479 -0
- data/vendor/qwik/catalog-ml-ja.rb +145 -0
- data/vendor/qwik/check-act-monitor.rb +112 -0
- data/vendor/qwik/check-act-monitor2.rb +46 -0
- data/vendor/qwik/check-act-theme.rb +27 -0
- data/vendor/qwik/check-event.rb +112 -0
- data/vendor/qwik/check-event2.rb +55 -0
- data/vendor/qwik/check-htree-rexml.rb +77 -0
- data/vendor/qwik/check-htree.rb +51 -0
- data/vendor/qwik/check-libxml.rb +135 -0
- data/vendor/qwik/check-many-pages.rb +47 -0
- data/vendor/qwik/check-monitor.rb +33 -0
- data/vendor/qwik/check-observer.rb +67 -0
- data/vendor/qwik/check-server.rb +61 -0
- data/vendor/qwik/check-uuencode.rb +33 -0
- data/vendor/qwik/check-webdav.rb +65 -0
- data/vendor/qwik/check-xml-xpath.rb +27 -0
- data/vendor/qwik/common-backtrace.rb +94 -0
- data/vendor/qwik/common-basic.rb +111 -0
- data/vendor/qwik/common-condition.rb +142 -0
- data/vendor/qwik/common-error.rb +48 -0
- data/vendor/qwik/common-gettext.rb +50 -0
- data/vendor/qwik/common-javascript.rb +45 -0
- data/vendor/qwik/common-notice.rb +132 -0
- data/vendor/qwik/common-plain.rb +105 -0
- data/vendor/qwik/common-plugin.rb +111 -0
- data/vendor/qwik/common-res.rb +76 -0
- data/vendor/qwik/common-resolve.rb +92 -0
- data/vendor/qwik/common-send.rb +171 -0
- data/vendor/qwik/common-session.rb +139 -0
- data/vendor/qwik/common-surface.rb +261 -0
- data/vendor/qwik/common-url.rb +90 -0
- data/vendor/qwik/compat/Makefile +12 -0
- data/vendor/qwik/compat/add_load_path.rb +1 -0
- data/vendor/qwik/config.rb +299 -0
- data/vendor/qwik/db-b-backup.rb +142 -0
- data/vendor/qwik/db-backup.rb +184 -0
- data/vendor/qwik/db-berkeley.rb +306 -0
- data/vendor/qwik/db-filesystem.rb +305 -0
- data/vendor/qwik/db-indexer.rb +154 -0
- data/vendor/qwik/db-searchwords.rb +238 -0
- data/vendor/qwik/description-ja.rb +267 -0
- data/vendor/qwik/description.rb +256 -0
- data/vendor/qwik/dev-add-copyright.rb +23 -0
- data/vendor/qwik/dev-backup.rb +24 -0
- data/vendor/qwik/dev-bench.rb +175 -0
- data/vendor/qwik/dev-calctime.rb +52 -0
- data/vendor/qwik/dev-css-compressor.rb +60 -0
- data/vendor/qwik/dev-extract-catalog.rb +102 -0
- data/vendor/qwik/dev-js-compressor.rb +73 -0
- data/vendor/qwik/dev-release.rb +235 -0
- data/vendor/qwik/dev-replace.rb +353 -0
- data/vendor/qwik/dev-sendmail.rb +25 -0
- data/vendor/qwik/farm.rb +283 -0
- data/vendor/qwik/gettext.rb +56 -0
- data/vendor/qwik/group-cond.rb +157 -0
- data/vendor/qwik/group-config.rb +247 -0
- data/vendor/qwik/group-confirm.rb +147 -0
- data/vendor/qwik/group-db.rb +326 -0
- data/vendor/qwik/group-mail.rb +195 -0
- data/vendor/qwik/group-member.rb +307 -0
- data/vendor/qwik/group-sendmail.rb +231 -0
- data/vendor/qwik/group-site.rb +374 -0
- data/vendor/qwik/group-sweep.rb +63 -0
- data/vendor/qwik/group.rb +157 -0
- data/vendor/qwik/helper.rb +6 -0
- data/vendor/qwik/html-generator.rb +104 -0
- data/vendor/qwik/html-to-wabisabi.rb +149 -0
- data/vendor/qwik/htree-diff.rb +87 -0
- data/vendor/qwik/htree-format-xml.rb +57 -0
- data/vendor/qwik/htree-generator.rb +144 -0
- data/vendor/qwik/htree-get.rb +251 -0
- data/vendor/qwik/htree-html-generator.rb +179 -0
- data/vendor/qwik/htree-template.rb +263 -0
- data/vendor/qwik/htree-to-wabisabi.rb +171 -0
- data/vendor/qwik/loadlib.rb +79 -0
- data/vendor/qwik/logger.rb +115 -0
- data/vendor/qwik/mail-body.rb +171 -0
- data/vendor/qwik/mail-header.rb +474 -0
- data/vendor/qwik/mail-multipart.rb +193 -0
- data/vendor/qwik/mail-parse.rb +147 -0
- data/vendor/qwik/mail.rb +341 -0
- data/vendor/qwik/mailaddress.rb +83 -0
- data/vendor/qwik/mdlb-model.rb +81 -0
- data/vendor/qwik/mdlb-sample.rb +324 -0
- data/vendor/qwik/ml-catalog-factory.rb +27 -0
- data/vendor/qwik/ml-exception.rb +15 -0
- data/vendor/qwik/ml-generator.rb +28 -0
- data/vendor/qwik/ml-gettext.rb +137 -0
- data/vendor/qwik/ml-logger.rb +82 -0
- data/vendor/qwik/ml-memory.rb +65 -0
- data/vendor/qwik/ml-msg-validator.rb +86 -0
- data/vendor/qwik/ml-processor.rb +609 -0
- data/vendor/qwik/ml-quickml-server.rb +122 -0
- data/vendor/qwik/ml-sendmail.rb +0 -0
- data/vendor/qwik/ml-server.rb +107 -0
- data/vendor/qwik/ml-session.rb +348 -0
- data/vendor/qwik/ml-sweeper.rb +101 -0
- data/vendor/qwik/mock-logger.rb +65 -0
- data/vendor/qwik/mock-sendmail.rb +78 -0
- data/vendor/qwik/mock-socket.rb +82 -0
- data/vendor/qwik/modulobe.rb +406 -0
- data/vendor/qwik/mongrel-server.rb +72 -0
- data/vendor/qwik/page-files.rb +249 -0
- data/vendor/qwik/page-generate.rb +82 -0
- data/vendor/qwik/page-get.rb +262 -0
- data/vendor/qwik/page-images.rb +168 -0
- data/vendor/qwik/page-put.rb +128 -0
- data/vendor/qwik/page-rrefs.rb +154 -0
- data/vendor/qwik/page-title.rb +0 -0
- data/vendor/qwik/page-wikidb.rb +234 -0
- data/vendor/qwik/page.rb +67 -0
- data/vendor/qwik/pages.rb +444 -0
- data/vendor/qwik/parse-plugin.rb +249 -0
- data/vendor/qwik/parser-emode.rb +116 -0
- data/vendor/qwik/parser-inline.rb +273 -0
- data/vendor/qwik/parser.rb +350 -0
- data/vendor/qwik/password.rb +183 -0
- data/vendor/qwik/periodic.rb +79 -0
- data/vendor/qwik/qp.rb +56 -0
- data/vendor/qwik/qwik-service.rb +341 -0
- data/vendor/qwik/qwik.rb +5 -0
- data/vendor/qwik/qwikweb-adduser.rb +34 -0
- data/vendor/qwik/qwikweb-catalog-validator.rb +110 -0
- data/vendor/qwik/qwikweb-incgen.rb +28 -0
- data/vendor/qwik/qwikweb-makesite.rb +41 -0
- data/vendor/qwik/qwikweb-server.rb +44 -0
- data/vendor/qwik/qwikweb-showpassword.rb +26 -0
- data/vendor/qwik/qwikweb-watchlog.rb +67 -0
- data/vendor/qwik/request-path.rb +304 -0
- data/vendor/qwik/request-ua.rb +76 -0
- data/vendor/qwik/request-webrick.rb +81 -0
- data/vendor/qwik/request.rb +91 -0
- data/vendor/qwik/resolve-tdiary.rb +292 -0
- data/vendor/qwik/resolve.rb +121 -0
- data/vendor/qwik/response.rb +228 -0
- data/vendor/qwik/server-memory.rb +57 -0
- data/vendor/qwik/server-webrick.rb +102 -0
- data/vendor/qwik/server.rb +252 -0
- data/vendor/qwik/site-config.rb +149 -0
- data/vendor/qwik/site-db.rb +136 -0
- data/vendor/qwik/site-event.rb +162 -0
- data/vendor/qwik/site-files.rb +86 -0
- data/vendor/qwik/site-group.rb +103 -0
- data/vendor/qwik/site-index.rb +47 -0
- data/vendor/qwik/site-log.rb +64 -0
- data/vendor/qwik/site-member.rb +230 -0
- data/vendor/qwik/site-monitor.rb +97 -0
- data/vendor/qwik/site-pages.rb +62 -0
- data/vendor/qwik/site-plan.rb +139 -0
- data/vendor/qwik/site-report.rb +282 -0
- data/vendor/qwik/site-resolve.rb +230 -0
- data/vendor/qwik/site-rrefs.rb +18 -0
- data/vendor/qwik/site-search.rb +180 -0
- data/vendor/qwik/site-timeline.rb +153 -0
- data/vendor/qwik/site-url.rb +189 -0
- data/vendor/qwik/site.rb +76 -0
- data/vendor/qwik/smil-time.rb +105 -0
- data/vendor/qwik/smtp-session.rb +331 -0
- data/vendor/qwik/template-generator.rb +149 -0
- data/vendor/qwik/template.rb +85 -0
- data/vendor/qwik/test-common.rb +10 -0
- data/vendor/qwik/test-ml-info.rb +225 -0
- data/vendor/qwik/test-module-ml.rb +142 -0
- data/vendor/qwik/test-module-path.rb +110 -0
- data/vendor/qwik/test-module-public.rb +70 -0
- data/vendor/qwik/test-module-server.rb +98 -0
- data/vendor/qwik/test-module-session.rb +264 -0
- data/vendor/qwik/test-module-suite.rb +91 -0
- data/vendor/qwik/test-ms-applemail.rb +59 -0
- data/vendor/qwik/test-ms-attach.rb +174 -0
- data/vendor/qwik/test-ms-basic.rb +40 -0
- data/vendor/qwik/test-ms-close.rb +35 -0
- data/vendor/qwik/test-ms-confirm.rb +75 -0
- data/vendor/qwik/test-ms-ignore-spam.rb +57 -0
- data/vendor/qwik/test-ms-japanese.rb +97 -0
- data/vendor/qwik/test-ms-jfilename.rb +82 -0
- data/vendor/qwik/test-ms-large.rb +58 -0
- data/vendor/qwik/test-ms-member.rb +103 -0
- data/vendor/qwik/test-ms-multipart.rb +84 -0
- data/vendor/qwik/test-ms-org.rb +129 -0
- data/vendor/qwik/test-ms-plan.rb +130 -0
- data/vendor/qwik/test-ms-post.rb +53 -0
- data/vendor/qwik/test-ms-quopri.rb +76 -0
- data/vendor/qwik/test-sub-quopri.rb +45 -0
- data/vendor/qwik/test-submit-base64.rb +59 -0
- data/vendor/qwik/test-submit-forward.rb +61 -0
- data/vendor/qwik/test-submit-html-mail.rb +52 -0
- data/vendor/qwik/test-submit-japanese.rb +135 -0
- data/vendor/qwik/test-submit-jfilename.rb +144 -0
- data/vendor/qwik/test-submit-uuencode.rb +71 -0
- data/vendor/qwik/test-suite-all.rb +8 -0
- data/vendor/qwik/test-suite-basic.rb +9 -0
- data/vendor/qwik/test-suite-ml.rb +9 -0
- data/vendor/qwik/test-typekey.rb +64 -0
- data/vendor/qwik/testunit.rb +45 -0
- data/vendor/qwik/tokenizer-inline.rb +294 -0
- data/vendor/qwik/tokenizer.rb +332 -0
- data/vendor/qwik/typekey.rb +160 -0
- data/vendor/qwik/util-basic.rb +135 -0
- data/vendor/qwik/util-charset.rb +332 -0
- data/vendor/qwik/util-css.rb +56 -0
- data/vendor/qwik/util-csv-tokenizer.rb +113 -0
- data/vendor/qwik/util-filename.rb +112 -0
- data/vendor/qwik/util-pathname.rb +202 -0
- data/vendor/qwik/util-pid.rb +58 -0
- data/vendor/qwik/util-safe.rb +67 -0
- data/vendor/qwik/util-sendmail.rb +273 -0
- data/vendor/qwik/util-string.rb +203 -0
- data/vendor/qwik/util-time.rb +125 -0
- data/vendor/qwik/util-webrick.rb +176 -0
- data/vendor/qwik/version.rb +11 -0
- data/vendor/qwik/wabisabi-basic.rb +163 -0
- data/vendor/qwik/wabisabi-diff.rb +130 -0
- data/vendor/qwik/wabisabi-format-xml.rb +310 -0
- data/vendor/qwik/wabisabi-generator.rb +262 -0
- data/vendor/qwik/wabisabi-index.rb +174 -0
- data/vendor/qwik/wabisabi-table.rb +212 -0
- data/vendor/qwik/wabisabi-template.rb +295 -0
- data/vendor/qwik/wabisabi-to-htree.rb +111 -0
- data/vendor/qwik/wabisabi-to-wiki.rb +690 -0
- data/vendor/qwik/wabisabi-traverse.rb +207 -0
- data/vendor/qwik/wabisabi-validator.rb +116 -0
- data/vendor/qwik/wabisabi.rb +5 -0
- metadata +416 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/ml-session'
|
7
|
+
require 'qwik/test-module-ml'
|
8
|
+
|
9
|
+
if $0 == __FILE__
|
10
|
+
$test = true
|
11
|
+
end
|
12
|
+
|
13
|
+
class TestMSIgnoreSpam < Test::Unit::TestCase
|
14
|
+
include TestModuleML
|
15
|
+
|
16
|
+
def test_all
|
17
|
+
send_normal_mail('bob@example.net') # Bob creates a new ML.
|
18
|
+
|
19
|
+
# normail mail
|
20
|
+
sendmail('bob@example.net', 'test@q.example.com', 'test mail') {
|
21
|
+
"This is a test."
|
22
|
+
}
|
23
|
+
eq true, @site.exist?('1')
|
24
|
+
eq 'test mail', @site['1'].get_title
|
25
|
+
eq "* test mail\n{{mail(bob@example.net,0)\nThis is a test.\n}}\n",
|
26
|
+
@site['1'].load
|
27
|
+
|
28
|
+
# spammer's mail
|
29
|
+
res = sendmail('spammer@example.org', 'test@q.example.com', 'spam mail') {
|
30
|
+
"This is a spam mail."
|
31
|
+
}
|
32
|
+
|
33
|
+
eq ["spammer@example.org"], $quickml_sendmail[3]
|
34
|
+
eq "To: spammer@example.org
|
35
|
+
From: test@q.example.com
|
36
|
+
Subject: [QuickML] Error: spam mail
|
37
|
+
|
38
|
+
You are not a member of the mailing list:
|
39
|
+
<test@q.example.com>
|
40
|
+
|
41
|
+
Did you send a mail with a different address from the address registered in the mailing list?
|
42
|
+
Please check your 'From:' address.
|
43
|
+
|
44
|
+
--
|
45
|
+
Info: http://example.com/
|
46
|
+
|
47
|
+
----- Original Message -----
|
48
|
+
Subject: spam mail
|
49
|
+
To: test@q.example.com
|
50
|
+
From: spammer@example.org
|
51
|
+
Date:
|
52
|
+
|
53
|
+
The original body is omitted to avoid spam trouble.
|
54
|
+
", $quickml_sendmail[4]
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# -*- coding: shift_jis -*-
|
2
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
3
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
4
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
5
|
+
|
6
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
7
|
+
require 'qwik/ml-session'
|
8
|
+
require 'qwik/test-module-ml'
|
9
|
+
|
10
|
+
if $0 == __FILE__
|
11
|
+
require 'qwik/password'
|
12
|
+
$test = true
|
13
|
+
end
|
14
|
+
|
15
|
+
class TestMSJapanese < Test::Unit::TestCase
|
16
|
+
include TestModuleML
|
17
|
+
|
18
|
+
def test_submit_1
|
19
|
+
send_normal_mail('bob@example.net')
|
20
|
+
ok_log(["[test]: New ML by bob@example.net",
|
21
|
+
"[test]: Add: bob@example.net",
|
22
|
+
"[test]: QwikPost: test"], 0..2)
|
23
|
+
|
24
|
+
sm("�e�X�g") { '�e�B' }
|
25
|
+
ok_log("[test]: QwikPost: 1
|
26
|
+
[test:2]: Send:")
|
27
|
+
eq "�e�X�g", @site['1'].get_title
|
28
|
+
eq "* �e�X�g
|
29
|
+
{{mail(bob@example.net,0)
|
30
|
+
�e�B
|
31
|
+
}}
|
32
|
+
", @site['1'].load
|
33
|
+
|
34
|
+
sm("�e�X�g") { '������e�B' }
|
35
|
+
ok_log("[test]: QwikPost: 1
|
36
|
+
[test:3]: Send:")
|
37
|
+
eq "�e�X�g", @site['1'].get_title
|
38
|
+
# The new mail is added.
|
39
|
+
eq "* �e�X�g
|
40
|
+
{{mail(bob@example.net,0)
|
41
|
+
�e�B
|
42
|
+
}}
|
43
|
+
{{mail(bob@example.net,0)
|
44
|
+
������e�B
|
45
|
+
}}
|
46
|
+
", @site['1'].load
|
47
|
+
|
48
|
+
unsubscribe('bob@example.net') # close ML
|
49
|
+
ok_log("[test]: Remove: bob@example.net
|
50
|
+
[test]: ML Closed
|
51
|
+
[test]: Unsubscribe: bob@example.net")
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_submit_with_attach_image
|
55
|
+
send_normal_mail('bob@example.net')
|
56
|
+
ok_log(["[test]: New ML by bob@example.net",
|
57
|
+
"[test]: Add: bob@example.net",
|
58
|
+
"[test]: QwikPost: test"], 0..2)
|
59
|
+
|
60
|
+
sm("�e�X�g") {
|
61
|
+
"MIME-Version: 1.0
|
62
|
+
Content-Type: multipart/mixed; boundary=\"------_410DDC04C7AD046D3600_MULTIPART_MIXED_\"
|
63
|
+
Content-Transfer-Encoding: 7bit
|
64
|
+
|
65
|
+
--------_410DDC04C7AD046D3600_MULTIPART_MIXED_
|
66
|
+
Content-Type: text/plain; charset='ISO-2022-JP'
|
67
|
+
Content-Transfer-Encoding: 7bit
|
68
|
+
|
69
|
+
�e�B
|
70
|
+
--------_410DDC04C7AD046D3600_MULTIPART_MIXED_
|
71
|
+
Content-Type: image/png; name=\"1x1.png\"
|
72
|
+
Content-Disposition: attachment;
|
73
|
+
filename=\"1x1.png\"
|
74
|
+
Content-Transfer-Encoding: base64
|
75
|
+
|
76
|
+
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4//8/AAX+Av4zEpUU
|
77
|
+
AAAAAElFTkSuQmCC
|
78
|
+
|
79
|
+
--------_410DDC04C7AD046D3600_MULTIPART_MIXED_--
|
80
|
+
" }
|
81
|
+
page = @site['1']
|
82
|
+
eq "�e�X�g", page.get_title
|
83
|
+
eq true, @site.files('1').exist?('1x1.png')
|
84
|
+
end
|
85
|
+
|
86
|
+
def nu
|
87
|
+
eq "* �e�X�g
|
88
|
+
{{mail(bob@example.net,0)
|
89
|
+
|
90
|
+
�e�B
|
91
|
+
|
92
|
+
{{file(1x1.png)}}
|
93
|
+
|
94
|
+
}}
|
95
|
+
", page.load
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/ml-session'
|
7
|
+
require 'qwik/test-module-ml'
|
8
|
+
|
9
|
+
if $0 == __FILE__
|
10
|
+
$test = true
|
11
|
+
end
|
12
|
+
|
13
|
+
class TestMailSubmitWithJapaneseFilename < Test::Unit::TestCase
|
14
|
+
include TestModuleML
|
15
|
+
|
16
|
+
def test_all
|
17
|
+
send_normal_mail 'bob@example.net'
|
18
|
+
ok_log(['[test]: New ML by bob@example.net',
|
19
|
+
'[test]: Add: bob@example.net',
|
20
|
+
'[test]: QwikPost: test'], 0..2)
|
21
|
+
|
22
|
+
sm('�e�X�g') {
|
23
|
+
"Date: Fri, 20 May 2005 15:21:55 +0900
|
24
|
+
From: bob@example.net
|
25
|
+
To: test@q.example.com
|
26
|
+
Subject: Attach a file with japanese file name
|
27
|
+
MIME-Version: 1.0
|
28
|
+
Content-Type: multipart/mixed; boundary=\"------_428D7194605E049A05F8_MULTIPART_MIXED_\"
|
29
|
+
Content-Transfer-Encoding: 7bit
|
30
|
+
|
31
|
+
--------_428D7194605E049A05F8_MULTIPART_MIXED_
|
32
|
+
Content-Type: text/plain; charset='ISO-2022-JP'
|
33
|
+
Content-Transfer-Encoding: 7bit
|
34
|
+
|
35
|
+
test.
|
36
|
+
--------_428D7194605E049A05F8_MULTIPART_MIXED_
|
37
|
+
Content-Type: application/octet-stream;
|
38
|
+
name=\"=?ISO-2022-JP?B?MTdmeRskQk09OzslMyE8JUkkTjtYRGokSxsoQg==?=
|
39
|
+
=?ISO-2022-JP?B?GyRCJEQkJCRGGyhCLmRvYw==?=\"
|
40
|
+
Content-Disposition: attachment;
|
41
|
+
filename=\"=?ISO-2022-JP?B?MTdmeRskQk09OzslMyE8JUkkTjtYRGokSxsoQg==?=
|
42
|
+
=?ISO-2022-JP?B?GyRCJEQkJCRGGyhCLmRvYw==?=\"
|
43
|
+
Content-Transfer-Encoding: base64
|
44
|
+
|
45
|
+
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAMAAAAAAAAAAA
|
46
|
+
AAAAAA==
|
47
|
+
--------_428D7194605E049A05F8_MULTIPART_MIXED_
|
48
|
+
Content-Type: application/octet-stream;
|
49
|
+
name=\"=?ISO-2022-JP?B?GyRCPnBKc04uJUclNiUkJXMlMCVrITwlVxsoQg==?=
|
50
|
+
=?ISO-2022-JP?B?Lnhscw==?=\"
|
51
|
+
Content-Disposition: attachment;
|
52
|
+
filename=\"=?ISO-2022-JP?B?GyRCPnBKc04uJUclNiUkJXMlMCVrITwlVxsoQg==?=
|
53
|
+
=?ISO-2022-JP?B?Lnhscw==?=\"
|
54
|
+
Content-Transfer-Encoding: base64
|
55
|
+
|
56
|
+
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAHAAAAAAAAAAA
|
57
|
+
AAAAAAAAAAAAAAAAAAAAEwAAAAAQAAAAAAAA
|
58
|
+
--------_428D7194605E049A05F8_MULTIPART_MIXED_--
|
59
|
+
" }
|
60
|
+
page = @site['1']
|
61
|
+
eq '�e�X�g', page.get_title
|
62
|
+
eq '* �e�X�g
|
63
|
+
{{mail(bob@example.net,0)
|
64
|
+
test.
|
65
|
+
|
66
|
+
{{file(17fy�\�Z�R�[�h�̎w��ɂ���.doc)}}
|
67
|
+
|
68
|
+
|
69
|
+
{{file(��f�U�C���O���[�v.xls)}}
|
70
|
+
}}
|
71
|
+
',
|
72
|
+
page.get
|
73
|
+
|
74
|
+
files = @site.files '1'
|
75
|
+
# The files.list are encoded in UTF-8
|
76
|
+
eq ["17fy\344\272\210\347\256\227\343\202\263\343\203\274\343\203\211\343\201\256\346\214\207\345\256\232\343\201\253\343\201\244\343\201\204\343\201\246.doc", "\346\203\205\345\240\261\346\265\201\343\203\207\343\202\266\343\202\244\343\203\263\343\202\260\343\203\253\343\203\274\343\203\227.xls"], files.list
|
77
|
+
eq true, files.exist?('17fy�\�Z�R�[�h�̎w��ɂ���.doc')
|
78
|
+
eq true, files.exist?('17fy�\�Z�R�[�h�̎w��ɂ���.doc'.set_sourcecode_charset.to_filename_charset) # UTF-8 is allowed.
|
79
|
+
eq true, files.exist?('17fy�\�Z�R�[�h�̎w��ɂ���.doc'.set_sourcecode_charset.to_mail_charset) # Any charsets are allowed.
|
80
|
+
eq true, files.exist?('��f�U�C���O���[�v.xls')
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/ml-session'
|
7
|
+
require 'qwik/test-module-ml'
|
8
|
+
|
9
|
+
if $0 == __FILE__
|
10
|
+
$test = true
|
11
|
+
end
|
12
|
+
|
13
|
+
class TestMSLarge < Test::Unit::TestCase
|
14
|
+
include TestModuleML
|
15
|
+
|
16
|
+
def test_session_large_mail
|
17
|
+
$quickml_config.instance_eval {
|
18
|
+
@config[:max_mail_length] = 10 * 1024
|
19
|
+
}
|
20
|
+
|
21
|
+
logs = @ml_config.logger.get_log
|
22
|
+
|
23
|
+
# Alice create a new ML.
|
24
|
+
send_normal_mail 'alice@example.net'
|
25
|
+
ok_log '[test]: New ML by alice@example.net
|
26
|
+
[test]: Add: alice@example.net
|
27
|
+
[test]: QwikPost: test
|
28
|
+
[test:1]: Send:'
|
29
|
+
|
30
|
+
# send_large_mail
|
31
|
+
sendmail('alice@example.net', 'test@q.example.com', 'large') {
|
32
|
+
('o' * 62 + "\n") * 16 * 10
|
33
|
+
}
|
34
|
+
ok_log 'Too Large Mail: alice@example.net'
|
35
|
+
|
36
|
+
# send_longline_mail
|
37
|
+
sendmail('alice@example.net', 'test@q.example.com', 'longline') {
|
38
|
+
'o' * 2000 + "\n"
|
39
|
+
}
|
40
|
+
ok_log 'Too Long Line: alice@example.net'
|
41
|
+
|
42
|
+
send_normal_mail 'alice@example.net'
|
43
|
+
ok_log '[test]: QwikPost: test
|
44
|
+
[test:2]: Send:'
|
45
|
+
|
46
|
+
# send_japanese_large_mail
|
47
|
+
sendmail('alice@example.net', 'test@q.example.com',
|
48
|
+
'=?iso-2022-jp?B?GyRCJEckKyQkGyhC?=') {
|
49
|
+
"Content-Type: text/plain; charset=ISO-2022-JP\n\n" +
|
50
|
+
('o' * 62 + "\n") * 16 * 10
|
51
|
+
}
|
52
|
+
ok_log 'Too Large Mail: alice@example.net'
|
53
|
+
|
54
|
+
$quickml_config.instance_eval {
|
55
|
+
@config[:max_mail_length] = 100 * 1024
|
56
|
+
}
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/ml-session'
|
7
|
+
require 'qwik/test-module-ml'
|
8
|
+
|
9
|
+
if $0 == __FILE__
|
10
|
+
$test = true
|
11
|
+
end
|
12
|
+
|
13
|
+
class TestMSMember < Test::Unit::TestCase
|
14
|
+
include TestModuleML
|
15
|
+
|
16
|
+
def test_all
|
17
|
+
@ml_config.instance_eval {
|
18
|
+
@config[:max_members] = 2
|
19
|
+
}
|
20
|
+
|
21
|
+
# Alice create a new ML
|
22
|
+
send_normal_mail('alice@example.net')
|
23
|
+
ok_log(["[test]: New ML by alice@example.net",
|
24
|
+
"[test]: Add: alice@example.net",
|
25
|
+
"[test]: QwikPost: test"], 0..2)
|
26
|
+
|
27
|
+
# Mail from is case-insensitive.
|
28
|
+
send_normal_mail('ALICE@EXAMPLE.NET')
|
29
|
+
ok_log(["[test]: QwikPost: test", "[test:2]: Send:"])
|
30
|
+
|
31
|
+
# Bob send a mail, but is rejected.
|
32
|
+
send_normal_mail 'bob@example.net'
|
33
|
+
ok_log(["[test]: Reject: bob@example.net"])
|
34
|
+
|
35
|
+
# Add a member Charlie.
|
36
|
+
add_member 'charlie@example.net'
|
37
|
+
ok_log(["[test]: Add: charlie@example.net",
|
38
|
+
"[test]: QwikPost: addmember", "[test:3]: Send:"])
|
39
|
+
|
40
|
+
# Max exceeds. :max_members
|
41
|
+
add_member 'bob@example.net'
|
42
|
+
ok_log(["[test]: Too Many Members: bob@example.net",
|
43
|
+
"[test]: QwikPost: addmember",
|
44
|
+
"[test:4]: Send:"])
|
45
|
+
|
46
|
+
# Remove a member, alice.
|
47
|
+
remove_member 'ALICE@EXAMPLE.NET', 'charlie@example.net'
|
48
|
+
ok_log(["[test]: Remove: charlie@example.net",
|
49
|
+
"[test]: Unsubscribe: charlie@example.net"])
|
50
|
+
|
51
|
+
# Bob joined to the ml.
|
52
|
+
join_ml('bob@example.net')
|
53
|
+
ok_log(["[test]: Add: bob@example.net",
|
54
|
+
"[test]: QwikPost: join", "[test:5]: Send:"])
|
55
|
+
|
56
|
+
# Bob removed Alice.
|
57
|
+
remove_member 'bob@example.net', 'Alice@Example.Net'
|
58
|
+
ok_log(["[test]: Remove: Alice@example.net",
|
59
|
+
"[test]: Unsubscribe: Alice@example.net"])
|
60
|
+
|
61
|
+
# Alice returned to the ml.
|
62
|
+
send_normal_mail 'alice@example.net'
|
63
|
+
ok_log(["[test]: Add: alice@example.net",
|
64
|
+
"[test]: QwikPost: test", "[test:6]: Send:"])
|
65
|
+
|
66
|
+
# Alice removed Bob.
|
67
|
+
remove_member 'alice@example.net', 'bob@example.net'
|
68
|
+
ok_log(["[test]: Remove: bob@example.net",
|
69
|
+
"[test]: Unsubscribe: bob@example.net"])
|
70
|
+
|
71
|
+
# Try to add nonexistent mail address.
|
72
|
+
add_member 'nonexistent'
|
73
|
+
ok_log(["[test]: QwikPost: addmember", "[test:7]: Send:"])
|
74
|
+
|
75
|
+
send_normal_mail 'alice@example.net'
|
76
|
+
ok_log(["[test]: QwikPost: test", "[test:8]: Send:"])
|
77
|
+
|
78
|
+
send_normal_mail 'Alice@Example.Net'
|
79
|
+
ok_log(["[test]: QwikPost: test", "[test:9]: Send:"])
|
80
|
+
|
81
|
+
send_normal_mail 'ALICE@EXAMPLE.NET' # exceeds :auto_unsubscribe_count
|
82
|
+
ok_log(["[test]: QwikPost: test", "[test:10]: Send:"])
|
83
|
+
|
84
|
+
unsubscribe 'alice@example.net' # close ML
|
85
|
+
ok_log(["[test]: Remove: alice@example.net",
|
86
|
+
"[test]: ML Closed",
|
87
|
+
"[test]: Unsubscribe: alice@example.net"])
|
88
|
+
end
|
89
|
+
|
90
|
+
def add_member(cc)
|
91
|
+
sendmail('alice@example.net', 'test@q.example.com', 'addmember', cc) {
|
92
|
+
'add'
|
93
|
+
}
|
94
|
+
end
|
95
|
+
|
96
|
+
def remove_member(from, member)
|
97
|
+
sendmail(from, 'test@q.example.com', 'remove', member) { '' }
|
98
|
+
end
|
99
|
+
|
100
|
+
def join_ml(from)
|
101
|
+
sendmail(from, 'test@q.example.com', 'join', 'alice@example.net') { 'join' }
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# Copyright (C) 2003-2006 Kouichirou Eto, All rights reserved.
|
2
|
+
# This is free software with ABSOLUTELY NO WARRANTY.
|
3
|
+
# You can redistribute it and/or modify it under the terms of the GNU GPL 2.
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift '..' unless $LOAD_PATH.include? '..'
|
6
|
+
require 'qwik/ml-session'
|
7
|
+
require 'qwik/test-module-ml'
|
8
|
+
|
9
|
+
if $0 == __FILE__
|
10
|
+
$test = true
|
11
|
+
end
|
12
|
+
|
13
|
+
class TestMSMultipart < Test::Unit::TestCase
|
14
|
+
include TestModuleML
|
15
|
+
|
16
|
+
def test_all
|
17
|
+
# Alice create a new ML
|
18
|
+
send_normal_mail('alice@example.net')
|
19
|
+
ok_log ["[test]: New ML by alice@example.net",
|
20
|
+
"[test]: Add: alice@example.net",
|
21
|
+
"[test]: QwikPost: test"], 0..2
|
22
|
+
|
23
|
+
# Send a multipart mail.
|
24
|
+
sendmail('alice@example.net', 'test@q.example.com', 'multipart') {
|
25
|
+
"Mime-Version: 1.0
|
26
|
+
Content-Transfer-Encoding: 7bit
|
27
|
+
Content-Type: Multipart/Mixed;
|
28
|
+
boundary=\"--Next_Part(Wed_Oct_16_19:21:12_2002_747)--\"
|
29
|
+
|
30
|
+
----Next_Part(Wed_Oct_16_19:21:12_2002_747)--
|
31
|
+
Content-Type: Text/Plain; charset=us-ascii
|
32
|
+
Content-Transfer-Encoding: 7bit
|
33
|
+
|
34
|
+
test
|
35
|
+
----Next_Part(Wed_Oct_16_19:21:12_2002_747)--
|
36
|
+
Content-Type: Text/Plain; charset=us-ascii
|
37
|
+
Content-Transfer-Encoding: 7bit
|
38
|
+
Content-Disposition: attachment; filename=\"foobar.txt\"
|
39
|
+
|
40
|
+
foobar
|
41
|
+
|
42
|
+
----Next_Part(Wed_Oct_16_19:21:12_2002_747)----
|
43
|
+
" }
|
44
|
+
ok_log ["[test]: QwikPost: multipart", "[test:2]: Send:"]
|
45
|
+
|
46
|
+
# Send a Japanese mail.
|
47
|
+
sendmail('alice@example.net', 'test@q.example.com',
|
48
|
+
"=?iso-2022-jp?B?GyRCJEYkOSRIGyhC?=") {
|
49
|
+
'Content-Type: text/plain; charset=ISO-2022-JP
|
50
|
+
|
51
|
+
���{��ł���
|
52
|
+
' }
|
53
|
+
ok_log ["[test]: QwikPost: 1", "[test:3]: Send:"]
|
54
|
+
|
55
|
+
# Send a Japanese multipart mail.
|
56
|
+
sendmail('alice@example.net', 'test@q.example.com',
|
57
|
+
"=?iso-2022-jp?B?GyRCJF4kayRBJFEhPCRIGyhC?=") {
|
58
|
+
"Mime-Version: 1.0
|
59
|
+
Content-Transfer-Encoding: 7bit
|
60
|
+
Content-Type: Multipart/Mixed;
|
61
|
+
boundary=\"--Next_Part(Wed_Oct_16_19:21:12_2002_747)--\"
|
62
|
+
|
63
|
+
----Next_Part(Wed_Oct_16_19:21:12_2002_747)--
|
64
|
+
Content-Type: Text/Plain; charset=iso-2022-jp
|
65
|
+
Content-Transfer-Encoding: 7bit
|
66
|
+
|
67
|
+
����
|
68
|
+
----Next_Part(Wed_Oct_16_19:21:12_2002_747)--
|
69
|
+
Content-Type: Text/Plain; charset=us-ascii
|
70
|
+
Content-Transfer-Encoding: 7bit
|
71
|
+
Content-Disposition: attachment; filename=\"foobar.txt\"
|
72
|
+
|
73
|
+
foobar
|
74
|
+
|
75
|
+
----Next_Part(Wed_Oct_16_19:21:12_2002_747)----
|
76
|
+
" }
|
77
|
+
ok_log ["[test]: QwikPost: 2", "[test:4]: Send:"]
|
78
|
+
|
79
|
+
unsubscribe 'alice@example.net' # close ML
|
80
|
+
ok_log ["[test]: Remove: alice@example.net",
|
81
|
+
"[test]: ML Closed",
|
82
|
+
"[test]: Unsubscribe: alice@example.net"]
|
83
|
+
end
|
84
|
+
end
|