diff options
Diffstat (limited to 'mailman/config')
| -rw-r--r-- | mailman/config/__init__.py | 6 | ||||
| -rw-r--r-- | mailman/config/config.py | 9 | ||||
| -rw-r--r-- | mailman/config/mailman.cfg | 2 | ||||
| -rw-r--r-- | mailman/config/schema.cfg | 218 |
4 files changed, 234 insertions, 1 deletions
diff --git a/mailman/config/__init__.py b/mailman/config/__init__.py index 6ac060cb2..0611fc154 100644 --- a/mailman/config/__init__.py +++ b/mailman/config/__init__.py @@ -15,6 +15,12 @@ # You should have received a copy of the GNU General Public License along with # GNU Mailman. If not, see <http://www.gnu.org/licenses/>. +__metaclass__ = type +__all__ = [ + 'config', + ] + + from mailman.config.config import Configuration config = Configuration() diff --git a/mailman/config/config.py b/mailman/config/config.py index cbdea2aea..349202338 100644 --- a/mailman/config/config.py +++ b/mailman/config/config.py @@ -32,11 +32,11 @@ from StringIO import StringIO from lazr.config import ConfigSchema, as_boolean from pkg_resources import resource_string -from mailman import Defaults from mailman import version from mailman.core import errors from mailman.domain import Domain from mailman.languages import LanguageManager +from mailman.styles.manager import StyleManager SPACE = ' ' @@ -149,6 +149,7 @@ class Configuration(object): # Always enable the server default language, which must be defined. self.languages.enable_language(self._config.mailman.default_language) self.ensure_directories_exist() + self.style_manager = StyleManager() @property def logger_configs(self): @@ -189,6 +190,12 @@ class Configuration(object): yield getattr(sys.modules[module_name], class_name)() @property + def style_configs(self): + """Iterate over all the style configuration sections.""" + for section in self._config.getByCategory('style', []): + yield section + + @property def header_matches(self): """Iterate over all spam matching headers. diff --git a/mailman/config/mailman.cfg b/mailman/config/mailman.cfg index d88947975..2bf528bea 100644 --- a/mailman/config/mailman.cfg +++ b/mailman/config/mailman.cfg @@ -65,3 +65,5 @@ start: no [qrunner.virgin] class: mailman.queue.virgin.VirginRunner + +[style.default] diff --git a/mailman/config/schema.cfg b/mailman/config/schema.cfg index 47cf03eeb..654bbaabc 100644 --- a/mailman/config/schema.cfg +++ b/mailman/config/schema.cfg @@ -54,9 +54,37 @@ default_language: en # spoofed messages may get through. use_envelope_sender: no +# Membership tests for posting purposes are usually performed by looking at a +# set of headers, passing the test if any of their values match a member of +# the list. Headers are checked in the order given in this variable. The +# value From_ means to use the envelope sender. Field names are case +# insensitive. This is a space separate list of headers. +sender_headers: from from_ reply-to sender + # Mail command processor will ignore mail command lines after designated max. email_commands_max_lines: 10 +# Default length of time a pending request is live before it is evicted from +# the pending database. +pending_request_life: 3d + + +[passwords] +# When Mailman generates them, this is the default length of member passwords. +member_password_length: 8 + +# Specify the type of passwords to use, when Mailman generates the passwords +# itself, as would be the case for membership requests where the user did not +# fill in a password, or during list creation, when auto-generation of admin +# passwords was selected. +# +# Set this value to 'yes' for classic Mailman user-friendly(er) passwords. +# These generate semi-pronounceable passwords which are easier to remember. +# Set this value to 'no' to use more cryptographically secure, but harder to +# remember, passwords -- if your operating system and Python version support +# the necessary feature (specifically that /dev/urandom be available). +user_friendly_passwords: yes + [qrunner.master] # Define which process queue runners, and how many of them, to start. @@ -248,6 +276,118 @@ smtp_port: 25 lmtp_host: localhost lmtp_port: 8025 +# Ceiling on the number of recipients that can be specified in a single SMTP +# transaction. Set to 0 to submit the entire recipient list in one +# transaction. +max_recipients: 500 + +# Ceiling on the number of SMTP sessions to perform on a single socket +# connection. Some MTAs have limits. Set this to 0 to do as many as we like +# (i.e. your MTA has no limits). Set this to some number great than 0 and +# Mailman will close the SMTP connection and re-open it after this number of +# consecutive sessions. +max_sessions_per_connection: 0 + +# Maximum number of simultaneous subthreads that will be used for SMTP +# delivery. After the recipients list is chunked according to max_recipients, +# each chunk is handed off to the SMTP server by a separate such thread. If +# your Python interpreter was not built for threads, this feature is disabled. +# You can explicitly disable it in all cases by setting max_delivery_threads +# to 0. +max_delivery_threads: 0 + +# These variables control the format and frequency of VERP-like delivery for +# better bounce detection. VERP is Variable Envelope Return Path, defined +# here: +# +# http://cr.yp.to/proto/verp.txt +# +# This involves encoding the address of the recipient as we (Mailman) know it +# into the envelope sender address (i.e. the SMTP `MAIL FROM:' address). +# Thus, no matter what kind of forwarding the recipient has in place, should +# it eventually bounce, we will receive an unambiguous notice of the bouncing +# address. +# +# However, we're technically only "VERP-like" because we're doing the envelope +# sender encoding in Mailman, not in the MTA. We do require cooperation from +# the MTA, so you must be sure your MTA can be configured for extended address +# semantics. +# +# The first variable describes how to encode VERP envelopes. It must contain +# these three string interpolations: +# +# $bounces -- the list-bounces mailbox will be set here +# $mailbox -- the recipient's mailbox will be set here +# $host -- the recipient's host name will be set here +# +# This example uses the default below. +# +# FQDN list address is: mylist@dom.ain +# Recipient is: aperson@a.nother.dom +# +# The envelope sender will be mylist-bounces+aperson=a.nother.dom@dom.ain +# +# Note that your MTA /must/ be configured to deliver such an addressed message +# to mylist-bounces! +verp_delimiter: + +verp_format: ${bounces}+${mailbox}=${host} + +# For nicer confirmation emails, use a VERP-like format which encodes the +# confirmation cookie in the reply address. This lets us put a more user +# friendly Subject: on the message, but requires cooperation from the MTA. +# Format is like verp_format, but with the following substitutions: +# +# $address -- the list-confirm address +# $cookie -- the confirmation cookie +verp_confirm_format: $address+$cookie + +# This is analogous to verp_regexp, but for splitting apart the +# verp_confirm_format. MUAs have been observed that mung +# +# From: local_part@host +# +# into +# +# To: "local_part" <local_part@host> +# +# when replying, so we skip everything up to '<' if any. +verp_confirm_regexp: ^(.*<)?(?P<addr>[^+]+?)\+(?P<cookie>[^@]+)@.*$ + +# Set this to 'yes' to enable VERP-like (more user friendly) confirmations. +verp_confirmations: no + +# Another good opportunity is when regular delivery is personalized. Here +# again, we're already incurring the performance hit for addressing each +# individual recipient. Set this to 'yes' to enable VERPs on all personalized +# regular deliveries (personalized digests aren't supported yet). +verp_personalized_deliveries: no + +# And finally, we can VERP normal, non-personalized deliveries. However, +# because it can be a significant performance hit, we allow you to decide how +# often to VERP regular deliveries. This is the interval, in number of +# messages, to do a VERP recipient address. The same variable controls both +# regular and digest deliveries. Set to 0 to disable occasional VERPs, set to +# 1 to VERP every delivery, or to some number > 1 for only occasional VERPs. +verp_delivery_interval: 0 + +# This is the maximum number of automatic responses sent to an address because +# of -request messages or posting hold messages. This limit prevents response +# loops between Mailman and misconfigured remote email robots. Mailman +# already inhibits automatic replies to any message labeled with a header +# "Precendence: bulk|list|junk". This is a fallback safety valve so it should +# be set fairly high. Set to 0 for no limit (probably useful only for +# debugging). +max_autoresponses_per_day: 10 + +# Some list posts and mail to the -owner address may contain DomainKey or +# DomainKeys Identified Mail (DKIM) signature headers <http://www.dkim.org/>. +# Various list transformations to the message such as adding a list header or +# footer or scrubbing attachments or even reply-to munging can break these +# signatures. It is generally felt that these signatures have value, even if +# broken and even if the outgoing message is resigned. However, some sites +# may wish to remove these headers by setting this to 'yes'. +remove_dkim_headers: no + [archiver.master] # To add new archivers, define a new section based on this one, overriding the @@ -287,3 +427,81 @@ class: mailman.archiving.pipermail.Pipermail [archiver.prototype] # This is a prototypical sample archiver. class: mailman.archiving.prototype.Prototype + + +[style.master] +# The style's priority, with 0 being the lowest priority. +priority: 0 + +# The class implementing the IStyle interface, which applies the style. +class: mailman.styles.default.DefaultStyle + + +[scrubber] +# A filter module that converts from multipart messages to "flat" messages +# (i.e. containing a single payload). This is required for Pipermail, and you +# may want to set it to 0 for external archivers. You can also replace it +# with your own module as long as it contains a process() function that takes +# a MailList object and a Message object. It should raise +# Errors.DiscardMessage if it wants to throw the message away. Otherwise it +# should modify the Message object as necessary. +archive_scrubber: mailman.pipeline.scrubber + +# This variable defines what happens to text/html subparts. They can be +# stripped completely, escaped, or filtered through an external program. The +# legal values are: +# 0 - Strip out text/html parts completely, leaving a notice of the removal in +# the message. If the outer part is text/html, the entire message is +# discarded. +# 1 - Remove any embedded text/html parts, leaving them as HTML-escaped +# attachments which can be separately viewed. Outer text/html parts are +# simply HTML-escaped. +# 2 - Leave it inline, but HTML-escape it +# 3 - Remove text/html as attachments but don't HTML-escape them. Note: this +# is very dangerous because it essentially means anybody can send an HTML +# email to your site containing evil JavaScript or web bugs, or other +# nasty things, and folks viewing your archives will be susceptible. You +# should only consider this option if you do heavy moderation of your list +# postings. +# +# Note: given the current archiving code, it is not possible to leave +# text/html parts inline and un-escaped. I wouldn't think it'd be a good idea +# to do anyway. +# +# The value can also be a string, in which case it is the name of a command to +# filter the HTML page through. The resulting output is left in an attachment +# or as the entirety of the message when the outer part is text/html. The +# format of the string must include a $filename substitution variable which +# will contain the name of the temporary file that the program should operate +# on. It should write the processed message to stdout. Set this to +# HTML_TO_PLAIN_TEXT_COMMAND to specify an HTML to plain text conversion +# program. +archive_html_sanitizer: 1 + +# Control parameter whether the scrubber should use the message attachment's +# filename as is indicated by the filename parameter or use 'attachement-xxx' +# instead. The default is set 'no' because the applications on PC and Mac +# begin to use longer non-ascii filenames. +use_attachment_filename: no + +# Use of attachment filename extension per se is may be dangerous because +# viruses fakes it. You can set this 'yes' if you filter the attachment by +# filename extension. +use_attachment_filename_extension: no + + +[digests] +# Headers which should be kept in both RFC 1153 (plain) and MIME digests. RFC +# 1153 also specifies these headers in this exact order, so order matters. +# These are space separated and case insensitive. +mime_digest_keep_headers: + Date From To Cc Subject Message-ID Keywords + In-Reply-To References Content-Type MIME-Version + Content-Transfer-Encoding Precedence Reply-To + Message + +plain_digest_keep_headers: + Message Date From + Subject To Cc + Message-ID Keywords + Content-Type |
