diff options
| author | Barry Warsaw | 2009-01-25 13:01:41 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-01-25 13:01:41 -0500 |
| commit | eefd06f1b88b8ecbb23a9013cd223b72ca85c20d (patch) | |
| tree | 72c947fe16fce0e07e996ee74020b26585d7e846 /mailman/rules/docs/max-size.txt | |
| parent | 07871212f74498abd56bef3919bf3e029eb8b930 (diff) | |
| download | mailman-eefd06f1b88b8ecbb23a9013cd223b72ca85c20d.tar.gz mailman-eefd06f1b88b8ecbb23a9013cd223b72ca85c20d.tar.zst mailman-eefd06f1b88b8ecbb23a9013cd223b72ca85c20d.zip | |
Diffstat (limited to 'mailman/rules/docs/max-size.txt')
| -rw-r--r-- | mailman/rules/docs/max-size.txt | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/mailman/rules/docs/max-size.txt b/mailman/rules/docs/max-size.txt deleted file mode 100644 index 117691e59..000000000 --- a/mailman/rules/docs/max-size.txt +++ /dev/null @@ -1,39 +0,0 @@ -Message size -============ - -The 'message-size' rule matches when the posted message is bigger than a -specified maximum. Generally this is used to prevent huge attachments from -getting posted to the list. This value is calculated in terms of KB (1024 -bytes). - - >>> mlist = config.db.list_manager.create(u'_xtest@example.com') - >>> rule = config.rules['max-size'] - >>> print rule.name - max-size - -For example, setting the maximum message size to 1 means that any message -bigger than that will match the rule. - - >>> mlist.max_message_size = 1 # 1024 bytes - >>> one_line = u'x' * 79 - >>> big_body = u'\n'.join([one_line] * 15) - >>> msg = message_from_string("""\ - ... From: aperson@example.com - ... To: _xtest@example.com - ... - ... """ + big_body) - >>> rule.check(mlist, msg, {}) - True - -Setting the maximum message size to zero means no size check is performed. - - >>> mlist.max_message_size = 0 - >>> rule.check(mlist, msg, {}) - False - -Of course, if the maximum size is larger than the message's size, then it's -still okay. - - >>> mlist.max_message_size = msg.original_size/1024.0 + 1 - >>> rule.check(mlist, msg, {}) - False |
