summaryrefslogtreecommitdiff
path: root/Mailman/Deliverer.py
Commit message (Collapse)AuthorAgeFilesLines
* Bite the bullet: rename the Mailman package to mailman.Barry Warsaw2008-02-271-174/+0
|
* Tweak copyright years.Barry Warsaw2008-02-071-1/+1
|
* Implement a context manager for Python 2.5's with statement, which isBarry Warsaw2007-09-191-10/+4
| | | | | | | | used where we used to do a try/except to temporarily change the global translation language. This makes the code shorter and cleaner. E.g. with i18n.using_language(another_language): # do something
* Finish up the request hold conversion. ListAdmin can go away thoughBarry Warsaw2007-09-161-47/+0
| | | | | | it hasn't yet. SendSubscribeAck(), SendUnsubscribeAck(), and ApprovedDeleteMember() are all removed, though the latter is not yet completely eradicated.
* Move the pending database into the SQLAlchemy/Elixir layer. The oldBarry Warsaw2007-08-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pending.py module is removed. Added an interface to this functionality such that any IPendable (essentially a key/value mapping) can be associated with a token, and that token can be confirmed and has a lifetime. Any keys and values can be stored, as long as both are unicodes. Added a doctest. Modified initialization of the database layer to support pluggability via setuptools. No longer is this layer initialized from a module, but now it's instantiated from a class that implements IDatabase. The StockDatabase class implements the SQLAchemy/Elixir layer, but this can be overridden in a setup.py. Bye bye MANAGERS_INIT_FUNCTION, we hardly knew ye. Added a package Mailman.app which will contain certain application specific functionality. Right now, the only there there is an IRegistar implementation, which didn't seem to fit anywhere else. Speaking of which, the IRegistrar interface implements all the logic related to registration and verification of email addresses. Think the equivalent of MailList.AddMember() except generalized out of a mailing list context. This latter will eventually go away. The IRegistrar sends the confirmation email. Added an IDomain interface, though the only implementation of this so far lives in the registration.txt doctest. This defines the context necessary for domain-level things, like address confirmation. A bunch of other cleanups in modules that are necessary due to the refactoring of Pending, but don't affect anything that's actually tested yet, so I won't vouch for them (except that they don't throw errors on import!). Clean up Defaults.py; also turn the functions seconds(), minutes(), hours() and days() into their datetime.timedelta equivalents. Consolidated the bogus email address exceptions. In some places where appropriate, use email 4.0 module names instead of the older brand. Switch from Mailman.Utils.unique_message_id() to email.utils.make_msgid() everywhere. This is because we need to allow sending not in the context of a mailing list (i.e. domain-wide address confirmation message). So we can't use a Message-ID generator that requires a mailing list. OTOH, this breaks Message-ID collision detection in the mail->news gateway. I'll fix that eventually. Remove the 'verified' row on the Address table. Now verification is checked by Address.verified_on not being None.
* Other than contrib files, convert all imports of mm_cfg to imports of config.Barry Warsaw2007-07-141-6/+6
| | | | | | | | | | | 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.
* Update copyright years.bwarsaw2007-01-191-1/+1
|
* SendSubscribeAck() - Removed test of self.send_welcome_message.msapiro2006-07-241-2/+0
| | | The caller may want to override the list setting.
* First crack at real virtual domain support, i.e. mailing lists with the samebwarsaw2006-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+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.
* 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-1/+2
|
* Update copyright years.bwarsaw2005-12-061-2/+3
|
* Don't send password in probe. The probe message may stray to someone else.tkikuchi2005-11-301-2/+1
| | | | Also, i18n fix.
* back porting from 2.1.6tkikuchi2005-08-281-4/+52
|
* FSF office has moved. chdcking in for MAIN branch.tkikuchi2005-08-271-1/+1
|
* Typo fix: Errors.MMListError rather than just MMListError.twouters2003-03-191-1/+1
|
* SendHostileSubscriptionNotice(): When someone is invited to a mailingbwarsaw2003-03-161-5/+51
| | | | | | | | | list but attempts to confirm to a different list, we want to disallow this and send notifications to the owners of both attacked lists. Closes SF bug # 703941 by Stuart Bishop. Also True/False where appropriate.
* Copyright yearsbwarsaw2003-03-111-1/+1
|
* Add the email address just subscribed to the variables usable intwouters2003-03-111-0/+1
| | | | | | | | subscribeack.txt, as 'user' (like userpass.txt already has.) This allows you to write subscribeack.txt's that go like: You subscribed using the email address %(user)s. If you wish to change this, please visit ... [etc]
* SendUnsubscribeAck(): We must pass the target language in as anbwarsaw2002-12-311-2/+2
| | | | | argument, because by the time we get here, the member has already been unsubscribed.
* ForwardMessage(): The signature of the OwnerNotification constructorbwarsaw2002-10-231-2/+1
| | | | | | | | is changing. We no longer pass the sender in since that's calculated to be the site list's -bounces address to prevent mail loops when a list's owner bounces. Problem diagnosed by Peer Heinlein.
* SendSubscribeAck(), SendUnsubscribeAck(), MailUserPassword(): Sincebwarsaw2002-10-181-3/+3
| | | | | these messages are destined for one recipient anyway, we'll turn on VERP if VERP_PERSONALIZED_DELIVERIES is enabled.
* ForwardMessage(): Typo. OwnerNotification's don't take a langbwarsaw2002-10-151-1/+0
| | | | | argument (since they can calculate that from the mlist argument). Found by Mentor Cana.
* Whitespace normalized and pycheckerfied.bwarsaw2002-10-151-13/+12
|
* ForwardMessage(): Change the signature a bit to use the newbwarsaw2002-10-151-7/+6
| | | | | | OwnerNotification class in Message.py. We don't need the recips argument since we're always going to calculate that from self's owners and moderators (if the tomoderators flag is true).
* ForwardMessage(): The UserNotification neeeds to have its languagebwarsaw2002-10-141-1/+2
| | | | specified. Patch supplied by Tokio Kikuchi.
* ForwardMessage(): Refactor the various places where we're forwardingbwarsaw2002-10-071-0/+21
| | | | messages into a single method.
* MailUserPassword(): Missed a conversion to MemberAdaptor. Found bybwarsaw2002-06-291-1/+1
| | | | Tollef Fog Heen, with a friendly reminder from Marc MERLIN.
* SendSubscribeAck(): Prepend any text given in the mass subscribe pagebwarsaw2002-05-281-2/+2
| | | | to the subscription notification.
* GetAdminEmail() eradication campaign.bwarsaw2002-03-261-2/+2
| | | | | | SendUnsubscribeAck(), MailUserPassword(): These now look like they're coming from the -bounces address instead of the -admin address, which is deprecated.
* SendSubscribeAck(), SendUnsubscribeAck(), MailUserPassword(): Whenbwarsaw2002-02-111-4/+5
| | | | | | | | creating the UserNotification message object, pass in the language that the message should be in. This allows us to get the character set and header encodings right. Patch by Ben Gertzfield.
* SendUnsubscribeAck(): Use a better Subject: on the message that getsbwarsaw2001-10-211-3/+3
| | | | sent to the user when they're unsubscribed.
* MailUserPassword(): Rip out the checks for isMember(user) andbwarsaw2001-08-161-28/+32
| | | | | | | | | | | | | | | | getMemberPassword(user). First, we assert that the user is a member because there should be no way to get here if that's not the case. Second, it is a nasty bug if the user does not have a valid password, but one that the list administrator really can do little about. Instead, if the user is found to have a `false' password, we simply assign them a new one, which is fine because they're asking for their password now, so we'll just ship them the new one. This means we no longer need templates/*/nopass.txt, soon to be deleted. It also means that we won't raise MMBadUserError here, which is fine because the caller never checked for that exception anyway. ;)
* Another step towards conversion to MemberAdaptor API.bwarsaw2001-07-291-3/+3
| | | | GetPreferredLanguage() -> getMemberLanguage()
* All:bwarsaw2001-07-181-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | GetConfigInfo(): Removed. All admin ui gui elements are moved into components in the Mailman/Gui subdirectory. All membership related attribute access should use the MemberAdaptor API instead, e.g. IsMember() -> isMember() GetUserOption() -> getMemberOption() SetUserOption() -> setMemberOption() Also use ApprovedDeleteMember() instead of DeleteMember(). Deliverer.py: Remove last vestiges of os.environ['LANG'] Digester.py: SetUserDigest(): Removed. This is replaced by OldStyleMemberships's setMemberOption() method when flag == mm_cfg.Digests
* MailUserPassword(): Include the full posting email address of the listbwarsaw2001-05-311-2/+3
| | | | | | | | | in the userpass.txt notification. Change the 'adminaddr' key to 'owneraddr' since we want them to contact the list-owner@ with questions, not the list-admin@ (which does bounce processing). Also, sent the message as if it were coming from the -admin address not the -request address.
* SendSubscribeAck(), MailUserPassword(): In addition to passing in thebwarsaw2001-05-181-4/+3
| | | | | | | | user's preferred language, also pass in self so maketext() can dig out the list's preferred language if for some odd reason the user's preferred language can't be found. Also, remove the obsolete os.environ['LANG'] setting.
* Interim i18n change.bwarsaw2001-02-281-9/+11
| | | | | | | Fix the Utils.maketext() calls to pass the language in as a keyword argument. Fix some _() wrappings to use local variables.
* SendSubscribeAck(): I18n the welcome messages.bwarsaw2001-02-151-10/+8
| | | | | | | | De-string-module-ify. References to HandlerAPI module removed. Use new mimelib interface.
* Latest set of I18N patches from jcrey. Specifically,bwarsaw2000-12-261-5/+8
| | | | | SendSubscribeAck(), SendUnsubscribeAck(), MailUserPassword(): Set $LANG to user's preferred language. Call maketext() with language.
* First integration patch for Juan Carlos's translatable string changesbwarsaw2000-12-071-6/+6
|
* SendSubscribeAck(): Since the notification message contains passwords,bwarsaw2000-09-191-0/+1
| | | | | this message should not be archived. Set "X-No-Archive: yes". Closes SF bug #114193.
* SendSubscribeAck(), MailUserPassword() => GetScriptURL(...,bwarsaw2000-08-011-3/+3
| | | | absolute=1)
* MailUserPassword(): If the user didn't have a password, requestaddrbwarsaw2000-03-231-1/+1
| | | | wasn't set.
* Update the copyright lines to include the years 1999 & 2000.bwarsaw2000-03-211-1/+1
|
* SendSubscribeAck(), MailUserPassword(): Use listname-request insteadbwarsaw2000-02-031-6/+4
| | | | | | of listname-admin as the sender of the acknowledgment. MailUserPassword(): Removed some debugging code.
* MailUserPassword(): Don't stick a newline at the end of the subjectbwarsaw1999-11-261-2/+5
| | | | text, otherwise this messes up the message headers.
* Much simplification, since most of this work has been moved to thebwarsaw1999-11-241-210/+38
| | | | | | | | message pipeline modules. Specifically, AddNonStandardHeaders(), SendTextToUser(), DeliverToUser(), QuotePeriods(), DeliverToOwner(), DeliverToList(), CreateSubscribeAck(): All these methods have been removed.
* PR#107 reports that Pegasus (presumably an MUA) usesbwarsaw1999-09-021-0/+1
| | | | | X-Confirm-Reading-To: to get automated receipts, so we need to remove this header too.