summaryrefslogtreecommitdiff
path: root/Mailman/Utils.py
Commit message (Collapse)AuthorAgeFilesLines
...
* changed the site site variable ADMIN_MEMBER_CHUNKSIZE to a per-listcotton1998-10-231-1/+1
| | | | | | | | | | | | | | | | | variable (admin_member_chunksize). this is not yet settable by means of cgi, but you can set it at an interactive python session. This is a start on making the membership management part of the admin cgi scalable for really big lists. details: * up'd DATA_FILE_VERSION in Mailman/Defaults.py.in * replaced ADMIN_MEMBER_CHUNKSIZE with DEFAULT_ADMIN_MEMBER_CHUNKSIZE in Mailman/Defaults.py.in. * added a list variable assignment in Mailman.MailList.InitVars * added code to add the admin_member_chunksize attribute to a list when versions change in Mailman/versions.py * made admin.py format members according to list.admin_member_chunksize instead of mm_cfg.ADMIN_MEMBER_CHUNKSIZE scott
* added adminitrivia filter and an "administrivia" list attribute thatcotton1998-10-121-3/+57
| | | | | | | | | | | | | | | | | is editable via the admin cgi to turn the filter on and off. I'm sure that the filter could catch more things, but it will have less false positives than majordomo anway :) a listing of the specific changes follows: Defaults.py.in changed data file version and added DEFAULT_ADMINISTRIVIA Utils.py added a function IsAdministrivia(msg) that does the filtering replaced re.sub with string.replace(much faster) in (Un)ObscureEmail. MailList.py: added the config info for the administrivia variable, and made the post method check it if the list has the variable set. versions.py: make new lists have an administrivia variable scott
* These changes allow case-preserved usernames in email addresses ofcotton1998-10-121-37/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | list members. I have yet to look at handling of -admin addresses. Also, there is a configurable variable in Defaults.py that allows the site admin to decide whether or not to do "smart address matching" - where scott@chronis.pobox.com matches scott@pobox.com as the same address (these addresses are in reality different addresses ;). A listing of the changes to the files follows: Defaults.py.in - added SMART_ADDRESS_MATCH variable and a short description, defaulting to 1. MailCommanHandler: removed string.lower(address) in processSubscribeCmd and replaced it with Utils.LCDomain(address) MailList.py: made AddMember and ApprovedAddMember use Utils.LCDomain(address) instead of string.lower(address) Utils.py: got rid of top level domain listing and commented out corresponding code in ValidEmail since it seems clear that we have no intention of using this anymore. added LCDomain(address) which lowercases only the domain part of an address if there is a domain part. made AddressesMatch use LCDomain instead of string.lower, made it check LCDomain(addr1) == LCDomain(addr2) if mm_cfg.SMART_ADDRESS_MATCH is set to 0, and do the match it used to do if that variable is set to 1. scott
* changed contact_transport so that it doesn't invoke a queue runcotton1998-10-051-11/+17
| | | | | | | | | | | | | ditto for Utils.SendTextToUser. rearranged OutgoingQueue so that 1) it sets a global lock to only allow on queue run at a time 2) enqueueMessage puts a queue entry in an active state 2) the queue run only processes messages in a deferred state or messages that are in an active state but stale 3) it has a deferMessage interface. which is now used by Utils.TrySMTPDelivery It now keeps track of the state of a q entry by means of file metadata - if the qfile is setuid, it's in active state, if it's not it's in deferred state. scott
* TrySMTPDelivery(): Regularize the ways that various exceptions areklm1998-08-031-14/+21
| | | | expressed, and log failures to smtp-failures.
* TrySMTPDelivery: The queueing activity had to be more discriminating,klm1998-08-011-5/+26
| | | | | | | | | | | | | | | | | or else failures, like bad local recipients, would remain on the queue forever, and cause repeat deliveries. (I believe this is part of the problem behind the repeats we're seeing - but i'm not convinced it's all of it.) To fix, i made it so only partcicular exceptions - currently socket.error, for absent SMTP listener - cause items to be left on queue. Otherwise it falls through to a blanket except which discards the item, leaving a note in the error log to that effect. *** I think where the info should go back to the maillist structure, to, e.g., disable the recipient, or whatever. However, this is happening in a forked process, so we cannot use an exception, and the routine itself doesn't, and shouldn't know which the list is.
* wrap(): Two small fixes: strip off the two extra newlines that get putbwarsaw1998-07-221-2/+9
| | | | | on the end of the last line of wrapped text; watch out for whitespace at the front of split lines.
* Whoops, there was another call to smtplib that needed the indirection.viega1998-07-201-1/+1
|
* Wrapped the call to smtplib with some queueing code.viega1998-07-201-3/+15
| | | | There's a new crontab entry that checks the queue once every 30 mins.
* Moved wrapping/filling to maketext() template generator.bwarsaw1998-07-061-7/+11
| | | | | | SendTextToUser() no longer has a raw argument and no longer calls wrap() in any way. maketext() has a raw argument, default to zero, which if true skips the call to wrap() on the interpolated text.
* Removed classes Logger and StampedLogger, into modules in thebwarsaw1998-07-021-119/+3
| | | | Mailman.Logging package
* Convert all module names to their new names.bwarsaw1998-06-191-6/+24
| | | | | | maketext(): New function which takes a template file name and a dictionary, reads the template from mm_cfg.TEMPLATE_DIR and interpolates the dictionary into the string.
* Fixed a bug where sometimes a leading / is missing from PATH_INFO.viega1998-06-051-1/+3
|
* Added a method: GetNestingLevel(), which returns how many ../'s areviega1998-06-031-0/+11
| | | | | needed to get back to http://xxxx/mailman/ based on the PATH_INFO environment variable.
* Fixed a bug in wrap where wrap would error if the length of the stringviega1998-06-031-1/+1
| | | | being wrapped was the same as the column parameter.
* Integrated Scott's cookie code into the distribution.viega1998-05-301-0/+14
| | | | | | Note that it does have one problem... If you have cookies off, you have to log in every time, plus your changes don't take effect! That definitely needs to be fixed.
* Modfied DeliverToUser to use smtplib instead of a call to sendmail.viega1998-05-281-10/+12
| | | | | Note that I'm using my smtplib right now, and not the one that comes w/ Python 1.5. That should probably be changed.
* Removed RCS crudbwarsaw1998-05-261-3/+73
| | | | | | | | | | | | | | | | | wrap(): New function which implements the wrapping and filling algorithm, as described in the function's docstring. After talking it over with Guido and Ken, this seemed like the best compromise for ensuring that emailed messages to users look okay, when their MUAs don't auto-wrap. SendTextToUser(): Added optional argument raw which defaults to zero (meaning by default, wrap and fill as per the rules in wrap()). When raw=1, no wrapping or filling of the text argument is performed. While Ken thinks that wrapping/filling should be turned off by default, I think there are many more cases where the text should be wrapped and filled than not, so this go'round tries to minimize code changes. If the consensus is to invert the default value, we can make that change after grep'ing the code.
* Fixed a typo in the zipcode.viega1998-05-261-2/+2
|
* Added copyright notices to all source files where I am legally entitled to ↵viega1998-05-251-1/+18
| | | | | | | do so. Added a copy of the GNU GPL. Added information about mailman-users in README, and reworded some text in there (made the credits less verbose... perhaps they should move to a credits file?)
* Removed change_boundary() - not necessary, now that the Digest classklm1998-05-041-17/+1
| | | | is doing the right thing right off the bat.
* New routine change_boundary, for substituting one mime boundary forklm1998-04-271-1/+17
| | | | another.
* ValidEmail(): Elide the constraint that addresses have their top-levelklm1998-04-231-11/+11
| | | | | | domain among those iterated among valid_toplevels. Depending on ensuing discussion on the mailman-developers list, i'll probably cut this out completely.
* Added "su" to valid top levels.klm1998-04-231-2/+2
|
* DeliverToUser(): Add newline-terminators to add_header items whenklm1998-04-121-1/+3
| | | | | lacking. Otherwise, multiple ones will glom (were gloming) together on a single line.
* DeliverToUser(): Aha! Resolved elusive bug - addresses containingklm1998-04-111-2/+3
| | | | | | | | | | | quotes - eg, gordon_o'hara@vanguard.com - was losing the quote when passed on the command line to sendmail. Fixed by doing a repr() of th recipient, so eg gordon_o\'hara@vanguard.com was being passed - and accepted properly by sendmail. Now i think i have to do the same thing with scripts/deliver, sigh - it'd be good to get the direct SMTP based mechanism in, but i didn't have time to work it through, uncover the ramifications...
* Preparing to package a distribution - add a module docstring andmailman1998-04-091-0/+10
| | | | __version__ info.
* SendTextToUser(), DeliverToUser() - Generalized addition of specialklm1998-04-071-6/+9
| | | | | headers to a add_headers optional arg - a list for headers like Errors-To and X-No-Archive.
* Adding 'nofail' option to StampedLogger init, so programs that useklm1998-03-301-8/+23
| | | | | StampedLogger for debugging output can choose to initialize it so that failure is detectable, and thus can be handled in the program.
* AddressesMatch(): Do the right thing (in particular, no traceback!)klm1998-03-301-15/+29
| | | | | | | | | | when one of the addresses has no domain. StampedLogger(): New option manual_reprime makes better for use as sys.stderr substitute - says to put the timestamp only on first write or writes just succeeding a .reprime() call - so the timestamp divides separate multi-line entries. And in any case, write the timestamp/label prefix on when at the beginning of a new line.
* Include "manual_reprime" option in StampedLogger. When on (off byklm1998-03-291-5/+22
| | | | | | | | | | | default), timestamps will only be included at beginning of new entries after the first entry and after entries that are preceeded by a call to the .reprime() method. This is handy for when StampedLogger is used as a substitute for sys.stderr, where you would like to see groups of entries collected together in a single timestamp (and you often only have a single group, for uncaught exceptions where the script is failing...)
* Unlock only if alredy locked.mailman1998-03-271-1/+1
|
* Simpliefied FindMatchineAddress - it now only recognizes similaritymailman1998-03-261-25/+34
| | | | | | | | | | | | | | | | | | when the domain side of the at sign of one address properly contains the domain in the other example. Wrap DeliverToUser body in a os.fork, to prevent a deadlock which can happen when, eg, a message bounces before message aceptance in sendmail. Message bouncing early on in message acceptance by sendmail means reporting to list admin address, which is itself actually a mailman program, which uses the instantiated list as a agent, and which requires the same lock that the invoking process is holding - ie, deadlock Sendmail's deliver-in-background option would be great for this, except that the error processing for immediately recognized delivery problems turns out to be handled in the foreground, regardless of the bg delivery option.
* Added logger and moved SendTextToUser and DeliverToUsermailman1998-03-241-4/+107
| | | | | | | | | | | | | | | | | | functionalities here. Logger() and StampedLogger() routines provide file-like file logging mechanisms. (I reimplmented the list .LogMsg() method based on this routine.) This is implemented outside the list infrastructure so it can be used for, eg, stderr substitution. SendTextToUser() and DeliverToUser() implemented here likewise, so they can be used outside list context (eg, when lists are broken...). Made AddressesMatch not raise error when one of the address arguments yields a null domain. Moved comment about .FindMatchingAddresses() to be the function docstring.
* map_maillists() - New convenience routine for interactive pythonmailman1998-03-201-0/+26
| | | | | | | | sessions with lists, applies user specified routine to all of the lists, or optionally, those lists with user-specified names. Optional arg unlock says to unlocked immediately after instantiation, for non-invasive actions. Optional arg verbose says to print list name and result incrementally as they're handled.
* Moved list_names() here from where i recently created it,mailman1998-03-131-2/+14
| | | | | | | maillist.py. Moved abstract description part of comment before ValidEmail in as a docstring. (We need more and decent docstrings in this code!!)
* ObscureEmail(), UnobscureEmail(): new routines for invertablyklm1998-03-081-1/+20
| | | | | | | | | | | | | | transforming email addresses so they're not apparent to web spiders, therefore not scrapable by spammers. The UnobscureEmail transformation should work like an identity function on already-unobscured addresses, so it can be used with impunity. The routines should be used as functional interface to address obscuring, so the scheme can be changed transparently to the rest of the system, just by changing the routines. This should make it easy to up the ante in the thwarting of spammers, if this catches on.
* MakeDirTree(): Change default permission to 775 (was 774, previousklm1998-03-081-1/+1
| | | | 744) so group can get in created directories.
* MakeDirTree: use umask 774 rathern than 744, so group members doingklm1998-03-071-3/+8
| | | | | | | | development have access, also. More importantly, zero the umask before actually creating the dir (and restore it afterwards), so the permissions are exactly as specified, Also wrapped a long line.
* Get rid of gratuitous bare 'except:'.mailman1998-02-221-1/+1
|
* Initial revisionklm1998-01-071-0/+154