summaryrefslogtreecommitdiff
path: root/Mailman/Cgi/listinfo.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-207/+0
|
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* Major surgery to get the setuptools based installation passing all theBarry Warsaw2007-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | existing unit tests. Here's a summary of the changes. - Removed all dependent third party packages, since the setup.py file now claims all package dependencies such that they can be automatically installed from the cheeseshop. - Moved the misc directory into the Mailman package as Mailman/data. Moved templates and messages to Mailman subpackages. - Added an ILanguageManager interface, plus an implementation, so that we don't use Defaults.LC_DESCRIPTIONS directly anymore. Added a doctest for this interface and implementation. Defaults.LANGUAGES is moved into mailman.cfg. Defaults.LANGUAGE_DICT is moved to _DEFAULT_LANGUAGE_DATA, and LC_DESCRIPTIONS is removed. The calculation of the available and enabled languages is moved to the Configuration class, but this will probably still need work. Utils.GetLanguageDescr() and Utils.IsLanguage() are removed. I'd like to remove GetCharSet() eventually too, but there are too many uses of this currently, so I'm deferring it. - Utils.findtext(): Hacks added so that templates can be retrieved from the language catalog. The hack is that the template contents are used to find the translation, but in the one test case where this is actually flexed, the trailing newline in the file contents has to be trimmed. This is probably not right. - No more Defaults.py.in or mm_cfg.py! Defaults.py.in is moved to Defaults.py and is no longer created from a template file. The script called make_instance is added which creates an etc/mailman.cfg file from mailman.cfg.in (previously, mailman.cfg.sample) and /that/ file now has the small number of calculated values. In general, make_instance will not touch mailman.cfg if it exists, unless the --force option is given. CGIEXT is made the empty string by default (i.e. not generated). make_instance grows a --var-dir option. Fleshed out the --languages opton. - Defaults.py grows a DEFAULT_VAR_DIRECTORY variable, which is the default location of the 'var' directory. The Configuration class uses this as one of the directories it searches for its landmark, i.e. etc/mailman.cfg. RUNTIME_DIR is gone, as is VAR_PREFIX. - testall needs to write MAILMAN_USER, MAILMAN_UID, MAILMAN_GROUP, MAILMAN_GID, and LANGUAGES run time variables. - bin/withlist no longer needs to add config.BIN_DIR to sys.path, because in fact that variable doesn't exist any more. - Tweak the French catalog to make a test work. This is needed because of the conversion from %-strings to $-strings. - The setup.py now generates the .mo files before it does its thing. This will have to be fixed, but for now we must generate these files on setup build time instead of installation time. - Removed an unused interface.
* Other than contrib files, convert all imports of mm_cfg to imports of config.Barry Warsaw2007-07-141-8/+8
| | | | | | | | | | | Ignore mailman.egg-info In bin/make_instance.py: Catch and ignore import errors when importing Mailman.i18n. Before this script has actually been run, there won't be enough infrastructure in place of the import to succeed. Include several other fixes in this file. Add install_requires to the setup script.
* Merge exp-elixir-branch to trunk. There is enough working to make me feelbwarsaw2007-05-281-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | confident the Elixir branch is ready to become mainline. Also, fewer branches makes for an easier migration to a dvcs. Don't expect much of the old test suite to work, or even for much of the old functionality to work. The changes here are disruptive enough to break higher level parts of Mailman. But that's okay because I am slowly building up a new and improved test suite, which will lead to a functional system again. For now, only the doctests in Mailman/docs (and their related test harnesses) will pass, but they all do pass. Note that Mailman/docs serve as system documentation first and unit tests second. You should be able to read the doctest files to understand the underlying data model. Other changes included in this merge: - Added the Mailman.ext extension package. - zope.interfaces uses to describe major components - SQLAlchemy/Elixir used as the database model - Top level doinstall target renamed to justinstall - 3rd-party packages are now installed in pythonlib/lib/python to be more compliant with distutils standards. This allows us to use just --home instead of all the --install-* options. - No longer need to include the email package or pysqlite, as Python 2.5 is required (and comes with both packages). - munepy package is included, for Python enums - IRosterSets are added as a way to manage a collection of IRosters. Roster sets are named so that we can maintain the indirection between mailing lists and rosters, where the two are maintained in different storages. - IMailingListRosters: remove_*_roster() -> delete_*_roster() - Remove IMember interface. - Utils.list_names() -> config.list_manager.names - fqdn_listname() takes an optional hostname argument. - Added a bunch of new exceptions used throughout the new interfaces. - Make LockFile a context manager for use with the 'with' statement.
* Rework MailList.available_languages so that we don't need to use a PickleTypebwarsaw2007-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | column in the database for this list of strings. We use SQLAlchemy's many-to-many relationship, however because of this, you cannot simply append new unicodes to .available_languages. You need to wrap the language code in a Language instance and append that instance to the list. In order to handle this, I added a property MailList.language_codes which returns a list of the code strings (not Language instances). Also new are MailList.set_languages() for setting (i.e. overriding) the set of available languages for the list; and add_language() which takes a single language code, wraps it, and appends it. The code does not and should not use .available_languages directory any more. MailList.GetAvailableLanguages() is removed. The 'available_languages' column is removed from the Listdata table. Add a getValue() to Mailman.Gui.Language in order to unwrap the language codes stored in the database's association table. Modify _setValue() to do the wrapping. In dbcontext.py, don't import * from the sqlalchemy package. It contains a 'logging' name which is not the standard Python logging package. I also added essentially a bag of attributes class called Tables which will hold references to all the SA tables that are created. Update the make_table() API to take an instance of Tables. Added a close() method to DBContext. This is needed for the updated unit test suite. Changed bin/import.py so that when available_languages is being set, it calls MailList.set_languages() instead of trying to set that attribute directly. Updated some language idioms while I was at it. More eradication of mm_cfg in favor of the config object and the Defaults module. In testall.py, call initialize() instead of loginit.initialize(). Promote MAX_RESTARTS into a Defaults.py.in variable. This is because the unit tests will knock that value down to something not so annoying should one of the qrunner-required tests traceback. Several other important changes to the unit test suite (which now completely succeeds again!): - Set the uid and gid of the temporary mailman.cfg and tmp*.db files to the Mailman user and group as specified in the config object. - Make sure that all of the tests point to a SQLite database file that was created with the tempfile module. This way we don't pollute our main database with data that is getting created during the unit tests. - In the TestBase.setUp() method, be sure to close the existing dbcontext, clear out the mappers, and then reconnect the dbcontext with the new SQLALCHEMY_ENGINE_URL pointing to the tempfile. However, we don't need to reload the MailList instance any more. - Make all tests work, except for the tests that require crypt. That upgrade path will not be available in this version of Mailman.
* As Mark discovered, we need to load the configuration in the driver script forbwarsaw2006-09-241-1/+1
| | | | | | | | the web u/i to work. This also fixes the use of Utils.list_names() in the list and admin overviews. This API now returns a set, but the CGIs want to sort them, so we need to turn them back into lists. This change also elaborates an exception so that the list name is reported.
* First crack at real virtual domain support, i.e. mailing lists with the samebwarsaw2006-07-081-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | name in more than one domain. - Totally eradicate MAILMAN_SITE_LIST, and in fact the entire need for a site list. The functions that the site list previously performed are either removed or supported in other ways. For example, instead of forwarding owner bounces to the site list, we now have a SITE_OWNER_ADDRESS which should point to a human, and such bounces are sent there instead. There's also a "no reply" email address that should be set up to go to devnull. For any message that never expects a reply, the sender is set to this address. - Remove the Site.py module. It was an experimental approach to trying to support virtual domains, and we're going to do it so much better now that this module is no longer necessary. Site._makedirs() -> Utils.makedir(). - VIRTUAL_HOST_OVERVIEW is completely removed, since now virtual hosts are always enabled. Virtual domains should be added to mailman.cfg by using the new add_domain() function. add_virtualhost() is gone. If no virtual domains are added explicitly, we add the default one that configure guessed (but we never add that if domains are added explicitly). - Utils.get_domain() -> Utils.get_request_domain() - withlist code cleanup and make sure that we load etc/mailman.cfg - A new base exception called MailmanException is added, from which all exceptions defined in Errors.py ultimately derive. MailmanError is retained and derives from MailmanException. - BadDomainSpecificationError is added. - Remove the -V/--virtual-host-overview option from list_lists and add instead -d/--domain and -f/--full. - bin/update probably works but needs more testing. - bin/newlist and bin/rmlist take fqdn list names, but default to the default domain if @whatever isn't given. newlist's -u/--urlhost and -e/--emailhost options are removed. The domain that the list is being added to must already exist. - Minor code cleanup in Message.py - Bump version to 2.2.0a1 - The Configuration object grows a .domain dictionary which maps email hosts to url hosts. The reverse mapping is supported, but not directly; use Configuration.get_email_host() instead. - Mailman/Cgi/create is converted from mm_cfg to config, and some minor code cleanup is performed. Also, convert to __i18n_templates__ = True. - New MailList APIs: + property .fqdn_listname + GetNoReplyEmail() + Create() API changes and refactoring.
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | traces of our crufty old Syslog. Most of this work was purely mechanical, except for: 1) Initializing the loggers. For this, there's a new module Mailman/loginit.py (yes all modules from now on will use PEP 8 names). We can't call this 'logging.py' because that will interfere with importing the stdlib module of the same name (can you say Python 2.5 and absolute imports?). If you want to write log messages both to the log file and to stderr, pass True to loginit.initialize(). This will turn on propagation of log messages to the parent 'mailman' logger, which is set up to print to stderr. This is how bin/qrunner works when not running as a subprocess of mailmanctl. 2) The driver script. I had to untwist the StampedLogger stuff and implement differently printing exceptions and such to log/error because standard logging objects don't have a write() method. So we write to a cStringIO and then pass that to the logger. 3) SMTPDirect.py because of the configurability of the log messages. This required changing SafeDict into a dict subclass (which is better than using UserDicts anyway -- yay Python 2.3!). It's probably still possible to flummox things up if you change the name of the loggers in the SMTP_LOG_* variables in mm_cfg.py. However, the worst you can do is cause output to go to stderr and not go to a log file. Note too that all entry points into the Mailman system must call Mailman.loginit.initialize() or the log output will go to stderr (which may occasionally be what you want). Currently all CGIs and qrunners should be working properly. I wish I could have tested all code paths that touch the logger, but that's infeasible. I have tested this, but it's possible that there were some mistakes in the translation. - Mailman.Bouncers.BounceAPI.Stop is a singleton, but not a class instance any more. - True/False code cleanup, PEP 8 import restructuring, whitespace normalization, and copyright year updates, as appropriate.
* back porting from 2.1.6tkikuchi2005-08-281-5/+6
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* listinfo_overview(): Martin Pool's patch #688410 to improve thebwarsaw2003-05-151-1/+1
| | | | | | | | phrasing on the listinfo page. Requires translation updates. Backport candidate.
* main(): Sanity check the language cgi variable.bwarsaw2003-01-271-6/+8
|
* list_listinfo(): Fix a u/i buglet for when no choice is given betweenbwarsaw2002-11-161-0/+4
| | | | | | | | digest and non-digest delivery. listinfo.html now has <mm-digest-question-start> and <mm-digest-question-end> tags which get comment start/enders if the question is meaningless. Requires template changes to all langauge's listinfo.html files.
* listinfo_overview(): Actually, use wording similar to admin.pybwarsaw2002-08-291-2/+2
|
* listinfo_overview(): Fixed typo reported by Greg Ward.bwarsaw2002-08-291-1/+1
|
* QuoteHyperChars() -> websafe()bwarsaw2002-05-221-1/+1
| | | | | Also, use Utils.websafe() consistently throughout, instead of the inconsistent calls to cgi.escape().
* Feedback from Guido...bwarsaw2002-03-231-2/+8
| | | | | | | | | | | | | | | | | | | | listinfo.py list_listinfo(): If the list only has one language enabled, omit the language choice box. It's a waste of screen real-estate. HTMLFormatter GetStandardReplacements(): ditto options.py loginpage(): ditto. Also omit the paragraph that talks about session cookies. It's probably over the heads of most users. main(): Don't print the "No address given" if we're traveling here from the listinfo page and they left the address field blank, as per the instructions.
* Update copyright years.bwarsaw2002-03-161-1/+1
|
* list_listinfo(): Code reorg.bwarsaw2001-11-301-1/+3
|
* Forward port security patch from Mailman 2.0.8:bwarsaw2001-11-301-1/+3
| | | | | | | | | | Fixes to prevent cross-site scripting exploits. See http://www.cert.org/advisories/CA-2000-02.html Reported by zeno@cgisecurity.com Fix is to cgi.escape() any strings regurgitated from the url back to the browser in the html response.
* listinfo_overview(), admin_overview(): Simplify the test for virtualbwarsaw2001-11-021-3/+1
| | | | | host matching. We simply need to find the lowercased hostname in the web_page_url to find a match.
* listinfo_overview(): Instead of using MAILMAN_OWNER, usebwarsaw2001-08-041-2/+2
| | | | Utils.get_site_email(). The former config variable is going away.
* list_listinfo(): Add a replacement for <mm-options-form-start>. Seebwarsaw2001-08-021-0/+1
| | | | listinfo.html for parallel change.
* main(): Simpler idiom for getting the 'language' value out of thebwarsaw2001-07-201-8/+3
| | | | | | form, and defaulting to mlist.preferred_language. list_listinfo(): Add a replacement for the (new) fullname box.
* Better syslog() calling conventions. Also, don't mark syslog messagesbwarsaw2001-06-271-1/+1
| | | | as translatable.
* listinfo_overview(): Applied David Champion's SF patch 401452 tobwarsaw2001-06-071-4/+9
| | | | alternatively highlight the list rows.
* Globally, WEB_HEADERCOLOR => WEB_HEADER_COLORbwarsaw2001-06-071-1/+1
|
* listinfo_overview(): We don't need to pass the document backgroundbwarsaw2001-05-311-3/+3
| | | | | color as an argument anymore. Other colors are no longer hardcoded, but taken from mm_cfg.
* listinfo_overview(): Application of SF patch #420396, submitted bybwarsaw2001-05-161-4/+3
| | | | | Tokio Kikuchi. Japanese translations have difficulty when the sentences are split.
* listinfo_overview(): The hostname/domain grokking code was moved intobwarsaw2001-05-091-16/+4
| | | | Utils.get_domain().
* list_listinfo(): "See this page in" -> "View this page in".bwarsaw2001-03-241-1/+1
|
* Untabification.bwarsaw2001-02-281-11/+11
|
* Big i18n changes.bwarsaw2001-02-281-37/+44
| | | | | | | | | | | | | | | | | | At global scope, set the language to the server's default, at least until we know which list the request is being made on. main(): Once we know which list this request is for, switch the language over to its preferred_language. FormatListinfoOverview() -> listinfo_overview() listinfo_overview(): Significant cleanups and code re-org. Don't lock the list until absolutely necessary. Use the new preferred route for setting the language (don't use os.environ['LANG'], instead use i18n.set_language()). Set the language on the document (so the resulting html has the proper charset). FormatListListinfo() -> list_listinfo()
* FormatListinfoOverview(): Substitution of host_name local variable forbwarsaw2001-02-161-9/+8
| | | | | | hostname (for consistency with _() translations) - thanks Ron Jarrell. De-string-module-ify while I was at it.
* jcrey's latest round of I18N changes.bwarsaw2000-12-261-6/+23
|
* First round integration of Juan Carlos's translatable string markings.bwarsaw2000-12-071-36/+33
|
* Fixes for a minor local security hole. Some of the CGI scripts couldbwarsaw2000-09-291-8/+2
| | | | | | | | | | | bomb with tracebacks if PATH_INFO environment variable wasn't defined. Fixed this by making them all use Utils.GetPathPieces() and "doing something sensible" when that returned a false value. Also, edithtml is now hidden behind a login screen, so there's no need to enter the list password to edit the html. You can't even get to the list of files to edit unless you've admin authenticated. Closes SF bug #114091, Jitterbug PR# 24.
* Cleanups to fix relative/absolute script url calculation in responsebwarsaw2000-08-011-5/+3
| | | | | | | | to SF Bug #110753. Specifically, FormatListinfoOverview(): Use Utils.ScriptURL() instead of GetNestingLevel(), and GetScriptURL() instead of GetRelativeScriptURL().
* Applying the patches from SF Bug #109217 that are not specific tobwarsaw2000-07-241-10/+9
| | | | | | | | chuqui's site. Specifically, FormatListinfoOverview(): Capitalize "Mailing Lists"; put "Welcome!" in +2 font; slight rewrite of the advertised greeting; put the "List" and "Description" table headers in +2 font.
* main(): syslog doesn't need a trailing newlinebwarsaw2000-06-231-1/+1
|
* main(): call to syslog() had the wrong number of arguments.bwarsaw2000-06-141-1/+1
|
* Convert all uses of sys.stderr.write() and mlist.LogMsg() to the newbwarsaw2000-06-021-2/+2
| | | | syslog() interface.
* Some meager consistency in handling errors when trying to open thebwarsaw2000-04-041-3/+5
| | | | | | | | | | | | | | mailing list. In all cases, catch the base exception class MMListError, and output HTML indicating the specified list doesn't exist. A more detail message gets printed to logs/error (the str() of the actual exception details). Also: admin.py - Don't catch MMBadConfigError around mlist.parse_matching_header_opt() since this method doesn't ever raise that exception. Actually, that exception isn't raised anywhere in Mailman, so it's been removed.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-211-3/+1
|
* FormatListinfoOverview(): "mailman" => "Mailman"bwarsaw2000-03-151-1/+1
|
* Some general cleanup of imports, globals (zapped 'em), and a few otherbwarsaw1999-11-111-50/+54
| | | | programming constructs. Could still use a lot more work.
* FormatListinfoOverview(): The CGI/1.1 spec defines the SERVER_NAMEhmeland1999-05-221-1/+2
| | | | | envvar, but not HTTP_HOST. Thus, if HTTP_HOST is unset, try getting SERVER_NAME.
* FormatListinfoOverview(): Factor out logo creation by usingbwarsaw1999-05-021-4/+1
| | | | MailmanLogo() function.
* FormatListinfoOverview(): Include the mailman logo in the overviewbwarsaw1999-05-021-1/+5
| | | | page.