summaryrefslogtreecommitdiff
path: root/Mailman/Cgi/confirm.py
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-834/+0
|
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* ListAdmin mostly gone, but not quite.Barry Warsaw2007-09-091-2/+6
| | | | | | | | | | | | | | | | Mailman/app/moderator.py: Most of the application level interface provided by ListAdmin is moved here now, including the ability to hold messages, subscriptions, and unsubscriptions, and to handle message (defer, discard, reject, accept). More work needed. Some untested conversion of API in Mailman/Cgi/admindb.py, confirm.py, bin/checkdbs.py. messagestore.py: Don't use or require the Date: header in the global message ID calculation. As described on the mailing list, we're only going to use the Message-ID header. IListRequests: added count_of() and of_type() methods.
* More work on completing the transition to setuptools.Barry Warsaw2007-07-181-1/+1
| | | | | | | | | | | | | | | | | * Mailman/testing -> Mailman/test * Removed Mailman/testing/base.py * Fix mailmanctl by using a different way of calculating where the qrunner script is. The configuration file no longer knows what BIN_DIR is, but the mailmanctl script knows where it lives via sys.argv[0]. Also, PREFIX_DIR -> VAR_DIR. Also, * Since the overwhelmingly predominant use of ILanguageManager is to get the description, and since .get_language_data(code)[0] is not very readable, split the interface into .get_description() and .get_charset(). * In the setup, automatically add all Mailman.bin modules as command line scripts.
* Major surgery to get the setuptools based installation passing all theBarry Warsaw2007-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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.
* Postfix LMTP related brushups.tkikuchi2006-11-261-12/+12
| | | | | | | | | | | | | | - Configurable no-list error. - Ultimate loop stop address in transport -> aliases. - LMTP_ONLY_DOMAIN needs no individual transport entry. - Use of alias/lmtp is exclusive. WSGI brushups. - _cookie_path() was made simple and retain common cookie for admin/admindb/... etc. - Removed absolute=1 from admindb/confirm/create/options. configuration.py - Use of add_runner() in etc/mailman.cfg needs change. config is not loaded yet?
* Another milestone: you can now post to lists. Converted the following to usebwarsaw2006-09-251-16/+16
| | | | | | | | the new configuration object: admin, admindb, bounces, confirm, inject, join, leave, owner, post, request, unshunt, version. Also change MailList.GetScriptURL() to return the list's fully qualified name in links.
* - Convert all logging to Python's standard logging module. Get rid of allbwarsaw2006-04-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Now that Python 2.3 is the minimum requirement for Mailman 2.2:bwarsaw2006-04-151-10/+5
| | | | | | | | | | | - Remove True/False binding cruft - Remove __future__ statements for nested scopes - Remove ascii_letters import hack from Utils.py - Remove mimetypes.guess_all_extensions import hack from Scrubber.py - In Pending.py, set _missing to object() (better than using []) Also, update copyright years where appropriate, and re-order imports more to my PEP 8 tastes. Whitespace normalize.
* Port cleaning changes forward from 2.1-maint branch.bwarsaw2005-12-301-2/+3
|
* Improving banned subscription logic to cover all invites, subscribes, ↵msapiro2005-12-031-1/+12
| | | | address changes and confirmations of same.
* back porting from 2.1.6tkikuchi2005-08-281-21/+45
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* subscription_confirm(): Catch HostileSubscriptionError and display anbwarsaw2003-03-161-0/+5
| | | | | | error message. Closes SF bug # 703941 by Stuart Bishop, who also suggested the basic fix.
* subscription_confirm(): Sanity check the language cgi variable.bwarsaw2003-01-271-7/+9
|
* subscription_prompt(): Move the setting of the title to after thebwarsaw2002-12-311-4/+9
| | | | | | | | | | | | | | point where the i18n and doc languages are set. Also, get the languages using GetLanguageDescr() so that the language pull down list is also in the correct language. Fixes SF #658213 reported and patches by Daniel Buchmann. subscription_cancel(): Set the language to the user's preferred so that the cancel message is given in the right language. subscription_confirm(): Set the i18n and doc languages to the language from the form so it also shows up in the correct language.
* heldmsg_prompt(): Translate the reason for the hold.bwarsaw2002-12-121-1/+1
|
* subscription_confirm(), unsubscription_confirm(),bwarsaw2002-12-021-4/+4
| | | | | addrchange_confirm(), reenable_confirm(): MMNoSuchUserError -> NotAMemberError
* main(): Watch out for unsubscription confirmations on addresses thatbwarsaw2002-11-151-7/+14
| | | | | have already been unsub'd, e.g. by the list administrator. Log an error message and throw the cookie away.
* subscription_confirm(): Patch by Tokio Kikuchi, we need to pass thebwarsaw2002-10-051-1/+1
| | | | language into the canonstr() call to properly display the fullname.
* subscription_prompt(), subscription_confirm(): Two more places wherebwarsaw2002-09-191-3/+5
| | | | | | we have to convert strings to or from unicode. Given by Tokio Kikuchi, modified slightly by Barry (if it's still broken, it's my mistake).
* unsubscription_prompt(), addrchange_prompt(), reenable_prompt(): Whenbwarsaw2002-09-171-1/+12
| | | | | | showing the unsub'ing (or changing, or re-enabling) member's name, use the version converted to the charset of the web page (or with &#XYZ; conversion).
* subscription_prompt(): The moderator only approves requests whenbwarsaw2002-09-131-1/+3
| | | | | subscribe_policy is 2 or 3. Fixes bug #605933 reported by Ron Jarrell.
* heldmsg_prompt(): Must unpack the data before trying to use the senderbwarsaw2002-08-231-2/+3
| | | | information. Closes SF bug #599112 by Peer Heinlein.
* subscription_prompt(): Some u/i changes suggested by PieterB in SF bugbwarsaw2002-08-221-8/+11
| | | | #597407.
* heldmsg_prompt(): Watch out for situations when the list administratorbwarsaw2002-08-161-7/+16
| | | | | has already disposed of a message that the user is now trying to confirm/cancel. Closes SF bug #594703 reported by Garey Mills.
* subscription_prompt(): Don't provide the choice of digests orbwarsaw2002-08-091-3/+6
| | | | | non-digests unless the subscriber actually has a choice! Closes SF bug # 563091 (not the u/i part).
* subscription_prompt(): Slightly better alignment of buttons inbwarsaw2002-07-261-2/+1
| | | | response to SF bug #574240.
* QuoteHyperChars() -> websafe()bwarsaw2002-05-221-5/+5
| | | | | Also, use Utils.websafe() consistently throughout, instead of the inconsistent calls to cgi.escape().
* main(): When calling addrchange_prompt(), catch NotAMemberErrors thatbwarsaw2002-04-111-1/+9
| | | | | may occur if the address requesting a change has been removed before the change was confirmed. This closes SF bug #445961.
* main(), subscription_prompt(), subscription_confirm(): Thebwarsaw2002-03-141-6/+12
| | | | | Pending.SUBSCRIPTION key now uses UserDesc instances instead of tuples.
* subscription_confirm(): Dan Mick noticed that we didn't completelybwarsaw2002-03-121-17/+1
| | | | stamp out passwords. Get rid of all vestiges.
* subscription_prompt(), subscription_confirm(): Remove the passwordbwarsaw2002-03-041-12/+19
| | | | | from the subscription confirmation form. The potential for mischief seems high.
* Added support for the RE_ENABLE confirmation (i.e. thru-the-webbwarsaw2001-12-271-1/+115
| | | | | | | | re-enabling of a disabled membership). Specifically, reenable_cancel(), reenable_confirm(), reenable_prompt(): New functions to prompt for, cancel (i.e. defer) and confirm thru-the-web re-enabling of a disabled membership.
* Forward port security patch from Mailman 2.0.8:bwarsaw2001-11-301-2/+6
| | | | | | | | | | 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.
* subscription_prompt(), unsubscription_prompt(), heldmsg_prompt(): Thebwarsaw2001-11-061-3/+38
| | | | | | | | | | results strings should be displayed in the language that the subscribee has requested. Also, tailor the response message based on whether the moderators have to approve a confirmed request or not. Reported by Daniel Buchmann. subscription_confirm(): Need a `listname' local variable for _() string interpolation.
* subscription_confirm(): We have to convert the 'digests' value to anbwarsaw2001-08-161-3/+8
| | | | integer since that's what MemberAdaptor eventually wants.
* subscription_confirm(): Remove unnecessary argument.bwarsaw2001-08-021-1/+1
|
* main(): Add support for allowing a user who posted a held message tobwarsaw2001-07-301-0/+114
| | | | | | | | | explicitly cancel the message via the web confirmation mechanism. heldmsg_cancel(), heldmsg_confirm(), heldmsg_prompt(): New functions, slightly misnamed (but retained for consistency). I.e. "canceling" means "continue awaiting approval" and "confirming" means "cancel the posting".
* Massive rewrite to implement the Wouters/Oskoboiny Convention on webbwarsaw2001-07-291-52/+387
| | | | | | | | | | | | confirmations. :) Clicking on the emailed confirm url now brings up a screen which requires the user to /then/ click on an explicit Confirm button. They can also cancel their requested action. So far, implemented subscription, unsubscription, and change of address requests. Eventually this will include posting holds, etc. Subscription confirmation screen allows them to override some values they entered in the original request (but not, of course, the email address!).
* main(): In the exception handlers when ProcessConfirmation() isbwarsaw2001-07-201-0/+10
| | | | | | | called, be sure to catch MMNeedApproval, which can be raised if subscriptions are confirm+approve. (Yeah, I know this is eventually going to get rewritten...)
* main(): Catch MMNoSuchUserError which can happen if two unsub requestsbwarsaw2001-07-111-0/+4
| | | | | | were sent and the user confirmed (by web click) them both. The first will delete the member but the second will raise this exception, so do something more sensible than letting it trickle to the top.
* Better syslog() calling conventions. Also, don't mark syslog messagesbwarsaw2001-06-271-1/+1
| | | | as translatable.
* main(): We don't need to pass the document background color as anbwarsaw2001-05-311-6/+11
| | | | | | argument to Format() anymore. success(): Handle the the new CHANGE_OF_ADDRESS confirmable action.
* success(): By adding default arguments, we can do the unpacking ofbwarsaw2001-05-091-3/+1
| | | | data `automatically' instead of in this function.
* Fixes to handle User-Hits-Stop-Button problems, specifically,bwarsaw2001-05-021-1/+8
| | | | | | | | | | | | | | | | | | | | | | | main(): Set up a signal handler to catch SIGTERM, and unlock the mailing list when this happens. This has the side effect of aborting any changes to the MailList object that this web hit may have made. This is necessary due to semantics of Apache's mod_cgi: when the browser closes the socket, eventually Apache receives a SIGPIPE (on output to the closed socket). This causes Apache to SIGTERM the cgi process, wait three seconds, then SIGKILL it. We want to be able to clean up the locks, so the best we can do is try to unlock the list on the SIGTERM. Once we get SIGKILLed, there's nothing we can do. This change also moves the Save() call into the try: block so that the finally: block /only/ unlocks the list. Thus, the list gets unlocked in most situations. There are still race conditions where 1) the config.db file could be corrupted; 2) list locks could still be unreleased. Given the semantics of signals in Python, the interaction of Apache's mod_cgi, and other factors, this is the best we can do, and it should be better than the old situation. XXX What do other web servers or cgi execution environments do?
* intermediatebwarsaw2001-04-021-0/+113